307 lines
12 KiB
TypeScript
307 lines
12 KiB
TypeScript
/* tslint:disable */
|
|
/* eslint-disable */
|
|
/**
|
|
* OpenPipe API
|
|
* The public API for reporting API calls to OpenPipe
|
|
*
|
|
* The version of the OpenAPI document: 0.1.0
|
|
*
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
|
|
|
|
import type { Configuration } from './configuration';
|
|
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
import globalAxios from 'axios';
|
|
// Some imports not used depending on template conditions
|
|
// @ts-ignore
|
|
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
|
|
import type { RequestArgs } from './base';
|
|
// @ts-ignore
|
|
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
|
|
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface ExternalApiCapturePromptDefaultResponse
|
|
*/
|
|
export interface ExternalApiCapturePromptDefaultResponse {
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptDefaultResponse
|
|
*/
|
|
'message': string;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptDefaultResponse
|
|
*/
|
|
'code': string;
|
|
/**
|
|
*
|
|
* @type {Array<ExternalApiCapturePromptDefaultResponseIssuesInner>}
|
|
* @memberof ExternalApiCapturePromptDefaultResponse
|
|
*/
|
|
'issues'?: Array<ExternalApiCapturePromptDefaultResponseIssuesInner>;
|
|
}
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface ExternalApiCapturePromptDefaultResponseIssuesInner
|
|
*/
|
|
export interface ExternalApiCapturePromptDefaultResponseIssuesInner {
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptDefaultResponseIssuesInner
|
|
*/
|
|
'message': string;
|
|
}
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface ExternalApiCapturePromptRequest
|
|
*/
|
|
export interface ExternalApiCapturePromptRequest {
|
|
/**
|
|
* API token for authentication
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'apiKey': string;
|
|
/**
|
|
* Data flow ID
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'dataFlowId': string;
|
|
/**
|
|
* Prompt construction function
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'promptFunction': string;
|
|
/**
|
|
* Scenario variables as JSON
|
|
* @type {any}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'scenarioVariables'?: any;
|
|
/**
|
|
* Prompt object as JSON
|
|
* @type {any}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'prompt'?: any;
|
|
/**
|
|
* Model name
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'model': string;
|
|
/**
|
|
* Model provider
|
|
* @type {string}
|
|
* @memberof ExternalApiCapturePromptRequest
|
|
*/
|
|
'modelProvider': string;
|
|
}
|
|
/**
|
|
*
|
|
* @export
|
|
* @interface ExternalApiCaptureResponseRequest
|
|
*/
|
|
export interface ExternalApiCaptureResponseRequest {
|
|
/**
|
|
* API token for authentication
|
|
* @type {string}
|
|
* @memberof ExternalApiCaptureResponseRequest
|
|
*/
|
|
'apiKey': string;
|
|
/**
|
|
* Logged call ID
|
|
* @type {string}
|
|
* @memberof ExternalApiCaptureResponseRequest
|
|
*/
|
|
'loggedCallId': string;
|
|
/**
|
|
* JSON-encoded response payload
|
|
* @type {any}
|
|
* @memberof ExternalApiCaptureResponseRequest
|
|
*/
|
|
'responsePayload'?: any;
|
|
}
|
|
|
|
/**
|
|
* DefaultApi - axios parameter creator
|
|
* @export
|
|
*/
|
|
export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
return {
|
|
/**
|
|
* Capture a prompt with its variables call
|
|
* @param {ExternalApiCapturePromptRequest} externalApiCapturePromptRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
externalApiCapturePrompt: async (externalApiCapturePromptRequest: ExternalApiCapturePromptRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'externalApiCapturePromptRequest' is not null or undefined
|
|
assertParamExists('externalApiCapturePrompt', 'externalApiCapturePromptRequest', externalApiCapturePromptRequest)
|
|
const localVarPath = `/v1/capture-prompt`;
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
localVarRequestOptions.data = serializeDataIfNeeded(externalApiCapturePromptRequest, localVarRequestOptions, configuration)
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
/**
|
|
* Capture a response to a prompt
|
|
* @param {ExternalApiCaptureResponseRequest} externalApiCaptureResponseRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
externalApiCaptureResponse: async (externalApiCaptureResponseRequest: ExternalApiCaptureResponseRequest, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
// verify required parameter 'externalApiCaptureResponseRequest' is not null or undefined
|
|
assertParamExists('externalApiCaptureResponse', 'externalApiCaptureResponseRequest', externalApiCaptureResponseRequest)
|
|
const localVarPath = `/v1/capture-response`;
|
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
let baseOptions;
|
|
if (configuration) {
|
|
baseOptions = configuration.baseOptions;
|
|
}
|
|
|
|
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
const localVarHeaderParameter = {} as any;
|
|
const localVarQueryParameter = {} as any;
|
|
|
|
|
|
|
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
|
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
localVarRequestOptions.data = serializeDataIfNeeded(externalApiCaptureResponseRequest, localVarRequestOptions, configuration)
|
|
|
|
return {
|
|
url: toPathString(localVarUrlObj),
|
|
options: localVarRequestOptions,
|
|
};
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* DefaultApi - functional programming interface
|
|
* @export
|
|
*/
|
|
export const DefaultApiFp = function(configuration?: Configuration) {
|
|
const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration)
|
|
return {
|
|
/**
|
|
* Capture a prompt with its variables call
|
|
* @param {ExternalApiCapturePromptRequest} externalApiCapturePromptRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async externalApiCapturePrompt(externalApiCapturePromptRequest: ExternalApiCapturePromptRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.externalApiCapturePrompt(externalApiCapturePromptRequest, options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
/**
|
|
* Capture a response to a prompt
|
|
* @param {ExternalApiCaptureResponseRequest} externalApiCaptureResponseRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
async externalApiCaptureResponse(externalApiCaptureResponseRequest: ExternalApiCaptureResponseRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
|
|
const localVarAxiosArgs = await localVarAxiosParamCreator.externalApiCaptureResponse(externalApiCaptureResponseRequest, options);
|
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
},
|
|
}
|
|
};
|
|
|
|
/**
|
|
* DefaultApi - factory interface
|
|
* @export
|
|
*/
|
|
export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
const localVarFp = DefaultApiFp(configuration)
|
|
return {
|
|
/**
|
|
* Capture a prompt with its variables call
|
|
* @param {ExternalApiCapturePromptRequest} externalApiCapturePromptRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
externalApiCapturePrompt(externalApiCapturePromptRequest: ExternalApiCapturePromptRequest, options?: any): AxiosPromise<string> {
|
|
return localVarFp.externalApiCapturePrompt(externalApiCapturePromptRequest, options).then((request) => request(axios, basePath));
|
|
},
|
|
/**
|
|
* Capture a response to a prompt
|
|
* @param {ExternalApiCaptureResponseRequest} externalApiCaptureResponseRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
*/
|
|
externalApiCaptureResponse(externalApiCaptureResponseRequest: ExternalApiCaptureResponseRequest, options?: any): AxiosPromise<any> {
|
|
return localVarFp.externalApiCaptureResponse(externalApiCaptureResponseRequest, options).then((request) => request(axios, basePath));
|
|
},
|
|
};
|
|
};
|
|
|
|
/**
|
|
* DefaultApi - object-oriented interface
|
|
* @export
|
|
* @class DefaultApi
|
|
* @extends {BaseAPI}
|
|
*/
|
|
export class DefaultApi extends BaseAPI {
|
|
/**
|
|
* Capture a prompt with its variables call
|
|
* @param {ExternalApiCapturePromptRequest} externalApiCapturePromptRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof DefaultApi
|
|
*/
|
|
public externalApiCapturePrompt(externalApiCapturePromptRequest: ExternalApiCapturePromptRequest, options?: AxiosRequestConfig) {
|
|
return DefaultApiFp(this.configuration).externalApiCapturePrompt(externalApiCapturePromptRequest, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
|
|
/**
|
|
* Capture a response to a prompt
|
|
* @param {ExternalApiCaptureResponseRequest} externalApiCaptureResponseRequest
|
|
* @param {*} [options] Override http request option.
|
|
* @throws {RequiredError}
|
|
* @memberof DefaultApi
|
|
*/
|
|
public externalApiCaptureResponse(externalApiCaptureResponseRequest: ExternalApiCaptureResponseRequest, options?: AxiosRequestConfig) {
|
|
return DefaultApiFp(this.configuration).externalApiCaptureResponse(externalApiCaptureResponseRequest, options).then((request) => request(this.axios, this.basePath));
|
|
}
|
|
}
|
|
|
|
|