import { JSONSchema7 } from "json-schema"; import { ConfigurationParameters, CreateChatCompletionRequest, CreateCompletionRequest } from "openai"; import { ValueOf } from "ts-essentials"; export interface ImaginaryFunctionDefinition { funcName: string; funcComment: string; parameterTypes: { name: string; type?: JSONSchema7; }[]; returnSchema: JSONSchema7 | null; /** Set to false when parser allows imaginary functions in the response */ isImaginary?: boolean; serviceParameters: ServiceParameters; } type OpenAIParameters = Partial> & { apiConfig?: ConfigurationParameters; }; export interface ServiceParameters { openai?: OpenAIParameters; } declare const safeServiceParameterKeys: ("max_tokens" | "temperature")[]; type SafeKeys = ValueOf; /** Extract only the exact keys that we should be passing to OpenAI's api calls */ export declare function getSafeOpenAIServiceParameters(serviceParameters: ServiceParameters): Pick; export declare const AI_SERVICES: (keyof ServiceParameters)[]; /** Come up with a unique hash to represent an imaginary function definition, for use in tracking changes, etc */ export declare function hashFunctionDefinition(definition: ImaginaryFunctionDefinition): string; export {};