///
import type { AxiosInstance } from "axios";
import type { AxiosPromise } from "axios";
import type { AxiosRequestConfig } from "axios";
import { AxiosResponse } from "axios";
import type { ZodType } from "zod";
declare type AnyFn = (...args: any[]) => any;
/**
*
* @export
* @class BaseAPI
*/
declare class BaseAPI {
protected basePath: string;
protected axios: AxiosInstance;
protected configuration: Configuration | undefined;
constructor(
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
);
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface BooleanType
*/
declare interface BooleanType {
/**
*
* @type {string}
* @memberof BooleanType
*/
type: BooleanTypeTypeEnum;
/**
*
* @type {boolean}
* @memberof BooleanType
*/
value: boolean;
}
declare const BooleanTypeTypeEnum: {
readonly Boolean: "boolean";
};
declare type BooleanTypeTypeEnum =
(typeof BooleanTypeTypeEnum)[keyof typeof BooleanTypeTypeEnum];
export declare function bulkCreateEvaluations(
evaluations: Array,
): Promise;
export declare class Configuration {
/**
* parameter for apiKey security
* @param name security name
* @memberof Configuration
*/
apiKey?:
| string
| Promise
| ((name: string) => string)
| ((name: string) => Promise);
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
username?: string;
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
password?: string;
/**
* parameter for oauth2 security
* @param name security name
* @param scopes oauth2 scope
* @memberof Configuration
*/
accessToken?:
| string
| Promise
| ((name?: string, scopes?: string[]) => string)
| ((name?: string, scopes?: string[]) => Promise);
/**
* override base path
*
* @type {string}
* @memberof Configuration
*/
basePath?: string;
/**
* base options for axios calls
*
* @type {any}
* @memberof Configuration
*/
baseOptions?: any;
/**
* The FormData constructor that will be used to create multipart form data
* requests. You can inject this here so that execution environments that
* do not support the FormData class can still run the generated client.
*
* @type {new () => FormData}
*/
formDataCtor?: new () => any;
/**
* Custom logger that clients can provide to capture logs/warnings/errors from the SDK.
*/
logger?: {
info: (message: string, context?: any) => void;
warn: (message: string | Error, context?: any) => void;
};
constructor(param?: ConfigurationParameters);
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime: string): boolean;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export declare interface ConfigurationParameters {
apiKey?:
| string
| Promise
| ((name: string) => string)
| ((name: string) => Promise);
username?: string;
password?: string;
accessToken?:
| string
| Promise
| ((name?: string, scopes?: string[]) => string)
| ((name?: string, scopes?: string[]) => Promise);
basePath?: string;
baseOptions?: any;
formDataCtor?: new () => any;
logger?: {
info: (message: string, context?: any) => void;
warn: (message: string | Error, context?: any) => void;
};
}
export declare const constructSubmissionPayloadAdvanced: (
pipelineIdentifier: string,
testRuns: TestRun[],
context?: ResultContext,
triggerRemoteEvals?: boolean,
) => TestResultPostRequest;
export declare const constructSubmissionPayloadSimple: (
pipelineSlug: string,
testRuns: V1TestResultSimplePostRequestTestRunsInner[],
context?: ResultContext,
) => V1TestResultSimplePostRequest;
export declare type Context = PipelineRunContext & CoreStepRunContext;
export declare type CoreStepRunContext = {
render?: {
type: "html";
key: string;
};
metadata?: Metadata;
};
/**
* Creates a new dataset in the Gentrace API.
* @async
* @param {CreateDatasetV2} payload - The dataset creation payload.
* @returns {Promise} - A promise that resolves to the created dataset.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const createDataset: (
payload: CreateDatasetV2,
) => Promise;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CreateDatasetV2
*/
declare interface CreateDatasetV2 {
/**
*
* @type {string}
* @memberof CreateDatasetV2
*/
name: string;
/**
*
* @type {string}
* @memberof CreateDatasetV2
*/
description?: string | null;
/**
*
* @type {string}
* @memberof CreateDatasetV2
*/
pipelineId?: string;
/**
*
* @type {string}
* @memberof CreateDatasetV2
*/
pipelineSlug?: string;
/**
*
* @type {boolean}
* @memberof CreateDatasetV2
*/
isGolden?: boolean;
}
export declare type CreateEvaluationType = CreateEvaluationV2;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CreateEvaluationV2
*/
declare interface CreateEvaluationV2 {
/**
* Optionally add a note to the evaluation
* @type {string}
* @memberof CreateEvaluationV2
*/
note?: string;
/**
* The ID of the evaluator. The evaluator and run must be in the same pipeline.
* @type {string}
* @memberof CreateEvaluationV2
*/
evaluatorId: string;
/**
* The ID of the run. The evaluator and run must be in the same pipeline.
* @type {string}
* @memberof CreateEvaluationV2
*/
runId: string;
/**
* If the evaluator output type is an enum, the label of the enum value.
* @type {string}
* @memberof CreateEvaluationV2
*/
evalLabel?: string;
/**
* If the evaluator output type is a percentage, a number between 0 and 1 representing the percentage.
* @type {number}
* @memberof CreateEvaluationV2
*/
evalValue?: number;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CreateFeedbackV2
*/
declare interface CreateFeedbackV2 {
/**
* The unique identifier for the pipeline run
* @type {string}
* @memberof CreateFeedbackV2
*/
pipelineRunId: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof CreateFeedbackV2
*/
recordedTime: number;
/**
* The score of the feedback, ranging from 0 to 1
* @type {number}
* @memberof CreateFeedbackV2
*/
score: number;
/**
* Optional details about the feedback
* @type {string}
* @memberof CreateFeedbackV2
*/
details?: string | null;
}
/**
*
* @export
* @interface CreateMultipleTestCases
*/
declare interface CreateMultipleTestCases {
/**
* Slug for the pipeline
* @type {string}
* @memberof CreateMultipleTestCases
*/
pipelineSlug?: string;
/**
* ID of the dataset
* @type {string}
* @memberof CreateMultipleTestCases
*/
datasetId?: string;
/**
*
* @type {Array}
* @memberof CreateMultipleTestCases
*/
testCases: Array;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CreateMultipleTestCasesTestCasesInner
*/
declare interface CreateMultipleTestCasesTestCasesInner {
/**
* Name of the test case.
* @type {string}
* @memberof CreateMultipleTestCasesTestCasesInner
*/
name: string;
/**
* Input for the test case. Must be a valid JSON object and not an array.
* @type {{ [key: string]: any; }}
* @memberof CreateMultipleTestCasesTestCasesInner
*/
inputs: {
[key: string]: any;
};
/**
* Expected outputs for the test case
* @type {object}
* @memberof CreateMultipleTestCasesTestCasesInner
*/
expectedOutputs?: object;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface CreateSingleTestCase
*/
declare interface CreateSingleTestCase {
/**
* Slug for the pipeline
* @type {string}
* @memberof CreateSingleTestCase
*/
pipelineSlug?: string;
/**
* ID of the dataset
* @type {string}
* @memberof CreateSingleTestCase
*/
datasetId?: string;
/**
* The name of the test case
* @type {string}
* @memberof CreateSingleTestCase
*/
name: string;
/**
* The input data for the test case as a JSON object
* @type {{ [key: string]: any; }}
* @memberof CreateSingleTestCase
*/
inputs: {
[key: string]: any;
};
/**
* The expected outputs for the test case as a JSON object
* @type {object}
* @memberof CreateSingleTestCase
*/
expectedOutputs?: object | null;
}
/**
* Creates a single test case for a given pipeline ID from the Gentrace API
*
* @async
* @param {CreateSingleTestCase} payload - New test case payload
* @throws {Error} Throws an error if the SDK is not initialized. Call init() first.
* @returns {Promise} A Promise that resolves to the created case ID
* @remarks If a pipeline slug is specified, the golden dataset will be used.
* If a datasetId is provided, it will be used instead.
*/
export declare const createTestCase: (
payload: CreateSingleTestCase,
) => Promise;
/**
* Creates multiple test cases for a given pipeline ID from the Gentrace API
*
* @async
* @param {CreateMultipleTestCases} payload - New test case payloads
* @throws {Error} Throws an error if the SDK is not initialized. Call init() first.
* @returns {Promise} A Promise that resolves to the number of test cases successfully created
* @remarks If a pipeline slug is specified, the golden dataset will be used.
* If a datasetId is provided, it will be used instead.
*/
export declare const createTestCases: (
payload: CreateMultipleTestCases,
) => Promise;
/**
* Creates test runners for a given pipeline using locally provided test data
* @param {Pipeline<{ [key: string]: GentracePlugin }>} pipeline - The pipeline instance
* @param {LocalTestData[]} localData - Array of local test data objects
* @returns {Array} An array of PipelineRunTestCaseTuple
*/
export declare function createTestRunners(
pipeline: Pipeline<{
[key: string]: GentracePlugin;
}>,
localData: LocalTestData[],
): Array;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface DatasetV2
*/
declare interface DatasetV2 {
/**
*
* @type {string}
* @memberof DatasetV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof DatasetV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof DatasetV2
*/
updatedAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof DatasetV2
*/
archivedAt?: number | null;
/**
*
* @type {string}
* @memberof DatasetV2
*/
name: string;
/**
*
* @type {string}
* @memberof DatasetV2
*/
description?: string | null;
/**
*
* @type {string}
* @memberof DatasetV2
*/
pipelineId: string;
}
export declare function defineInteraction<
T = any,
Fn extends InteractionFn = InteractionFn,
>(interaction: InteractionDefinition): Fn;
export declare function defineTestSuite(testSuite: {
name: string;
fn: Fn;
}): Fn;
export declare function deinit(): void;
/**
* Deletes a single test case from the Gentrace API
*
* @async
* @param {string} id - The ID of the test case to delete
* @throws {Error} Throws an error if the SDK is not initialized or if the test case ID is invalid
* @returns {Promise} A Promise that resolves to true if the test case was successfully deleted
* @remarks This function deletes an existing test case with the provided ID.
*/
export declare const deleteTestCase: (id: string) => Promise;
export declare const enumParameter: ({
name,
options,
defaultValue,
}: {
name: string;
options: string[];
defaultValue: string;
}) => {
name: string;
getValue: () => string;
};
export declare type EvaluationType = EvaluationV2;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface EvaluationV2
*/
declare interface EvaluationV2 {
/**
* The ID of the evaluation
* @type {string}
* @memberof EvaluationV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluationV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluationV2
*/
updatedAt: number;
/**
* Indicates if the evaluation is pending
* @type {boolean}
* @memberof EvaluationV2
*/
isPending: boolean;
/**
* Indicates if the evaluation is filtered
* @type {boolean}
* @memberof EvaluationV2
*/
isFiltered: boolean;
/**
* Debug information for the evaluation
* @type {{ [key: string]: any; }}
* @memberof EvaluationV2
*/
debug?: {
[key: string]: any;
} | null;
/**
* The ID of the evaluator
* @type {string}
* @memberof EvaluationV2
*/
evaluatorId: string;
/**
* The ID of the run
* @type {string}
* @memberof EvaluationV2
*/
runId: string;
/**
* The ID of the comparison run, if applicable
* @type {string}
* @memberof EvaluationV2
*/
comparisonRunId?: string | null;
/**
* The name of the evaluation
* @type {string}
* @memberof EvaluationV2
*/
name: string | null;
/**
* The label of the evaluation
* @type {string}
* @memberof EvaluationV2
*/
evalLabel: string | null;
/**
* The value of the evaluation
* @type {number}
* @memberof EvaluationV2
*/
evalValue: number | null;
/**
* The email of the user who manually created the evaluation, if applicable
* @type {string}
* @memberof EvaluationV2
*/
manualCreatedByEmail?: string | null;
/**
* Additional notes for the evaluation
* @type {string}
* @memberof EvaluationV2
*/
note: string;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface EvaluationV3
*/
declare interface EvaluationV3 {
/**
* The ID of the evaluation
* @type {string}
* @memberof EvaluationV3
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluationV3
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluationV3
*/
updatedAt: number;
/**
* Indicates if the evaluation is pending
* @type {boolean}
* @memberof EvaluationV3
*/
isPending: boolean;
/**
* Indicates if the evaluation is filtered
* @type {boolean}
* @memberof EvaluationV3
*/
isFiltered: boolean;
/**
* Debug information for the evaluation
* @type {{ [key: string]: any; }}
* @memberof EvaluationV3
*/
debug?: {
[key: string]: any;
} | null;
/**
* The ID of the evaluator
* @type {string}
* @memberof EvaluationV3
*/
evaluatorId: string | null;
/**
* The ID of the run
* @type {string}
* @memberof EvaluationV3
*/
runId: string;
/**
* The ID of the comparison run, if applicable
* @type {string}
* @memberof EvaluationV3
*/
comparisonRunId?: string | null;
/**
* The name of the evaluation
* @type {string}
* @memberof EvaluationV3
*/
name: string | null;
/**
* The label of the evaluation
* @type {string}
* @memberof EvaluationV3
*/
evalLabel: string | null;
/**
* The value of the evaluation
* @type {number}
* @memberof EvaluationV3
*/
evalValue: number | null;
/**
* The email of the user who manually created the evaluation, if applicable
* @type {string}
* @memberof EvaluationV3
*/
manualCreatedByEmail?: string | null;
/**
* Additional notes for the evaluation
* @type {string}
* @memberof EvaluationV3
*/
note: string;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface EvaluatorV2
*/
declare interface EvaluatorV2 {
/**
* The ID of the evaluator
* @type {string}
* @memberof EvaluatorV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluatorV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluatorV2
*/
updatedAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof EvaluatorV2
*/
archivedAt?: number | null;
/**
*
* @type {string}
* @memberof EvaluatorV2
*/
icon?: string | null;
/**
* The name of the evaluator
* @type {string}
* @memberof EvaluatorV2
*/
name: string;
/**
* For evaluators with options scoring, the available options to choose from
* @type {Array}
* @memberof EvaluatorV2
*/
options?: Array | null;
/**
* For AI evaluators, the AI model to use
* @type {string}
* @memberof EvaluatorV2
*/
aiModel?: string;
/**
* The ID of the pipeline that the evaluator belongs to
* @type {string}
* @memberof EvaluatorV2
*/
pipelineId?: string | null;
/**
* The ID of the processor associated with the evaluator
* @type {string}
* @memberof EvaluatorV2
*/
processorId?: string | null;
/**
* The ID of the organization that the evaluator belongs to
* @type {string}
* @memberof EvaluatorV2
*/
organizationId?: string;
/**
* For evaluator templates, the description of the template
* @type {string}
* @memberof EvaluatorV2
*/
templateDescription?: string;
/**
* For heuristic evaluators, the heuristic function to use
* @type {string}
* @memberof EvaluatorV2
*/
heuristicFn?: string | null;
/**
* For heuristic evaluators, the coding language of the heuristic function (such as \"JAVASCRIPT\", \"PYTHON\")
* @type {string}
* @memberof EvaluatorV2
*/
heuristicFnLanguage?: string;
/**
* For AI evaluators, the prompt template that should be sent to the AI model
* @type {string}
* @memberof EvaluatorV2
*/
aiPromptFormat?: string | null;
/**
* For AI image evaluators, the paths to the image URLs
* @type {Array}
* @memberof EvaluatorV2
*/
aiImageUrls?: Array;
/**
* For human evaluators, the instructions for the human to follow
* @type {string}
* @memberof EvaluatorV2
*/
humanPrompt?: string | null;
/**
* For classification evaluators, the path to the predicted classification
* @type {string}
* @memberof EvaluatorV2
*/
classifierValuePath?: string | null;
/**
* For classification evaluators, the path to the expected classification
* @type {string}
* @memberof EvaluatorV2
*/
classifierExpectedValuePath?: string | null;
/**
* For classification evaluators using multi-class evaluation, the available options to match with
* @type {Array}
* @memberof EvaluatorV2
*/
multiClassOptions?: Array;
/**
* The type of evaluator (such as \"AI\", \"HEURISTIC\", \"HUMAN\", \"CLASSIFIER\")
* @type {string}
* @memberof EvaluatorV2
*/
who: string;
/**
* The scoring method used by the evaluator (such as \"ENUM\", \"PERCENTAGE\")
* @type {string}
* @memberof EvaluatorV2
*/
valueType: string;
/**
* The run condition of the evaluator (such as \"TEST_PROD\", \"TEST\", \"PROD\", \"COMPARISON_2\")
* @type {string}
* @memberof EvaluatorV2
*/
runCondition: string;
/**
* Use \"samplingProbability\" instead
* @type {boolean}
* @memberof EvaluatorV2
* @deprecated
*/
prodEvalActive?: boolean;
/**
* When optionally running on production data, the associated sampling probability of this evaluator (from 0 to 100)
* @type {number}
* @memberof EvaluatorV2
*/
samplingProbability?: number | null;
}
/**
* @type ExpandedPipeline
* @export
*/
declare type ExpandedPipeline = ExpandedPipelineAllOf & Pipeline_2;
/**
*
* @export
* @interface ExpandedPipelineAllOf
*/
declare interface ExpandedPipelineAllOf {
/**
*
* @type {Array}
* @memberof ExpandedPipelineAllOf
*/
evaluators?: Array;
}
/**
* @type ExpandedTestResult
* @export
*/
declare type ExpandedTestResult = ExpandedTestResultAllOf & TestResult;
/**
*
* @export
* @interface ExpandedTestResultAllOf
*/
declare interface ExpandedTestResultAllOf {
/**
*
* @type {ExpandedPipeline}
* @memberof ExpandedTestResultAllOf
*/
pipeline?: ExpandedPipeline;
/**
*
* @type {Array}
* @memberof ExpandedTestResultAllOf
*/
runs?: Array;
}
/**
* @type ExpandedTestRun
* @export
*/
declare type ExpandedTestRun = ExpandedTestRunAllOf & TestRun_2;
/**
*
* @export
* @interface ExpandedTestRunAllOf
*/
declare interface ExpandedTestRunAllOf {
/**
*
* @type {FullRun}
* @memberof ExpandedTestRunAllOf
*/
full?: FullRun;
/**
*
* @type {Array}
* @memberof ExpandedTestRunAllOf
*/
steps?: Array;
/**
*
* @type {TestCase}
* @memberof ExpandedTestRunAllOf
*/
case?: TestCase;
/**
*
* @type {Array}
* @memberof ExpandedTestRunAllOf
*/
evaluations?: Array;
/**
* Error message if the test run failed
* @type {string}
* @memberof ExpandedTestRunAllOf
*/
error?: string | null;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface FeedbackRequest
*/
export declare interface FeedbackRequest {
/**
*
* @type {string}
* @memberof FeedbackRequest
*/
pipelineRunId: string;
/**
*
* @type {number}
* @memberof FeedbackRequest
*/
score: number;
/**
*
* @type {string}
* @memberof FeedbackRequest
*/
recordedTime: string;
/**
*
* @type {string}
* @memberof FeedbackRequest
*/
details?: string | null;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface FeedbackResponse
*/
export declare interface FeedbackResponse {
/**
*
* @type {string}
* @memberof FeedbackResponse
*/
message: string;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface FeedbackV2
*/
declare interface FeedbackV2 {
/**
* The unique identifier for the feedback
* @type {string}
* @memberof FeedbackV2
*/
id: string;
/**
* The unique identifier for the pipeline run
* @type {string}
* @memberof FeedbackV2
*/
pipelineRunId: string;
/**
* The score of the feedback, ranging from 0 to 1
* @type {number}
* @memberof FeedbackV2
*/
score: number;
/**
* Optional details about the feedback
* @type {string}
* @memberof FeedbackV2
*/
details?: string | null;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof FeedbackV2
*/
recordedTime: number;
}
/**
*
* @export
* @interface FilterableMetadataInputValue
*/
declare interface FilterableMetadataInputValue {
/**
* Specifies if the metadata key exists.
* @type {boolean}
* @memberof FilterableMetadataInputValue
*/
exists?: boolean;
/**
* The metadata value contains this string.
* @type {string}
* @memberof FilterableMetadataInputValue
*/
contains?: string;
/**
*
* @type {FilterableMetadataInputValueEquals}
* @memberof FilterableMetadataInputValue
*/
equals?: FilterableMetadataInputValueEquals;
/**
*
* @type {FilterableMetadataInputValueGt}
* @memberof FilterableMetadataInputValue
*/
gt?: FilterableMetadataInputValueGt;
/**
*
* @type {FilterableMetadataInputValueGte}
* @memberof FilterableMetadataInputValue
*/
gte?: FilterableMetadataInputValueGte;
/**
*
* @type {FilterableMetadataInputValueLt}
* @memberof FilterableMetadataInputValue
*/
lt?: FilterableMetadataInputValueLt;
/**
*
* @type {FilterableMetadataInputValueLte}
* @memberof FilterableMetadataInputValue
*/
lte?: FilterableMetadataInputValueLte;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type FilterableMetadataInputValueEquals
* The metadata value is equal to this value.
* @export
*/
declare type FilterableMetadataInputValueEquals = number | string;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type FilterableMetadataInputValueGt
* The metadata value is greater than this value.
* @export
*/
declare type FilterableMetadataInputValueGt = number | string;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type FilterableMetadataInputValueGte
* The metadata value is greater than or equal to this value.
* @export
*/
declare type FilterableMetadataInputValueGte = number | string;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type FilterableMetadataInputValueLt
* The metadata value is less than this value.
* @export
*/
declare type FilterableMetadataInputValueLt = number | string;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* @type FilterableMetadataInputValueLte
* The metadata value is less than or equal to this value.
* @export
*/
declare type FilterableMetadataInputValueLte = number | string;
export declare function flush(): Promise;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface FolderV2
*/
declare interface FolderV2 {
/**
* The ID of the folder
* @type {string}
* @memberof FolderV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof FolderV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof FolderV2
*/
updatedAt: number;
/**
* The name of the folder
* @type {string}
* @memberof FolderV2
*/
name: string;
/**
* The ID of the organization that owns the folder
* @type {string}
* @memberof FolderV2
*/
organizationId: string;
/**
* The ID of the parent folder
* @type {string}
* @memberof FolderV2
*/
parentFolderId: string | null;
}
/**
*
* @export
* @interface FullRun
*/
declare interface FullRun {
/**
*
* @type {string}
* @memberof FullRun
*/
pipelineRunId: string;
/**
*
* @type {string}
* @memberof FullRun
*/
pipelineId: string;
/**
*
* @type {string}
* @memberof FullRun
*/
organizationId: string;
/**
*
* @type {string}
* @memberof FullRun
*/
startTime: string;
/**
*
* @type {string}
* @memberof FullRun
*/
endTime: string;
/**
*
* @type {number}
* @memberof FullRun
*/
cost?: number | null;
/**
*
* @type {number}
* @memberof FullRun
*/
elapsed?: number | null;
/**
*
* @type {number}
* @memberof FullRun
*/
feedback?: number | null;
/**
*
* @type {string}
* @memberof FullRun
*/
lastInvocation?: string | null;
/**
*
* @type {{ [key: string]: any; }}
* @memberof FullRun
*/
inputs?: {
[key: string]: any;
} | null;
/**
*
* @type {{ [key: string]: any; }}
* @memberof FullRun
*/
outputs?: {
[key: string]: any;
} | null;
/**
*
* @type {string}
* @memberof FullRun
*/
renderHTMLKey?: string | null;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof FullRun
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
*
* @type {Array}
* @memberof FullRun
*/
path?: Array | null;
/**
*
* @type {string}
* @memberof FullRun
*/
error?: string | null;
}
export declare let GENTRACE_API_KEY:
| string
| Promise
| ((name: string) => string)
| ((name: string) => Promise);
export declare let GENTRACE_BASE_PATH: string;
export declare let GENTRACE_BRANCH: string;
export declare let GENTRACE_COMMIT: string;
export declare let GENTRACE_ENVIRONMENT_NAME: string;
export declare let GENTRACE_RESULT_NAME: string;
export declare let GENTRACE_RUN_NAME: string;
export declare let GENTRACE_SHOW_CONNECTION_ERRORS: string;
export declare abstract class GentracePlugin {
abstract config: C;
abstract getConfig(): C;
abstract advanced<
T extends {
[key: string]: GentracePlugin;
},
>(params: {
pipeline: Pipeline;
pipelineRun: PipelineRun;
gentraceConfig: Configuration;
}): A;
}
/**
* Retrieves a single dataset from the Gentrace API.
* @async
* @param {string} id - The ID of the dataset to retrieve.
* @returns {Promise} - A promise that resolves to the retrieved dataset.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getDataset: (id: string) => Promise;
/**
* Retrieves datasets from the Gentrace API.
* @async
* @param {Object} [params] - Optional parameters to filter the datasets.
* @param {string} [params.pipelineSlug] - The slug of the pipeline to filter datasets by.
* @param {string} [params.pipelineId] - The ID of the pipeline to filter datasets by.
* @param {boolean} [params.archived] - Filter datasets by archived status.
* @returns {Promise>} - A promise that resolves to an array of datasets.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getDatasets: (params?: {
pipelineSlug?: string;
pipelineId?: string;
archived?: boolean;
}) => Promise;
/**
* Retrieves evaluations for a specific result from the Gentrace API.
* @async
* @param {Object} params - The parameters for the function.
* @param {string} params.resultId - The ID of the result to get evaluations for.
* @returns {Promise>} - A promise that resolves to an array of evaluations.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getEvaluations: ({
resultId,
}: {
resultId: string;
}) => Promise;
/**
* Retrieves evaluators for a given pipeline from the Gentrace API
* @async
* @param {string} pipelineIdentifier - The pipeline slug, pipeline ID, or null (for evaluator templates)
* @throws {Error} Throws an error if the SDK is not initialized. Call init() first.
* @returns {Promise>} A Promise that resolves with an array of evaluators.
*/
export declare const getEvaluators: (
pipelineIdentifier: string | null,
) => Promise;
export declare function getGentraceApiKey():
| string
| Promise
| ((name: string) => string)
| ((name: string) => Promise);
export declare function getGentraceBasePath(): string;
/**
* Retrieves pipelines from the Gentrace API.
* @async
* @param {PipelineParams} [params] - Optional parameters to filter the pipelines.
* @returns {Promise>} - A promise that resolves to an array of pipelines.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getPipelines: (
params?: PipelineParams,
) => Promise;
export declare const getRun: (id: string) => Promise;
export declare const getTestCase: (id: string) => Promise;
/**
* Retrieves test cases for a given pipeline from the Gentrace API.
* @async
* @param {string} pipelineSlug - The slug of the pipeline to filter test cases by.
* @returns {Promise>} - A promise that resolves to an array of test cases.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized or if the pipeline is not found.
* @remarks The golden dataset for the specified pipeline will be used.
*/
export declare const getTestCases: (
pipelineSlug: string,
) => Promise;
/**
* Retrieves test cases for a specific dataset from the Gentrace API.
* @async
* @param {string} datasetId - The ID of the dataset to retrieve test cases for.
* @returns {Promise>} - A promise that resolves to an array of test cases.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const getTestCasesForDataset: (
datasetId: string,
) => Promise;
export declare const getTestResult: (
resultId: string,
) => Promise;
export declare const getTestResults: (
pipelineSlug?: string,
) => Promise;
export declare const getTestResultStatus: (
resultId: string,
) => Promise;
/**
* Retrieves test runners for a given pipeline
* @async
* @param {Pipeline<{ [key: string]: GentracePlugin }>} pipeline - The pipeline instance
* @param {string} [datasetId] - Optional dataset ID to filter test cases by.
* @throws {Error} Throws an error if the SDK is not initialized. Call init() first.
* @returns {Promise>} A Promise that resolves with an array of PipelineRunDataTuple.
*/
export declare const getTestRunners: (
pipeline: Pipeline<{
[key: string]: GentracePlugin;
}>,
datasetId?: string,
caseFilter?: (
testCase: Omit,
) => boolean,
) => Promise>;
export declare let globalGentraceApi: V1Api | null;
export declare let globalGentraceApiV2: V2Api | null;
export declare let globalGentraceApiV3: V3Api | null;
export declare let globalGentraceConfig: Configuration | null;
export declare let globalRequestBuffer: {
[pipelineRunId: string]: Promise;
};
export declare function handleWebhook(
body: any,
sendResponse: (response: OutboundMessage) => void,
): Promise;
export declare function init(values?: {
apiKey?:
| string
| Promise
| ((name: string) => string)
| ((name: string) => Promise);
basePath?: string;
branch?: string;
commit?: string;
showConnectionErrors?: string;
environmentName?: string;
runName?: string;
resultName?: string;
}): void;
export declare type InitPluginFunction = (
config: C | SimpleHandler,
) => Promise>;
declare type InteractionDefinition<
T extends any = any,
Fn extends InteractionFn = InteractionFn,
> = {
name: string;
fn: Fn;
parameters?:
| undefined
| {
name: string;
}[];
inputType?: undefined | ZodType;
};
declare type InteractionFn = (...args: [T, ...any[]]) => any;
declare type InteractionMetadata = {
name: string;
hasValidation: boolean;
parameters: Parameter[];
};
export declare function isConfig(
f: C | SimpleHandler,
): f is C;
export declare function listen(values?: {
environmentName?: string | undefined;
}): Promise;
/**
*
* @export
* @interface LocalEvaluation
*/
export declare interface LocalEvaluation {
/**
* The name of the local evaluation
* @type {string}
* @memberof LocalEvaluation
*/
name: string;
/**
* The numeric value of the evaluation
* @type {number}
* @memberof LocalEvaluation
*/
value: number;
/**
* Optional label for the evaluation
* @type {string}
* @memberof LocalEvaluation
*/
label?: string | null;
/**
*
* @type {LocalEvaluationDebug}
* @memberof LocalEvaluation
*/
debug?: LocalEvaluationDebug;
}
/**
*
* @export
* @interface LocalEvaluationDebug
*/
export declare interface LocalEvaluationDebug {
/**
* The resolved prompt used for the evaluation
* @type {string}
* @memberof LocalEvaluationDebug
*/
resolvedPrompt?: string;
/**
* The response received from the evaluation
* @type {string}
* @memberof LocalEvaluationDebug
*/
response?: string;
/**
* The final classification of the evaluation
* @type {string}
* @memberof LocalEvaluationDebug
*/
finalClassification?: string;
/**
* Processor logs
* @type {Array>}
* @memberof LocalEvaluationDebug
*/
processorLogs?: Array>;
/**
* Evaluator logs
* @type {Array>}
* @memberof LocalEvaluationDebug
*/
logs?: Array>;
/**
*
* @type {LocalEvaluationDebugError}
* @memberof LocalEvaluationDebug
*/
error?: LocalEvaluationDebugError;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface LocalEvaluationDebugError
*/
export declare interface LocalEvaluationDebugError {
/**
* Error message
* @type {string}
* @memberof LocalEvaluationDebugError
*/
message?: string;
/**
* Date and time of the error
* @type {string}
* @memberof LocalEvaluationDebugError
*/
date?: string;
}
export declare type LocalTestData = {
name: string;
inputs: Record;
expectedOutputs?: Record;
};
declare type Metadata = {
[key: string]: MetadataValueObject;
};
/**
* @type MetadataValueObject
* @export
*/
declare type MetadataValueObject =
| ({
type: "boolean";
} & BooleanType)
| ({
type: "string";
} & StringType)
| ({
type: "url";
} & UrlType);
export declare const numericParameter: ({
name,
defaultValue,
}: {
name: string;
defaultValue: number;
}) => {
name: string;
getValue: () => number;
};
declare type OutboundMessage =
| OutboundMessageHeartbeat
| OutboundMessageEnvironmentDetails
| OutboundMessageRegisterInteraction
| OutboundMessageRegisterTestSuite
| OutboundMessageTestInteractionInputValidationResults
| OutboundMessageConfirmation;
declare type OutboundMessageConfirmation = {
type: "confirmation";
ok: boolean;
};
declare type OutboundMessageEnvironmentDetails = {
type: "environment-details";
interactions: InteractionMetadata[];
testSuites: {
name: string;
}[];
};
declare type OutboundMessageHeartbeat = {
type: "heartbeat";
};
declare type OutboundMessageRegisterInteraction = {
type: "register-interaction";
interaction: InteractionMetadata;
};
declare type OutboundMessageRegisterTestSuite = {
type: "register-test-suite";
testSuite: {
name: string;
};
};
declare type OutboundMessageTestInteractionInputValidationResults = {
type: "run-interaction-input-validation-results";
id: string;
interactionName: string;
data: {
id: string;
status: "success" | "failure";
error?: string;
}[];
};
declare type Parameter =
| {
type: "numeric";
name: string;
defaultValue: number;
}
| {
type: "string";
name: string;
defaultValue: string;
}
| {
type: "enum";
name: string;
defaultValue: string;
options: string[];
}
| {
type: "template";
name: string;
defaultValue: string;
variables: {
name: string;
example: any;
}[];
};
export declare type PartialStepRunType = Partial;
export declare class Pipeline<
T extends {
[key: string]: GentracePlugin;
},
> {
id: string;
slug: string;
config: Configuration;
plugins: T;
constructor({
slug,
id,
apiKey,
basePath,
logger,
plugins,
}: {
slug?: string;
/**
* @deprecated Use the "slug" parameter instead
*/
id?: string;
/**
* @deprecated Declare the API key in the init() call instead.
*/
apiKey?:
| string
| Promise
| ((name: string) => string)
| ((name: string) => Promise);
/**
* @deprecated Declare the base path in the init() call instead.
*/
basePath?: string;
logger?: {
info: (message: string, context?: any) => void;
warn: (message: string | Error, context?: any) => void;
};
plugins?: T;
});
getLogger(): {
info: (message: string, context?: any) => void;
warn: (message: string | Error, context?: any) => void;
};
logInfo(message: string): void;
logWarn(e: Error | string): void;
start(context?: PluginContext): PipelineRun & {
[key in keyof T]: ReturnType;
};
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface Pipeline
*/
declare interface Pipeline_2 {
/**
* The ID of the pipeline
* @type {string}
* @memberof Pipeline
*/
id: string;
/**
* The date and time when the pipeline was created
* @type {string}
* @memberof Pipeline
*/
createdAt: string;
/**
* The date and time when the pipeline was last updated
* @type {string}
* @memberof Pipeline
*/
updatedAt: string;
/**
* The date and time when the pipeline was archived, can be null if the pipeline has not been archived
* @type {string}
* @memberof Pipeline
*/
archivedAt?: string | null;
/**
* The labels attached to the pipeline
* @type {Array}
* @memberof Pipeline
*/
labels: Array;
/**
* The name of the pipeline
* @type {string}
* @memberof Pipeline
*/
displayName?: string | null;
/**
* The slug of the pipeline
* @type {string}
* @memberof Pipeline
*/
slug: string;
/**
* The ID of the organization that owns the pipeline
* @type {string}
* @memberof Pipeline
*/
organizationId: string;
/**
* The branch that the pipeline is associated with
* @type {string}
* @memberof Pipeline
*/
branch?: string | null;
/**
* The ID of the golden dataset associated with the pipeline
* @type {string}
* @memberof Pipeline
*/
goldenDatasetId: string | null;
}
declare interface PipelineLike {
slug: string;
config: Configuration;
logInfo: (message: string) => void;
logWarn: (message: string | Error) => void;
}
declare type PipelineParams = {
label?: string;
slug?: string;
};
export declare class PipelineRun {
private pipeline;
stepRuns: StepRun[];
private evaluations;
private path;
private error?;
context?: Context;
private id;
private instantiationTime;
constructor({
pipeline,
context,
}: {
pipeline: PipelineLike;
context?: Context;
});
getPipeline(): PipelineLike;
getId(): string;
getContext(): Context;
getError(): string;
setError(error: string | undefined): void;
updateContext(updatedContext: Partial): Context;
addStepRunNode(stepRun: StepRun): Promise;
/**
* Creates a checkpoint by recording a `StepRun` instance with execution metadata and pushes it to `this.stepRuns`.
* If no prior `StepRun` instances exist, the elapsed time is set to 0 and the start and end times are set to the
* current timestamp. If it is empty, elapsed time is set to 0 and start time and end time are set to the current
* timestamp.
*
* @param {PRStepRunType & { inputs: any; outputs: any; }} step The information about the step to checkpoint.
* This includes the inputs and outputs of the step, as well as optional provider, invocation and modelParams metadata.
*
* @example
* const stepInfo = {
* providerName: 'MyProvider',
* invocation: 'doSomething',
* inputs: { x: 10, y: 20 },
* outputs: { result: 30 }
* };
* checkpoint(stepInfo);
*
* @returns {void} The function does not return anything.
*
* @throws {Error} If the `StepRun` constructor or any other operations throw an error, it will be propagated.
*/
checkpoint(
step: PRStepRunType & {
inputs: any;
outputs: any;
},
): void;
/**
* Asynchronously measures the execution time of a function.
*
* @template F Function type that extends (...args: any[]) => any
* @param {F} func The function to be measured.
* @param {Parameters} inputs The parameters to be passed to the function.
* @param {Omit} [stepInfo] Optional metadata for the function execution.
* @returns {Promise>} Returns a promise that resolves to the return type of the function.
*
* @example
* async function foo(n: number) {
* return n * 2;
* }
* const result = await measure(foo, [2]); // result will be 4
*
* The function also records a `StepRun` instance with execution metadata and pushes it to `this.stepRuns`.
* The recorded `StepRun` includes information such as the elapsed time, start and end time,
* resolved inputs, and model parameters if provided.
*/
measure any>(
func: F,
inputs: Parameters,
stepInfo?: Omit,
): Promise>;
/**
* Adds an evaluation to the pipeline run.
* @param evaluation The evaluation to add.
*/
addEval(evaluation: LocalEvaluation): void;
toObject(): PipelineRunPayload;
toJson(): string;
static getRedactedRunFromJson(
json: string | object,
options?: {
waitForServer?: boolean;
pipeline?: PipelineLike;
selectFields?:
| StepRunWhitelistDescriptor
| ((steps: StepRun[]) => StepRunWhitelistDescriptor[]);
},
): PipelineRunPayload;
static submitFromJson(
json: string | object,
options?: {
waitForServer?: boolean;
pipeline?: PipelineLike;
selectFields?:
| StepRunWhitelistDescriptor
| ((steps: StepRun[]) => StepRunWhitelistDescriptor[]);
},
): Promise;
submit({
waitForServer,
selectFields,
}?: {
waitForServer?: boolean;
selectFields?:
| StepRunWhitelistDescriptor
| ((steps: StepRun[]) => StepRunWhitelistDescriptor[]);
}): Promise;
/**
* Returns the current evaluations stored in the PipelineRun instance.
* @returns {LocalEvaluation[]} An array of LocalEvaluation objects.
*/
getLocalEvaluations(): LocalEvaluation[];
}
declare type PipelineRunContext = {
userId?: string;
metadata?: Metadata;
previousRunId?: string | null;
};
/**
* A tuple containing a PipelineRun and a test case for submission.
* @public
*/
export declare type PipelineRunDataTuple = [
PipelineRun,
TestCaseForSubmission | TestCase | TestCaseV2,
];
declare type PipelineRunPayload = {
id: string;
slug: string;
metadata: {};
previousRunId: string;
collectionMethod: "runner";
stepRuns: StepRun[];
evaluations: LocalEvaluation[];
error?: string;
};
/** @deprecated Use PipelineRunDataTuple instead */
export declare type PipelineRunTestCaseTuple = PipelineRunDataTuple;
/**
*
* @export
* @interface V1PipelinesGet200Response
*/
export declare interface PipelinesGet200Response {
/**
*
* @type {Array}
* @memberof V1PipelinesGet200Response
*/
pipelines: Array;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface PipelineV2
*/
declare interface PipelineV2 {
/**
* The ID of the pipeline
* @type {string}
* @memberof PipelineV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof PipelineV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof PipelineV2
*/
updatedAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof PipelineV2
*/
archivedAt: number | null;
/**
* The labels attached to the pipeline
* @type {Array}
* @memberof PipelineV2
*/
labels: Array;
/**
* The name of the pipeline
* @type {string}
* @memberof PipelineV2
*/
displayName?: string | null;
/**
* The slug of the pipeline
* @type {string}
* @memberof PipelineV2
*/
slug: string;
/**
* The ID of the organization that owns the pipeline
* @type {string}
* @memberof PipelineV2
*/
organizationId: string;
/**
* The branch that the pipeline is associated with
* @type {string}
* @memberof PipelineV2
*/
branch: string | null;
/**
* If null, this is a team pipeline. If not null, this is a private pipeline for the specified member ID.
* @type {string}
* @memberof PipelineV2
*/
privateMemberId: string | null;
/**
* If null, this is a team pipeline. If not null, this is a private pipeline for the specified email.
* @type {string}
* @memberof PipelineV2
*/
privateUserEmail: string | null;
/**
* The ID of the golden dataset associated with the pipeline
* @type {string}
* @memberof PipelineV2
*/
goldenDatasetId: string | null;
}
export declare type PluginContext = PipelineRunContext;
export declare type PluginStepRunContext = {
metadata?: Metadata;
};
declare type PRStepRunType = Omit & {
context?: CoreStepRunContext;
};
/**
*
* @export
* @interface RequestArgs
*/
declare interface RequestArgs {
url: string;
options: AxiosRequestConfig;
}
export declare let resetGlobalGentraceApi: () => void;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface ResolvedStepRun
*/
declare interface ResolvedStepRun {
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
id?: string;
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
organizationId?: string;
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
providerName?: string;
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
invocation?: string;
/**
*
* @type {{ [key: string]: any; }}
* @memberof ResolvedStepRun
*/
modelParams?: {
[key: string]: any;
};
/**
*
* @type {{ [key: string]: any; }}
* @memberof ResolvedStepRun
*/
inputs?: {
[key: string]: any;
};
/**
*
* @type {{ [key: string]: any; }}
* @memberof ResolvedStepRun
*/
outputs?: {
[key: string]: any;
};
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
startTime?: string;
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
endTime?: string;
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
pipelineRunId?: string;
/**
*
* @type {string}
* @memberof ResolvedStepRun
*/
error?: string | null;
}
export declare type ResultContext = {
name?: string;
metadata?: Metadata;
};
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface RunPathSection
*/
declare interface RunPathSection {
/**
*
* @type {string}
* @memberof RunPathSection
*/
type: RunPathSectionTypeEnum;
/**
*
* @type {string}
* @memberof RunPathSection
*/
name: string;
}
declare const RunPathSectionTypeEnum: {
readonly Suite: "suite";
};
declare type RunPathSectionTypeEnum =
(typeof RunPathSectionTypeEnum)[keyof typeof RunPathSectionTypeEnum];
/**
*
* @export
* @interface RunRequest
*/
export declare interface RunRequest {
/**
*
* @type {string}
* @memberof RunRequest
*/
id: string;
/**
* The method used to collect the run
* @type {string}
* @memberof RunRequest
*/
collectionMethod?: RunRequestCollectionMethodEnum;
/**
*
* @type {string}
* @memberof RunRequest
*/
slug?: string;
/**
*
* @type {string}
* @memberof RunRequest
*/
previousRunId?: string | null;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof RunRequest
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
*
* @type {Array}
* @memberof RunRequest
*/
stepRuns: Array;
/**
*
* @type {string}
* @memberof RunRequest
*/
error?: string | null;
}
declare const RunRequestCollectionMethodEnum: {
readonly Manual: "manual";
readonly Runner: "runner";
};
declare type RunRequestCollectionMethodEnum =
(typeof RunRequestCollectionMethodEnum)[keyof typeof RunRequestCollectionMethodEnum];
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface RunResponse
*/
export declare interface RunResponse {
/**
*
* @type {string}
* @memberof RunResponse
*/
pipelineRunId?: string;
}
export declare function runTest(
pipelineSlug: string,
handler: (
testCase: Omit,
) => Promise<[any, PipelineRun]>,
contextOrCaseFilter?:
| ResultContext
| ((
testCase: Omit,
) => boolean),
caseFilterOrUndefined?: (
testCase: Omit,
) => boolean,
): Promise;
/**
* Runs a test for a given pipeline slug and dataset ID.
* @param {string} pipelineSlug: The slug of the pipeline
* @param {string} datasetId: The ID of the dataset
* @param {function} handler: The handler function that will be called for each test case
* @param {ResultContext} [context]: An optional context object that will be passed to the Gentrace API
* @param {function} [caseFilter]: An optional filter function that will be called for each test case
*/
export declare function runTestWithDataset(
pipelineSlug: string,
datasetId: string,
handler: (
testCase: Omit,
) => Promise<[any, PipelineRun]>,
context?: ResultContext,
caseFilter?: (
testCase: Omit,
) => boolean,
): Promise;
/**
* Runs a test for a given pipeline slug and dataset ID.
* @param {string} pipelineSlug: The slug of the pipeline
* @param {string} datasetId: The ID of the dataset
* @param {function} handler: The handler function that will be called for each test case
* @param {function} [caseFilter]: An optional filter function that will be called for each test case
*/
export declare function runTestWithDataset(
pipelineSlug: string,
datasetId: string,
handler: (
testCase: Omit,
) => Promise<[any, PipelineRun]>,
caseFilter?: (
testCase: Omit,
) => boolean,
): Promise;
/**
*
* @export
* @interface RunV2
*/
declare interface RunV2 {
/**
* The ID of the run
* @type {string}
* @memberof RunV2
*/
id: string;
/**
*
* @type {Array}
* @memberof RunV2
*/
stepRuns: Array;
}
/**
*
* @export
* @interface RunV2StepRunsInner
*/
declare interface RunV2StepRunsInner {
/**
* The ID of the step run
* @type {string}
* @memberof RunV2StepRunsInner
*/
stepRunId: string;
/**
* The ID of the step
* @type {string}
* @memberof RunV2StepRunsInner
*/
stepId: string;
/**
* The name of the provider
* @type {string}
* @memberof RunV2StepRunsInner
*/
providerName: string;
/**
* The name of the method being invoked
* @type {string}
* @memberof RunV2StepRunsInner
*/
invocation: string;
/**
* The order of the step run. The last step has the highest \"order\" number.
* @type {number}
* @memberof RunV2StepRunsInner
*/
order: number;
/**
* The parameters used by the model
* @type {object}
* @memberof RunV2StepRunsInner
*/
modelParams: object;
/**
* The inputs of the run
* @type {object}
* @memberof RunV2StepRunsInner
*/
inputs: object;
/**
* The outputs of the run
* @type {object}
* @memberof RunV2StepRunsInner
*/
outputs: object;
/**
* The milliseconds to complete the run
* @type {number}
* @memberof RunV2StepRunsInner
*/
elapsedTime: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof RunV2StepRunsInner
*/
startTime: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof RunV2StepRunsInner
*/
endTime: number;
/**
* The cost of the run in USD
* @type {number}
* @memberof RunV2StepRunsInner
*/
cost: number;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof RunV2StepRunsInner
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
*
* @type {string}
* @memberof RunV2StepRunsInner
*/
error?: string | null;
}
/**
* @type SearchableStringInput
* @export
*/
declare type SearchableStringInput = SearchableStringInputOneOf | string;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SearchableStringInputOneOf
*/
declare interface SearchableStringInputOneOf {
/**
*
* @type {string}
* @memberof SearchableStringInputOneOf
*/
contains?: string;
/**
* For Postgres full text search
* @type {string}
* @memberof SearchableStringInputOneOf
*/
search?: string;
/**
*
* @type {string}
* @memberof SearchableStringInputOneOf
*/
startsWith?: string;
/**
*
* @type {string}
* @memberof SearchableStringInputOneOf
*/
endsWith?: string;
/**
*
* @type {Array}
* @memberof SearchableStringInputOneOf
*/
in?: Array;
/**
*
* @type {Array}
* @memberof SearchableStringInputOneOf
*/
notIn?: Array;
/**
*
* @type {string}
* @memberof SearchableStringInputOneOf
*/
mode?: SearchableStringInputOneOfModeEnum;
}
declare const SearchableStringInputOneOfModeEnum: {
readonly Insensitive: "insensitive";
readonly Default: "default";
};
declare type SearchableStringInputOneOfModeEnum =
(typeof SearchableStringInputOneOfModeEnum)[keyof typeof SearchableStringInputOneOfModeEnum];
/**
* @type SearchableUnixSecondsInput
* @export
*/
declare type SearchableUnixSecondsInput =
| SearchableUnixSecondsInputOneOf
| number;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface SearchableUnixSecondsInputOneOf
*/
declare interface SearchableUnixSecondsInputOneOf {
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof SearchableUnixSecondsInputOneOf
*/
gt?: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof SearchableUnixSecondsInputOneOf
*/
gte?: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof SearchableUnixSecondsInputOneOf
*/
lt?: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof SearchableUnixSecondsInputOneOf
*/
lte?: number;
}
declare type SelectStepRun = Pick<
StepRun,
"inputs" | "outputs" | "modelParams" | "context"
>;
export declare interface SimpleHandler {
getConfig(): C;
setPipelineRun(pipelineRun: PipelineRun): void;
}
declare type StatusInfo = TestResultStatusGet200Response;
export declare class StepRun {
providerName: string;
invocation: string;
elapsedTime: number;
startTime: string;
endTime: string;
inputs: any;
modelParams: any;
outputs: any;
context: Context;
error: string | undefined;
constructor(
providerName: string,
invocation: string,
elapsedTime: number,
startTime: string,
endTime: string,
inputs: any,
modelParams: any,
outputs: any,
context: Context,
error: string | undefined,
);
}
/**
*
* @export
* @interface StepRun
*/
declare interface StepRun_2 {
/**
*
* @type {string}
* @memberof StepRun
*/
providerName: string;
/**
*
* @type {string}
* @memberof StepRun
*/
invocation: string;
/**
*
* @type {{ [key: string]: any; }}
* @memberof StepRun
*/
modelParams: {
[key: string]: any;
};
/**
*
* @type {{ [key: string]: any; }}
* @memberof StepRun
*/
inputs: {
[key: string]: any;
};
/**
*
* @type {{ [key: string]: any; }}
* @memberof StepRun
*/
outputs: {
[key: string]: any;
};
/**
*
* @type {StepRunContext}
* @memberof StepRun
*/
context?: StepRunContext;
/**
*
* @type {number}
* @memberof StepRun
*/
elapsedTime: number;
/**
*
* @type {string}
* @memberof StepRun
*/
startTime: string;
/**
*
* @type {string}
* @memberof StepRun
*/
endTime: string;
/**
*
* @type {string}
* @memberof StepRun
*/
error?: string | null;
}
/**
*
* @export
* @interface StepRunContext
*/
declare interface StepRunContext {
/**
*
* @type {string}
* @memberof StepRunContext
*/
userId?: string;
/**
*
* @type {StepRunContextRender}
* @memberof StepRunContext
*/
render?: StepRunContextRender;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof StepRunContext
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface StepRunContextRender
*/
declare interface StepRunContextRender {
/**
*
* @type {string}
* @memberof StepRunContextRender
*/
type: string;
/**
*
* @type {string}
* @memberof StepRunContextRender
*/
key?: string;
}
export declare type StepRunType = typeof StepRun;
declare type StepRunWhitelistDescriptor = Partial<{
[k in keyof SelectStepRun]:
| boolean
| string[]
| (string[] | string)[]
| string;
}>;
export declare const stringParameter: ({
name,
defaultValue,
}: {
name: string;
defaultValue: string;
}) => {
name: string;
getValue: () => string;
};
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface StringType
*/
declare interface StringType {
/**
*
* @type {string}
* @memberof StringType
*/
type: StringTypeTypeEnum;
/**
*
* @type {string}
* @memberof StringType
*/
value: string;
}
declare const StringTypeTypeEnum: {
readonly String: "string";
};
declare type StringTypeTypeEnum =
(typeof StringTypeTypeEnum)[keyof typeof StringTypeTypeEnum];
export declare function submitTestResult(
pipelineSlug: string,
testCases: (TestCase | TestCaseV2)[],
outputsList: Record[],
context?: ResultContext,
): Promise;
/**
* Submits test runners for a given pipeline
* @async
* @param {Pipeline<{ [key: string]: GentracePlugin }>} pipeline - The pipeline instance
* @param {Array} pipelineRunTestCases - an array of PipelineRunTestCaseTuple
* @param {SubmitTestRunnersOptions} [options] - Optional configuration for submitting test runners
* @returns {Promise} A Promise that resolves with the response from the Gentrace API
*/
export declare function submitTestRunners(
pipeline: Pipeline<{
[key: string]: GentracePlugin;
}>,
pipelineRunTestCases: Array,
options?: SubmitTestRunnersOptions,
): Promise;
declare interface SubmitTestRunnersOptions {
context?: ResultContext;
caseFilter?: (
testCase: Omit<
TestCase | TestCaseV2,
"createdAt" | "updatedAt" | "archivedAt"
>,
) => boolean;
triggerRemoteEvals?: boolean;
}
export declare const templateParameter: >({
name,
defaultValue,
variables,
}: {
name: string;
defaultValue: string;
variables?: {
name: keyof T;
example: T[keyof T];
}[];
}) => {
name: string;
render: (values: T) => string;
};
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface TestCase
*/
export declare interface TestCase {
/**
* The ID of the test case
* @type {string}
* @memberof TestCase
*/
id: string;
/**
* The date and time when the test case was created
* @type {string}
* @memberof TestCase
*/
createdAt: string;
/**
* The date and time when the test case was archived, can be null if the test case has not been archived
* @type {string}
* @memberof TestCase
* @deprecated
*/
archivedAt: string | null;
/**
* The date and time when the test case was deleted, can be null if the test case has not been deleted
* @type {string}
* @memberof TestCase
*/
deletedAt: string | null;
/**
* The date and time when the test case was last updated
* @type {string}
* @memberof TestCase
*/
updatedAt: string;
/**
* The expected outputs for the test case
* @type {object}
* @memberof TestCase
*/
expectedOutputs?: object | null;
/**
* The input data for the test case as a JSON object
* @type {{ [key: string]: any; }}
* @memberof TestCase
*/
inputs: {
[key: string]: any;
};
/**
* The name of the test case
* @type {string}
* @memberof TestCase
*/
name: string;
/**
* The ID of the pipeline that the test case belongs to
* @type {string}
* @memberof TestCase
*/
pipelineId: string;
/**
* The ID of the dataset that the test case belongs to
* @type {string}
* @memberof TestCase
*/
datasetId: string;
}
/**
* A test case for submission.
* @public
*/
export declare type TestCaseForSubmission = {
id?: string;
name?: string;
inputs?: Record;
};
/**
*
* @export
* @interface V1TestCaseGet200Response
*/
export declare interface TestCaseGet200Response {
/**
*
* @type {Array}
* @memberof V1TestCaseGet200Response
*/
testCases?: Array;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface TestCaseV2
*/
declare interface TestCaseV2 {
/**
* The ID of the test case
* @type {string}
* @memberof TestCaseV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestCaseV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestCaseV2
*/
updatedAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestCaseV2
*/
archivedAt: number | null;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestCaseV2
*/
deletedAt: number | null;
/**
* The expected outputs for the test case
* @type {object}
* @memberof TestCaseV2
*/
expectedOutputs?: object | null;
/**
* The input data for the test case as a JSON object
* @type {{ [key: string]: any; }}
* @memberof TestCaseV2
*/
inputs: {
[key: string]: any;
};
/**
* The name of the test case
* @type {string}
* @memberof TestCaseV2
*/
name: string;
/**
* The ID of the pipeline that the test case belongs to
* @type {string}
* @memberof TestCaseV2
*/
pipelineId: string;
/**
* The ID of the dataset that the test case belongs to
* @type {string}
* @memberof TestCaseV2
*/
datasetId: string;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface TestEvaluation
*/
declare interface TestEvaluation {
/**
*
* @type {string}
* @memberof TestEvaluation
*/
id: string;
/**
*
* @type {string}
* @memberof TestEvaluation
*/
createdAt: string;
/**
*
* @type {string}
* @memberof TestEvaluation
*/
updatedAt: string;
/**
*
* @type {boolean}
* @memberof TestEvaluation
*/
isPending: boolean;
/**
*
* @type {object}
* @memberof TestEvaluation
*/
debug?: object | null;
/**
*
* @type {string}
* @memberof TestEvaluation
*/
evaluatorId: string;
/**
*
* @type {string}
* @memberof TestEvaluation
*/
runId: string;
/**
*
* @type {string}
* @memberof TestEvaluation
*/
evalLabel?: string | null;
/**
*
* @type {number}
* @memberof TestEvaluation
*/
evalValue?: number | null;
/**
*
* @type {string}
* @memberof TestEvaluation
*/
manualCreatedByEmail?: string | null;
/**
*
* @type {number}
* @memberof TestEvaluation
*/
billingGpt4InputTokens: number;
/**
*
* @type {number}
* @memberof TestEvaluation
*/
billingGpt4OutputTokens: number;
/**
*
* @type {number}
* @memberof TestEvaluation
*/
billingGpt35InputTokens: number;
/**
*
* @type {number}
* @memberof TestEvaluation
*/
billingGpt35OutputTokens: number;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface TestEvaluator
*/
declare interface TestEvaluator {
/**
*
* @type {string}
* @memberof TestEvaluator
*/
id: string;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
createdAt: string;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
updatedAt: string;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
archivedAt?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
icon?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
name: string;
/**
*
* @type {Array}
* @memberof TestEvaluator
*/
options: Array | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
aiModel?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
pipelineId: string;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
processorId?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
heuristicFn?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
aiPromptFormat?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
humanPrompt?: string | null;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
who: string;
/**
*
* @type {string}
* @memberof TestEvaluator
*/
valueType: string;
}
/**
*
* @export
* @interface TestResult
*/
export declare interface TestResult {
/**
* The unique identifier for the test result.
* @type {string}
* @memberof TestResult
*/
id: string;
/**
* The date and time the test result was created.
* @type {string}
* @memberof TestResult
*/
createdAt: string;
/**
* The date and time the test result was last updated.
* @type {string}
* @memberof TestResult
*/
updatedAt: string;
/**
* The unique identifier for the pipeline associated with the test result.
* @type {string}
* @memberof TestResult
*/
pipelineId: string;
/**
* The branch that the test result was created from
* @type {string}
* @memberof TestResult
*/
branch?: string | null;
/**
* The commit that the test result was created from
* @type {string}
* @memberof TestResult
*/
commit?: string | null;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof TestResult
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
* The name of the test result
* @type {string}
* @memberof TestResult
*/
name?: string | null;
}
/**
*
* @export
* @interface V1TestResultGet200Response
*/
export declare interface TestResultGet200Response {
/**
*
* @type {Array}
* @memberof V1TestResultGet200Response
*/
testResults?: Array;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface V1TestResultPost200Response
*/
export declare interface TestResultPost200Response {
/**
*
* @type {string}
* @memberof V1TestResultPost200Response
*/
resultId: string;
}
/**
*
* @export
* @interface V1TestResultPostRequest
*/
export declare interface TestResultPostRequest {
/**
* The pipeline slug to create the test result for. Only one of pipelineSlug or pipelineId is required.
* @type {string}
* @memberof V1TestResultPostRequest
*/
pipelineSlug?: string;
/**
* The pipeline ID to create the test result for. Only one of pipelineSlug or pipelineId is required.
* @type {string}
* @memberof V1TestResultPostRequest
*/
pipelineId?: string;
/**
* The method used to collect the test runs
* @type {string}
* @memberof V1TestResultPostRequest
*/
collectionMethod?: V1TestResultPostRequestCollectionMethodEnum;
/**
* The branch that the test result was created from
* @type {string}
* @memberof V1TestResultPostRequest
*/
branch?: string | null;
/**
* The commit that the test result was created from
* @type {string}
* @memberof V1TestResultPostRequest
*/
commit?: string | null;
/**
* The name of the test result
* @type {string}
* @memberof V1TestResultPostRequest
*/
name?: string | null;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof V1TestResultPostRequest
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
* Optional flag to trigger remote evaluations
* @type {boolean}
* @memberof V1TestResultPostRequest
*/
triggerRemoteEvals?: boolean;
/**
*
* @type {Array}
* @memberof V1TestResultPostRequest
*/
testRuns: Array;
}
/**
*
* @export
* @interface V1TestResultPostRequestTestRunsInner
*/
export declare interface TestResultPostRequestTestRunsInner {
/**
* The ID of the test run
* @type {string}
* @memberof V1TestResultPostRequestTestRunsInner
*/
id?: string | null;
/**
* The ID of the test case. Mutually exclusive with \'name\' and \'inputs\'.
* @type {string}
* @memberof V1TestResultPostRequestTestRunsInner
*/
caseId?: string;
/**
* Used for supplying local data. The name of the test run. Used with \'inputs\' and mutually exclusive with \'caseId\'.
* @type {string}
* @memberof V1TestResultPostRequestTestRunsInner
*/
name?: string;
/**
* Used for supplying local data. The input data for the test run. Used with \'name\' and mutually exclusive with \'caseId\'.
* @type {{ [key: string]: any; }}
* @memberof V1TestResultPostRequestTestRunsInner
*/
inputs?: {
[key: string]: any;
};
/**
* Used for supplying local data. The expected outputs for the test run. Used with \'name\' and mutually exclusive with \'caseId\'. Optional, since not all evaluators require expected outputs.
* @type {{ [key: string]: any; }}
* @memberof V1TestResultPostRequestTestRunsInner
*/
expectedOutputs?: {
[key: string]: any;
};
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof V1TestResultPostRequestTestRunsInner
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
* Use outputs.steps insteads.
* @type {Array}
* @memberof V1TestResultPostRequestTestRunsInner
*/
stepRuns: Array;
/**
* Optional array of local evaluations
* @type {Array}
* @memberof V1TestResultPostRequestTestRunsInner
*/
evaluations?: Array;
/**
* Optional path which describes the organizational hierarchy of this test run in relation to all the pipeline tests.
* @type {Array}
* @memberof V1TestResultPostRequestTestRunsInner
*/
path?: Array | null;
/**
*
* @type {string}
* @memberof V1TestResultPostRequestTestRunsInner
*/
error?: string | null;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface V1TestResultStatusGet200Response
*/
export declare interface TestResultStatusGet200Response {
/**
*
* @type {number}
* @memberof V1TestResultStatusGet200Response
*/
total: number;
/**
*
* @type {number}
* @memberof V1TestResultStatusGet200Response
*/
pending: number;
/**
*
* @type {number}
* @memberof V1TestResultStatusGet200Response
*/
failure: number;
/**
*
* @type {number}
* @memberof V1TestResultStatusGet200Response
*/
done: number;
}
/**
*
* @export
* @interface TestResultV2
*/
declare interface TestResultV2 {
/**
* The unique identifier for the test result.
* @type {string}
* @memberof TestResultV2
*/
id: string;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestResultV2
*/
createdAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestResultV2
*/
updatedAt: number;
/**
* Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object.
* @type {number}
* @memberof TestResultV2
*/
archivedAt: number | null;
/**
* The unique identifier for the pipeline associated with the test result.
* @type {string}
* @memberof TestResultV2
*/
pipelineId: string;
/**
* The branch that the test result was created from
* @type {string}
* @memberof TestResultV2
*/
branch?: string | null;
/**
* The commit that the test result was created from
* @type {string}
* @memberof TestResultV2
*/
commit?: string | null;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof TestResultV2
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
* The name of the test result
* @type {string}
* @memberof TestResultV2
*/
name?: string | null;
}
export declare type TestRun = TestResultPostRequestTestRunsInner;
/**
*
* @export
* @interface TestRun
*/
declare interface TestRun_2 {
/**
*
* @type {string}
* @memberof TestRun
*/
id: string;
/**
*
* @type {string}
* @memberof TestRun
*/
createdAt: string;
/**
*
* @type {string}
* @memberof TestRun
*/
updatedAt: string;
/**
*
* @type {string}
* @memberof TestRun
*/
caseId: string;
/**
*
* @type {string}
* @memberof TestRun
*/
resultId: string;
/**
*
* @type {Array}
* @memberof TestRun
*/
path?: Array | null;
}
/**
* Updates a dataset in the Gentrace API.
* @async
* @param {string} id - The ID of the dataset to update.
* @param {UpdateDatasetV2} payload - The dataset update payload.
* @returns {Promise} - A promise that resolves to the updated dataset.
* @throws {Error} - Throws an error if the Gentrace API key is not initialized.
*/
export declare const updateDataset: (
id: string,
payload: UpdateDatasetV2,
) => Promise;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface UpdateDatasetV2
*/
declare interface UpdateDatasetV2 {
/**
*
* @type {string}
* @memberof UpdateDatasetV2
*/
name?: string;
/**
*
* @type {string}
* @memberof UpdateDatasetV2
*/
description?: string | null;
/**
*
* @type {boolean}
* @memberof UpdateDatasetV2
*/
isGolden?: boolean;
/**
*
* @type {boolean}
* @memberof UpdateDatasetV2
*/
isArchived?: boolean;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface UpdateFeedbackV2
*/
declare interface UpdateFeedbackV2 {
/**
* The score of the feedback, ranging from 0 to 1
* @type {number}
* @memberof UpdateFeedbackV2
*/
score?: number;
/**
* Optional details about the feedback
* @type {string}
* @memberof UpdateFeedbackV2
*/
details?: string | null;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface UpdateTestCase
*/
declare interface UpdateTestCase {
/**
* ID of the test case to update
* @type {string}
* @memberof UpdateTestCase
*/
id: string;
/**
* Name of the test case
* @type {string}
* @memberof UpdateTestCase
*/
name?: string | null;
/**
* Inputs for the test case
* @type {object}
* @memberof UpdateTestCase
*/
inputs?: object | null;
/**
* Expected outputs for the test case
* @type {object}
* @memberof UpdateTestCase
*/
expectedOutputs?: object | null;
/**
* Archive status for the test case
* @type {boolean}
* @memberof UpdateTestCase
*/
archived?: boolean | null;
}
/**
* Updates a single test case in the Gentrace API
*
* @async
* @param {UpdateTestCase} payload - The payload containing the test case update information
* @throws {Error} Throws an error if the SDK is not initialized or if the test case ID is invalid
* @returns {Promise} A Promise that resolves to the updated case ID
* @remarks This function updates an existing test case with the provided information.
* The payload should include the test case ID and any fields to be updated.
*/
export declare const updateTestCase: (
payload: UpdateTestCase,
) => Promise;
export declare function updateTestResult(
resultId: string,
testCases: (TestCase | TestCaseV2)[],
outputsList: Record[],
): Promise;
/**
* Updates a test result with the provided runners.
*
* @async
* @param {string} resultId - The ID of the test result to update.
* @param {Array} runners - Additional test runs to add to the existing test result.
* @returns {Promise} A Promise that resolves with the response data from the Gentrace API.
* @throws {Error} Throws an error if the update operation fails.
*/
export declare function updateTestResultWithRunners(
resultId: string,
runners: PipelineRunDataTuple[],
): Promise;
export declare function uploadBuffer(
fileName: string,
buffer: Buffer,
options?: undefined | FilePropertyBag,
): Promise;
export declare function uploadFile(file: File): Promise;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface UrlType
*/
declare interface UrlType {
/**
*
* @type {string}
* @memberof UrlType
*/
type: UrlTypeTypeEnum;
/**
*
* @type {string}
* @memberof UrlType
*/
url: string;
/**
*
* @type {string}
* @memberof UrlType
*/
text: string;
}
declare const UrlTypeTypeEnum: {
readonly Url: "url";
};
declare type UrlTypeTypeEnum =
(typeof UrlTypeTypeEnum)[keyof typeof UrlTypeTypeEnum];
/**
* V1Api - object-oriented interface
* @export
* @class V1Api
* @extends {BaseAPI}
*/
export declare class V1Api extends BaseAPI {
/**
*
* @summary Submit feedback
* @param {FeedbackRequest} feedbackRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1FeedbackPost(
feedbackRequest: FeedbackRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Upload an image file
* @param {string} [org] (If not using an organization API Key) the ID of the organization
* @param {File} [file] The file to upload.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1FilesUploadPost(
org?: string,
file?: File,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Get pipelines, optionally filtered by label
* @param {string} [label] The label to filter pipelines by
* @param {string} [slug] The slug to filter pipelines by
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1PipelinesGet(
label?: string,
slug?: string,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Create a run
* @param {RunRequest} runRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1RunPost(
runRequest: RunRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
* At least one of datasetId, pipelineId, or pipelineSlug must be provided
* @summary Get test cases for a pipeline or dataset
* @param {string} [datasetId] The ID of the Dataset to retrieve test cases for
* @param {string} [pipelineId] The ID of the Pipeline to retrieve test cases for
* @param {string} [pipelineSlug] The slug of the Pipeline to retrieve test cases for
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestCaseGet(
datasetId?: string,
pipelineId?: string,
pipelineSlug?: string,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Update an existing test case
* @param {UpdateTestCase} updateTestCase
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestCasePatch(
updateTestCase: UpdateTestCase,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Create a new test case
* @param {V1TestCasePostRequest} v1TestCasePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestCasePost(
v1TestCasePostRequest: V1TestCasePostRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Get test results for a pipeline
* @param {string} pipelineSlug The slug of the pipeline
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultGet(
pipelineSlug: string,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Fetch test result by ID
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultIdGet(
id: string,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Add more test runs to a result
* @param {string} id The ID of the test result
* @param {V1TestResultIdPostRequest} v1TestResultIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultIdPost(
id: string,
v1TestResultIdPostRequest: V1TestResultIdPostRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Create a new test result from runs
* @param {V1TestResultPostRequest} v1TestResultPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultPost(
v1TestResultPostRequest: TestResultPostRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Add more test runs to a result (simple version)
* @param {string} id The ID of the test result
* @param {V1TestResultSimpleIdPostRequest} v1TestResultSimpleIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultSimpleIdPost(
id: string,
v1TestResultSimpleIdPostRequest: V1TestResultSimpleIdPostRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Create a new test result from test runs
* @param {V1TestResultSimplePostRequest} v1TestResultSimplePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultSimplePost(
v1TestResultSimplePostRequest: V1TestResultSimplePostRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Get status of the test result
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1Api
*/
v1TestResultStatusGet(
id: string,
options?: AxiosRequestConfig,
): Promise>;
}
/**
* V1Api - axios parameter creator
* @export
*/
export declare const V1ApiAxiosParamCreator: (
configuration?: Configuration,
) => {
/**
*
* @summary Submit feedback
* @param {FeedbackRequest} feedbackRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1FeedbackPost: (
feedbackRequest: FeedbackRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Upload an image file
* @param {string} [org] (If not using an organization API Key) the ID of the organization
* @param {File} [file] The file to upload.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1FilesUploadPost: (
org?: string,
file?: File,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Get pipelines, optionally filtered by label
* @param {string} [label] The label to filter pipelines by
* @param {string} [slug] The slug to filter pipelines by
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1PipelinesGet: (
label?: string,
slug?: string,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Create a run
* @param {RunRequest} runRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1RunPost: (
runRequest: RunRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
* At least one of datasetId, pipelineId, or pipelineSlug must be provided
* @summary Get test cases for a pipeline or dataset
* @param {string} [datasetId] The ID of the Dataset to retrieve test cases for
* @param {string} [pipelineId] The ID of the Pipeline to retrieve test cases for
* @param {string} [pipelineSlug] The slug of the Pipeline to retrieve test cases for
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCaseGet: (
datasetId?: string,
pipelineId?: string,
pipelineSlug?: string,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Update an existing test case
* @param {UpdateTestCase} updateTestCase
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCasePatch: (
updateTestCase: UpdateTestCase,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Create a new test case
* @param {V1TestCasePostRequest} v1TestCasePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCasePost: (
v1TestCasePostRequest: V1TestCasePostRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Get test results for a pipeline
* @param {string} pipelineSlug The slug of the pipeline
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultGet: (
pipelineSlug: string,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Fetch test result by ID
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultIdGet: (
id: string,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Add more test runs to a result
* @param {string} id The ID of the test result
* @param {V1TestResultIdPostRequest} v1TestResultIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultIdPost: (
id: string,
v1TestResultIdPostRequest: V1TestResultIdPostRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Create a new test result from runs
* @param {V1TestResultPostRequest} v1TestResultPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultPost: (
v1TestResultPostRequest: TestResultPostRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Add more test runs to a result (simple version)
* @param {string} id The ID of the test result
* @param {V1TestResultSimpleIdPostRequest} v1TestResultSimpleIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultSimpleIdPost: (
id: string,
v1TestResultSimpleIdPostRequest: V1TestResultSimpleIdPostRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Create a new test result from test runs
* @param {V1TestResultSimplePostRequest} v1TestResultSimplePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultSimplePost: (
v1TestResultSimplePostRequest: V1TestResultSimplePostRequest,
options?: AxiosRequestConfig,
) => Promise;
/**
*
* @summary Get status of the test result
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultStatusGet: (
id: string,
options?: AxiosRequestConfig,
) => Promise;
};
/**
* V1Api - factory interface
* @export
*/
export declare const V1ApiFactory: (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) => {
/**
*
* @summary Submit feedback
* @param {FeedbackRequest} feedbackRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1FeedbackPost(
feedbackRequest: FeedbackRequest,
options?: any,
): AxiosPromise;
/**
*
* @summary Upload an image file
* @param {string} [org] (If not using an organization API Key) the ID of the organization
* @param {File} [file] The file to upload.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1FilesUploadPost(
org?: string,
file?: File,
options?: any,
): AxiosPromise;
/**
*
* @summary Get pipelines, optionally filtered by label
* @param {string} [label] The label to filter pipelines by
* @param {string} [slug] The slug to filter pipelines by
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1PipelinesGet(
label?: string,
slug?: string,
options?: any,
): AxiosPromise;
/**
*
* @summary Create a run
* @param {RunRequest} runRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1RunPost(runRequest: RunRequest, options?: any): AxiosPromise;
/**
* At least one of datasetId, pipelineId, or pipelineSlug must be provided
* @summary Get test cases for a pipeline or dataset
* @param {string} [datasetId] The ID of the Dataset to retrieve test cases for
* @param {string} [pipelineId] The ID of the Pipeline to retrieve test cases for
* @param {string} [pipelineSlug] The slug of the Pipeline to retrieve test cases for
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCaseGet(
datasetId?: string,
pipelineId?: string,
pipelineSlug?: string,
options?: any,
): AxiosPromise;
/**
*
* @summary Update an existing test case
* @param {UpdateTestCase} updateTestCase
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCasePatch(
updateTestCase: UpdateTestCase,
options?: any,
): AxiosPromise;
/**
*
* @summary Create a new test case
* @param {V1TestCasePostRequest} v1TestCasePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCasePost(
v1TestCasePostRequest: V1TestCasePostRequest,
options?: any,
): AxiosPromise;
/**
*
* @summary Get test results for a pipeline
* @param {string} pipelineSlug The slug of the pipeline
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultGet(
pipelineSlug: string,
options?: any,
): AxiosPromise;
/**
*
* @summary Fetch test result by ID
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultIdGet(
id: string,
options?: any,
): AxiosPromise;
/**
*
* @summary Add more test runs to a result
* @param {string} id The ID of the test result
* @param {V1TestResultIdPostRequest} v1TestResultIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultIdPost(
id: string,
v1TestResultIdPostRequest: V1TestResultIdPostRequest,
options?: any,
): AxiosPromise;
/**
*
* @summary Create a new test result from runs
* @param {V1TestResultPostRequest} v1TestResultPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultPost(
v1TestResultPostRequest: TestResultPostRequest,
options?: any,
): AxiosPromise;
/**
*
* @summary Add more test runs to a result (simple version)
* @param {string} id The ID of the test result
* @param {V1TestResultSimpleIdPostRequest} v1TestResultSimpleIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultSimpleIdPost(
id: string,
v1TestResultSimpleIdPostRequest: V1TestResultSimpleIdPostRequest,
options?: any,
): AxiosPromise;
/**
*
* @summary Create a new test result from test runs
* @param {V1TestResultSimplePostRequest} v1TestResultSimplePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultSimplePost(
v1TestResultSimplePostRequest: V1TestResultSimplePostRequest,
options?: any,
): AxiosPromise;
/**
*
* @summary Get status of the test result
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultStatusGet(
id: string,
options?: any,
): AxiosPromise;
};
/**
* V1Api - functional programming interface
* @export
*/
export declare const V1ApiFp: (configuration?: Configuration) => {
/**
*
* @summary Submit feedback
* @param {FeedbackRequest} feedbackRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1FeedbackPost(
feedbackRequest: FeedbackRequest,
options?: AxiosRequestConfig,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise
>;
/**
*
* @summary Upload an image file
* @param {string} [org] (If not using an organization API Key) the ID of the organization
* @param {File} [file] The file to upload.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1FilesUploadPost(
org?: string,
file?: File,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Get pipelines, optionally filtered by label
* @param {string} [label] The label to filter pipelines by
* @param {string} [slug] The slug to filter pipelines by
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1PipelinesGet(
label?: string,
slug?: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Create a run
* @param {RunRequest} runRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1RunPost(
runRequest: RunRequest,
options?: AxiosRequestConfig,
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise
>;
/**
* At least one of datasetId, pipelineId, or pipelineSlug must be provided
* @summary Get test cases for a pipeline or dataset
* @param {string} [datasetId] The ID of the Dataset to retrieve test cases for
* @param {string} [pipelineId] The ID of the Pipeline to retrieve test cases for
* @param {string} [pipelineSlug] The slug of the Pipeline to retrieve test cases for
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCaseGet(
datasetId?: string,
pipelineId?: string,
pipelineSlug?: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Update an existing test case
* @param {UpdateTestCase} updateTestCase
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCasePatch(
updateTestCase: UpdateTestCase,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Create a new test case
* @param {V1TestCasePostRequest} v1TestCasePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestCasePost(
v1TestCasePostRequest: V1TestCasePostRequest,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Get test results for a pipeline
* @param {string} pipelineSlug The slug of the pipeline
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultGet(
pipelineSlug: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Fetch test result by ID
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultIdGet(
id: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Add more test runs to a result
* @param {string} id The ID of the test result
* @param {V1TestResultIdPostRequest} v1TestResultIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultIdPost(
id: string,
v1TestResultIdPostRequest: V1TestResultIdPostRequest,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Create a new test result from runs
* @param {V1TestResultPostRequest} v1TestResultPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultPost(
v1TestResultPostRequest: TestResultPostRequest,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Add more test runs to a result (simple version)
* @param {string} id The ID of the test result
* @param {V1TestResultSimpleIdPostRequest} v1TestResultSimpleIdPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultSimpleIdPost(
id: string,
v1TestResultSimpleIdPostRequest: V1TestResultSimpleIdPostRequest,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Create a new test result from test runs
* @param {V1TestResultSimplePostRequest} v1TestResultSimplePostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultSimplePost(
v1TestResultSimplePostRequest: V1TestResultSimplePostRequest,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
/**
*
* @summary Get status of the test result
* @param {string} id The ID of the test result
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
v1TestResultStatusGet(
id: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise
>;
};
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface V1FilesUploadPost201Response
*/
declare interface V1FilesUploadPost201Response {
/**
* URL of the uploaded image
* @type {string}
* @memberof V1FilesUploadPost201Response
*/
url?: string;
}
/**
* @type V1PipelinesGet200ResponsePipelinesInner
* @export
*/
declare type V1PipelinesGet200ResponsePipelinesInner = Pipeline_2 &
V1PipelinesGet200ResponsePipelinesInnerAllOf;
/**
*
* @export
* @interface V1PipelinesGet200ResponsePipelinesInnerAllOf
*/
declare interface V1PipelinesGet200ResponsePipelinesInnerAllOf {
/**
*
* @type {Array}
* @memberof V1PipelinesGet200ResponsePipelinesInnerAllOf
*/
cases?: Array;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface V1TestCasePatch200Response
*/
declare interface V1TestCasePatch200Response {
/**
* ID of the updated test case
* @type {string}
* @memberof V1TestCasePatch200Response
*/
caseId?: string;
}
/**
* @type V1TestCasePost200Response
* @export
*/
declare type V1TestCasePost200Response =
| V1TestCasePost200ResponseOneOf
| V1TestCasePost200ResponseOneOf1;
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface V1TestCasePost200ResponseOneOf
*/
declare interface V1TestCasePost200ResponseOneOf {
/**
* ID of the created test case
* @type {string}
* @memberof V1TestCasePost200ResponseOneOf
*/
caseId?: string;
}
/**
* Gentrace API
* These API routes are designed to ingest events from clients.
*
* The version of the OpenAPI document: 0.27.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface V1TestCasePost200ResponseOneOf1
*/
declare interface V1TestCasePost200ResponseOneOf1 {
/**
* Number of created test cases
* @type {number}
* @memberof V1TestCasePost200ResponseOneOf1
*/
creationCount?: number;
}
/**
* @type V1TestCasePostRequest
* @export
*/
declare type V1TestCasePostRequest =
| CreateMultipleTestCases
| CreateSingleTestCase;
/**
*
* @export
* @interface V1TestResultIdPostRequest
*/
declare interface V1TestResultIdPostRequest {
/**
*
* @type {Array}
* @memberof V1TestResultIdPostRequest
*/
testRuns?: Array;
}
/**
*
* @export
* @interface V1TestResultIdPostRequestTestRunsInner
*/
declare interface V1TestResultIdPostRequestTestRunsInner {
/**
* The ID of the test run
* @type {string}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
id?: string | null;
/**
* The ID of the test case. Mutually exclusive with \'name\' and \'inputs\'.
* @type {string}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
caseId?: string;
/**
* The name of the test run. Used with \'inputs\' and mutually exclusive with \'caseId\'.
* @type {string}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
name?: string;
/**
* The input data for the test run. Used with \'name\' and mutually exclusive with \'caseId\'.
* @type {{ [key: string]: any; }}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
inputs?: {
[key: string]: any;
};
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
*
* @type {Array}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
stepRuns: Array;
/**
* Optional path which describes the organizational hierarchy of this test run in relation to all the pipeline tests.
* @type {Array}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
path?: Array | null;
/**
*
* @type {string}
* @memberof V1TestResultIdPostRequestTestRunsInner
*/
error?: string | null;
}
declare const V1TestResultPostRequestCollectionMethodEnum: {
readonly Manual: "manual";
readonly Runner: "runner";
};
declare type V1TestResultPostRequestCollectionMethodEnum =
(typeof V1TestResultPostRequestCollectionMethodEnum)[keyof typeof V1TestResultPostRequestCollectionMethodEnum];
/**
*
* @export
* @interface V1TestResultSimpleIdPostRequest
*/
declare interface V1TestResultSimpleIdPostRequest {
/**
*
* @type {Array}
* @memberof V1TestResultSimpleIdPostRequest
*/
testRuns?: Array;
}
/**
*
* @export
* @interface V1TestResultSimpleIdPostRequestTestRunsInner
*/
declare interface V1TestResultSimpleIdPostRequestTestRunsInner {
/**
* The ID of the test run
* @type {string}
* @memberof V1TestResultSimpleIdPostRequestTestRunsInner
*/
id?: string | null;
/**
* The ID of the test case
* @type {string}
* @memberof V1TestResultSimpleIdPostRequestTestRunsInner
*/
caseId: string;
/**
* The input data for the test case
* @type {{ [key: string]: any; }}
* @memberof V1TestResultSimpleIdPostRequestTestRunsInner
*/
inputs: {
[key: string]: any;
};
/**
* The returned outputs for the test case
* @type {{ [key: string]: any; }}
* @memberof V1TestResultSimpleIdPostRequestTestRunsInner
*/
outputs?: {
[key: string]: any;
};
/**
* Optional path which describes the organizational hierarchy of this test run in relation to all the pipeline tests.
* @type {Array}
* @memberof V1TestResultSimpleIdPostRequestTestRunsInner
*/
path?: Array | null;
/**
*
* @type {string}
* @memberof V1TestResultSimpleIdPostRequestTestRunsInner
*/
error?: string | null;
}
/**
*
* @export
* @interface V1TestResultSimplePostRequest
*/
declare interface V1TestResultSimplePostRequest {
/**
* Slug for the pipeline
* @type {string}
* @memberof V1TestResultSimplePostRequest
*/
pipelineSlug: string;
/**
* The branch that the test result was created from
* @type {string}
* @memberof V1TestResultSimplePostRequest
*/
branch?: string | null;
/**
* The commit that the test result was created from
* @type {string}
* @memberof V1TestResultSimplePostRequest
*/
commit?: string | null;
/**
* The name of the test result
* @type {string}
* @memberof V1TestResultSimplePostRequest
*/
name?: string | null;
/**
*
* @type {{ [key: string]: MetadataValueObject; }}
* @memberof V1TestResultSimplePostRequest
*/
metadata?: {
[key: string]: MetadataValueObject;
} | null;
/**
* Optional flag to trigger remote evaluations
* @type {boolean}
* @memberof V1TestResultSimplePostRequest
*/
triggerRemoteEvals?: boolean;
/**
*
* @type {Array}
* @memberof V1TestResultSimplePostRequest
*/
testRuns: Array;
}
/**
*
* @export
* @interface V1TestResultSimplePostRequestTestRunsInner
*/
declare interface V1TestResultSimplePostRequestTestRunsInner {
/**
* The ID of the test run
* @type {string}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
id?: string | null;
/**
* The ID of the test case
* @type {string}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
caseId: string;
/**
* The input data for the test case
* @type {{ [key: string]: any; }}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
inputs: {
[key: string]: any;
};
/**
* The returned outputs for the test case
* @type {{ [key: string]: any; }}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
outputs?: {
[key: string]: any;
};
/**
* Optional array of local evaluations
* @type {Array}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
evaluations?: Array;
/**
* Optional path which describes the organizational hierarchy of this test run in relation to all the pipeline tests.
* @type {Array}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
path?: Array | null;
/**
*
* @type {string}
* @memberof V1TestResultSimplePostRequestTestRunsInner
*/
error?: string | null;
}
/**
* V2Api - object-oriented interface
* @export
* @class V2Api
* @extends {BaseAPI}
*/
export declare class V2Api extends BaseAPI {
/**
*
* @summary List datasets
* @param {string} [pipelineSlug] The slug of the pipeline to filter datasets by
* @param {string} [pipelineId] The ID of the pipeline to filter datasets by
* @param {boolean} [archived] Filter datasets by archived status
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V2Api
*/
v2DatasetsGet(
pipelineSlug?: string,
pipelineId?: string,
archived?: boolean,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Get a single dataset
* @param {string} id The ID of the dataset to retrieve
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V2Api
*/
v2DatasetsIdGet(
id: string,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Update a dataset
* @param {string} id The ID of the dataset to update
* @param {UpdateDatasetV2} updateDatasetV2
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V2Api
*/
v2DatasetsIdPost(
id: string,
updateDatasetV2: UpdateDatasetV2,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Create a new dataset
* @param {CreateDatasetV2} createDatasetV2
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V2Api
*/
v2DatasetsPost(
createDatasetV2: CreateDatasetV2,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Bulk create evaluations
* @param {V2EvaluationsBulkPostRequest} v2EvaluationsBulkPostRequest
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V2Api
*/
v2EvaluationsBulkPost(
v2EvaluationsBulkPostRequest: V2EvaluationsBulkPostRequest,
options?: AxiosRequestConfig,
): Promise>;
/**
*
* @summary Get evaluations
* @param {string} resultId The ID of the result to get evaluations for
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V2Api
*/
v2EvaluationsGet(
resultId: string,
options?: AxiosRequestConfig,
): Promise