@twilio-alpha/assistants-eval
Version:
promptfoo extension for writing AI evaluations for Twilio AI Assistants
25 lines • 1.3 kB
TypeScript
import { FetchLibrary, RequestInitRetryParams } from 'fetch-retry';
import pino from 'pino';
import { ApiProvider, CallApiContextParams, CallApiOptionsParams, ProviderOptions, ProviderResponse } from 'promptfoo/dist/src/types/providers';
export type ExternalProviderOptions = ProviderOptions & {
config: {
url: string;
identifier?: string;
requestOptions?: Omit<RequestInit, 'body'>;
retryOptions?: RequestInitRetryParams<FetchLibrary>;
};
};
export default class ExternalProvider implements ApiProvider {
protected readonly logger: pino.Logger;
readonly defaultUrl: string;
private readonly identifier;
readonly requestOptions: RequestInit;
private readonly retryOptions;
constructor({ id, label, config }: ExternalProviderOptions);
id(): string;
protected getUrl(_prompt: string, _context?: CallApiContextParams, _callApiOptions?: CallApiOptionsParams): string;
protected getBody(prompt: string, _context?: CallApiContextParams, _callApiOptions?: CallApiOptionsParams): string;
protected getResponse(response: Response): Promise<ProviderResponse>;
callApi(prompt: string, context?: CallApiContextParams, callApiOptions?: CallApiOptionsParams): Promise<ProviderResponse>;
}
//# sourceMappingURL=external.d.ts.map