import { ArrayToFields, Stream, StreamIO, TypeToFields } from "../data"; import { Builder, ModulePath } from "../template"; import { ModuleBuilder } from '../template/ModuleBuilder'; import { TypeBuilder, AbstractTypeBuilder, Variable, EastFunction, EastType, StringType, ArrayType, BooleanType, BlobType, Nullable, StructType, DictType, VariantType, DateTimeType, NullType, ValueTypeOf, SimpleAggregationTimeUnit, FloatType, IntegerType } from '../east'; import { DefaultDeploymentValue } from "../source"; import { FieldType, Orientation } from "../layout"; /** @internal */ export type OpenAiModel = 'gpt-3.5-turbo' | 'gpt-4-turbo' | 'gpt-4o'; /** @internal */ export type LLMModel = VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; 'custom': StringType; }>; /** @internal */ export declare const LLMModelType: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; /** @internal */ export type LLMWriteFunction = { type: 'write'; name: string; description: string; args_type: T; args_schema: any; stream: Stream; validation?: { is_error: EastFunction; message: EastFunction; } | undefined; }; /** @internal */ export type LLMExpressionFunction = { type: 'expression'; name: string; description: string; args_type: I; args_schema: any; ret: EastFunction; ret_schema: any; silent: boolean; validation?: { is_error: EastFunction; message: EastFunction; } | undefined; }; /** @internal */ export type LLMAggregateFunction = DictType> = { type: 'aggregate'; name: string; description: string; args_type: undefined; args_schema: any; value: Variable; value_schema?: any; silent: boolean; }; /** @internal */ export type LLMReadFunction = { type: 'read'; name: string; description: string; args_type: undefined; args_schema: any; ret: Variable; ret_schema: any; silent: boolean; }; /** @internal */ export type LLMChartFunction | ArrayType = DictType | ArrayType> = { type: 'chart'; name: string; description: string; args_type: undefined; args_schema: any; stream: Stream; stream_schema: any; }; /** @internal */ export type LLMMessage = VariantType<{ 'system': StructType<{ role: StringType; content: StringType; }>; 'user': StructType<{ role: StringType; content: StringType; }>; 'assistant': StructType<{ role: StringType; content: StringType; }>; 'function': StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; /** @internal */ export declare const LLMMessageType: VariantType<{ system: StructType<{ role: StringType; content: StringType; }>; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; /** @internal */ export type LLMFunctionCall = VariantType<{ 'expression': StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; 'aggregate': StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; 'read': StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; 'write': StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; 'chart': StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; 'unknown': StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; }>; /** @internal */ export declare const LLMFunctionCallType: VariantType<{ expression: StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; aggregate: StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; read: StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; write: StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; chart: StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; unknown: StructType<{ role: StringType; function_call: StructType<{ name: StringType; arguments: StringType; }>; }>; }>; /** @internal */ export type LLMFunction = LLMAggregateFunction | LLMWriteFunction | LLMChartFunction | LLMReadFunction | LLMExpressionFunction; /** @internal */ export type LLMMessageStep = StructType<{ date: DateTimeType; message: LLMMessage; }>; /** @internal */ export declare const LLMMessageStepType: StructType<{ date: DateTimeType; message: VariantType<{ system: StructType<{ role: StringType; content: StringType; }>; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; /** @internal */ export type LLMImageStep = StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; /** @internal */ export declare const LLMImageStepType: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; /** @internal */ export type LLMFunctionResponse = VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; /** @internal */ export declare const LLMFunctionResponseType: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; /** @internal */ export type LLMFunctionValue = VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; /** @internal */ export declare const LLMFunctionValueType: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; /** @internal */ export type LLMFunctionOutput = StructType<{ arguments: Nullable; response: LLMFunctionResponse; input: LLMFunctionValue; output: LLMFunctionValue; caption: StringType; explanation: StringType; call: StringType; }>; /** @internal */ export declare const LLMFunctionOutputType: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; /** @internal */ export type LLMFunctionResult = VariantType<{ 'expression': LLMFunctionOutput; 'aggregate': LLMFunctionOutput; 'read': LLMFunctionOutput; 'write': LLMFunctionOutput; 'chart': LLMFunctionOutput; 'unknown': LLMFunctionOutput; }>; /** @internal */ export declare const LLMFunctionResultType: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; /** @internal */ export type LLMFunctionStep = StructType<{ date: DateTimeType; name: StringType; result: LLMFunctionResult; }>; /** @internal */ export declare const LLMFunctionStepType: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; /** @internal */ export type LLMToolStep = StructType<{ date: DateTimeType; name: StringType; }>; /** @internal */ export declare const LLMToolStepType: StructType<{ date: DateTimeType; name: StringType; }>; /** @internal */ export type LLMStep = VariantType<{ 'message': LLMMessageStep; 'image': LLMImageStep; 'function': LLMFunctionStep; 'tool': LLMToolStep; }>; /** @internal */ export declare const LLMStepType: VariantType<{ message: StructType<{ date: DateTimeType; message: VariantType<{ system: StructType<{ role: StringType; content: StringType; }>; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>; /** @internal */ export type LLMStatus = VariantType<{ 'queued': NullType; 'in_progress': NullType; 'requires_action': NullType; 'cancelling': NullType; 'cancelled': NullType; 'failed': NullType; 'completed': NullType; 'incomplete': NullType; 'expired': NullType; 'unknown': NullType; }>; /** @internal */ export declare const LLMStatusType: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; /** @internal output if error occured */ export type LLMErrorState = StructType<{ error: StringType; assistant: Nullable; thread: Nullable; purpose: StringType; prompt: Nullable; model: LLMModel; status: LLMStatus; steps: ArrayType; }>; /** @internal output if thread exists and run is inactive */ export type LLMThreadState = StructType<{ assistant: StringType; thread: StringType; purpose: StringType; prompt: Nullable; model: LLMModel; status: LLMStatus; steps: ArrayType; }>; /** @internal output if thread exists and run is inactive */ export type LLMRunState = StructType<{ assistant: StringType; thread: StringType; run: StringType; purpose: StringType; prompt: Nullable; model: LLMModel; status: LLMStatus; steps: ArrayType; }>; /** @internal output if thread exists and run is inactive */ export type LLMFunctionCallState = StructType<{ assistant: StringType; thread: StringType; run: StringType; purpose: StringType; prompt: Nullable; model: LLMModel; status: LLMStatus; steps: ArrayType; calls: ArrayType; }>; /** @internal input */ export type LLMState = VariantType<{ 'uninitialized': NullType; 'error': LLMErrorState; 'thread': LLMThreadState; 'run': LLMRunState; 'tool': LLMFunctionCallState; }>; /** @internal input */ export type LLMOutput = VariantType<{ 'error': LLMErrorState; 'success': LLMThreadState; }>; /** @internal input */ export declare const LLMErrorStateType: StructType<{ error: StringType; assistant: Nullable; thread: Nullable; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; /** @internal input */ export declare const LLMThreadStateType: StructType<{ assistant: StringType; thread: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; /** @internal input */ export declare const LLMRunStateType: StructType<{ assistant: StringType; thread: StringType; run: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; /** @internal input */ export declare const LLMFunctionCallStateType: StructType<{ assistant: StringType; thread: StringType; run: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; calls: ArrayType; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>>; }>; /** @internal */ export declare const LLMStateType: VariantType<{ uninitialized: NullType; error: StructType<{ error: StringType; assistant: Nullable; thread: Nullable; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; thread: StructType<{ assistant: StringType; thread: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; run: StructType<{ assistant: StringType; thread: StringType; run: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; tool: StructType<{ assistant: StringType; thread: StringType; run: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; calls: ArrayType; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>>; }>; }>; /** @internal */ export declare const LLMOutputType: VariantType<{ error: StructType<{ error: StringType; assistant: Nullable; thread: Nullable; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; success: StructType<{ assistant: StringType; thread: StringType; purpose: StringType; prompt: Nullable; model: VariantType<{ 'gpt-3.5-turbo': NullType; 'gpt-4-turbo': NullType; 'gpt-4o': NullType; custom: StringType; }>; status: VariantType<{ queued: NullType; in_progress: NullType; requires_action: NullType; cancelling: NullType; cancelled: NullType; failed: NullType; completed: NullType; incomplete: NullType; expired: NullType; unknown: NullType; }>; steps: ArrayType; user: StructType<{ role: StringType; content: StringType; }>; assistant: StructType<{ role: StringType; content: StringType; }>; function: StructType<{ role: StringType; name: StringType; content: StringType; }>; }>; }>; image: StructType<{ date: DateTimeType; role: StringType; content: BlobType; }>; function: StructType<{ date: DateTimeType; name: StringType; result: VariantType<{ expression: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; aggregate: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; read: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; write: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; chart: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; unknown: StructType<{ arguments: Nullable; response: VariantType<{ value: StructType<{ success: BooleanType; value: StringType; }>; success: StructType<{ success: BooleanType; }>; error: StructType<{ success: BooleanType; error: StringType; }>; }>; input: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; output: VariantType<{ value: StructType<{ value: StringType; type: StringType; }>; json: StringType; none: NullType; }>; caption: StringType; explanation: StringType; call: StringType; }>; }>; }>; tool: StructType<{ date: DateTimeType; name: StringType; }>; }>>; }>; }>; /** @internal */ export type LLMTrainingValidation = ArrayType>; /** @internal */ export type LLMAssistantTaskDescription = { task_type: 'llm_assistant'; module: ModulePath; name: string; model: EastFunction; api_key: EastFunction; instructions: EastFunction; prompt: EastFunction>; state: Stream; journal: Stream>; output: Stream; functions: Record; inputs: Record; outputs: Record; examples?: any; }; /** @internal */ export type LLMTrainingTaskDescription = { task_type: 'llm_training'; module: ModulePath; name: string; api_key: EastFunction; model: Stream; training: Stream>>; validation: Stream; functions: Record; inputs: Record; outputs: Record; }; /** @internal */ export type LLMTaskDescription = LLMAssistantTaskDescription | LLMTrainingTaskDescription; /** * Construct a multi-modal LLM agent from a purpose, prompt, functions and streams. * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .write( * "change_price", * "Change the value of the price.", * price.outputStream(), * ) * ``` * */ export declare class LLMBuilder = {}> { protected name: string; protected inputs: Inputs; protected input_streams: Record; private module; /** * Construct a multi-modal LLM agent from a purpose, prompt, functions and streams. * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .write( * "change_price", * "Change the value of the price.", * price.outputStream(), * ) * ``` **/ constructor(name: string, module?: ModuleBuilder | ModulePath, inputs?: Inputs, input_streams?: Record); /** * Add an additional named input {@link Stream} to the {@link LLMBuilder}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * // use a stream that is a collection of pdf documents per customer * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .input({ name: "price", stream: price.outputStream() }) * .write( * "change_price", * "Change the value of the price.", * price.outputStream(), * ) * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): LLMBuilder; }>; /** * Construct an Agent that produces any {@link EastType} {@link Stream}, based on a purpose, requests and other streams. * * @param config the configuration including the OpenAI api key. * @returns a new {@link LLMAssistantBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .write( * "change_price", * "Change the value of the price.", * price.outputStream(), * ) * ``` **/ assistant(args: { /** the OpenAI api key */ api_key: string | ((inputs: Inputs) => EastFunction); /** the purpose of the assistant */ purpose?: string | ((inputs: Inputs) => EastFunction); /** the assistant state, a message or thread */ prompt?: string | ((inputs: Inputs) => EastFunction>); /** the open ai model to use */ model?: OpenAiModel | ((inputs: Inputs) => EastFunction); }): LLMAssistantBuilder; } /** * {@inheritDoc LLMBuilder} * * @category LLM * */ export declare class LLMAssistantBuilder = Record, Functions extends Record = Record, Outputs extends Record = Record, Samples extends VariantType<{ message: LLMMessage; } & { [K in keyof Functions]: LLMFunctionCall; }> = VariantType<{ message: LLMMessage; } & { [K in keyof Functions]: LLMFunctionCall; }>> extends Builder { private api_key; private model; private instructions; private prompt; private inputs; private input_streams; private functions; private outputs; private examples; /** @internal */ constructor(name: string, module: ModuleBuilder | ModulePath, api_key: EastFunction, model: EastFunction, instructions: EastFunction, prompt: EastFunction>, inputs?: Inputs, input_streams?: Record, functions?: Functions, outputs?: Outputs, examples?: ValueTypeOf>>); /** @internal */ constructor(name: string, module: ModulePath, api_key: EastFunction, model: EastFunction, instructions: EastFunction, prompt: EastFunction>, inputs?: Inputs, input_streams?: Record, functions?: Functions, outputs?: Outputs, examples?: ValueTypeOf>>); /** * Add an additional named input {@link Stream} to the {@link LLMBuilder}. * * @param config the input `stream` and the resulting variable `name` * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .read( * "get_the_price", * "Get the current value of the price", * (inputs) => inputs.price, * ) * ``` **/ input(config: { /** The name of the input. **/ name: Name & Name extends "input" | keyof Inputs ? never : Name; /** The {@link Stream} to input. **/ stream: Stream; }): LLMAssistantBuilder; }, Functions, Outputs, Samples>; /** * Allow the agent provide arguments to a function that evaluates a user defined expression, if added to a layout the values will be shown in a chat message. * * @param function_name The unique identifier for the function. * @param config A configuration object providing options for the expression operation. * @param config.function_args the description and type of the arguments that the agent may pass into the function * @param config.function_description A descriptive text explaining the purpose and behavior of the function. * @param config.return_value the expression for the function to evaluate from the args, the value of this is returned to the agent * @param config.return_description The optional description of the return value (optional). * @param config.return_error The predicate to check for an error, and message returned to the agent based on the arguments, return value, and inputs (optional). * @param config.return_error.is_error The {@link EastFunction} with a predicate indicating if an error has occurred (required when `return_error` is provided). * @param config.return_error.message The {@link EastFunction} with an error message (required when `return_error` is provided). * @param config.silent False if the function should return the value to the agent, defaults to true (optional). * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .expression( * "filter_sales", * { * function_args: (builder) => builder * .describe("The filter parameters") * .struct(builder => builder * .field('start', builder => builder.describe('sales with dates earlier than this will be removed').datetime()) * .field('end', builder => builder.describe('sales with dates later than this will be removed').datetime()) * ), * return_value: (args, inputs) => Filter( * inputs.sales, * (value) => And( * GreaterEqual(GetField(value, 'date'), GetField(args, 'start')), * LessEqual(GetField(value, 'date'), GetField(args, 'end')) * ) * ), * } * ) * ``` **/ expression( /** The name of the function. **/ function_name: Name & Name extends keyof Functions ? never : Name, /** the configuration. **/ config: { /** The {@link StructType} function arguments that must be passed in by the agent. **/ function_args: AbstractTypeBuilder | ((builder: TypeBuilder) => AbstractTypeBuilder); /** The description of the function. **/ function_description?: string; /** The {@link EastFunction} value returned to the agent. **/ return_value: (args: Variable, inputs: Inputs) => EastFunction; /** The optional description of the return value. **/ return_description?: AbstractTypeBuilder | ((builder: TypeBuilder) => AbstractTypeBuilder); /** The predicate to check for an error, and message returned to the agent based on the arguments, return value and inputs. **/ return_error?: { /** * the {@link EastFunction} with a predicate indicating if an has occurred * * @param args the arguments provided by the agent, as a {@link Variable} * @param ret the return value to be provided to the agent, as a {@link Variable} * @param inputs the input {@link Stream}s, which may be used in validation * **/ is_error: (args: Variable, ret: Variable, inputs: Inputs) => EastFunction; /** * the {@link EastFunction} with an error message * * @param args the arguments provided by the agent, as a {@link Variable} * @param ret the return value to be provided to the agent, as a {@link Variable} * @param inputs the input {@link Stream}s, which may be used in validation **/ message: (args: Variable, ret: Variable, inputs: Inputs) => EastFunction; }; /** False if the function should return the value to the agent, defaults to true. **/ silent?: boolean; }): LLMAssistantBuilder; }, Outputs, Samples>; /** * Allow the agent provide definition of an aggregation to perform on a stream, if added to a layout the values will be shown in a chat message. * * @param function_name The unique identifier for the function. * @param config A configuration object providing options for the aggregation operation. * @param config.value A function that takes input streams and returns a {@link Variable} representing the data to be aggregated. * @param config.value_description An optional description for the structure of the data entries within the collection. * @param config.function_description A descriptive text explaining the purpose and behavior of the function. * @param config.silent If set to `false`, the function result will be returned to the agent. Defaults to `true` if unspecified. * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .aggregate( * "aggregate_sales", * { * value: (inputs) => inputs.sales, * } * ) * ``` **/ aggregate>( /** The name of the function. **/ function_name: Name & Name extends keyof Functions ? never : Name, /** the configuration. **/ config: { /** The {@link Variable} to be aggregated. **/ value: (inputs: Inputs) => Variable; /** The optional description of the entries in the collection. **/ value_description?: AbstractTypeBuilder | ((builder: TypeBuilder) => AbstractTypeBuilder); /** The description of the function. **/ function_description?: string; /** False if the function should return the value to the agent. **/ silent?: boolean; }): LLMAssistantBuilder; }, Outputs, Samples>; /** * Allow the agent to read a {@link Stream} value, if added to a layout the values will be shown in a chat message. * * @param function_name The unique identifier for the function. * @param config A configuration object providing options for the read operation. * @param config.value A function that takes input streams and read a {@link Variable}, representing the value to be read. * @param config.value_description An optional description of the value to read, providing more detail on the type and structure of the data. * @param function_description A descriptive text explaining the purpose and behavior of the function. * @param config.silent If set to `false`, the read value will be returned to the agent. Defaults to `true` if unspecified. * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .read( * "get_the_price", * { * return_value: (inputs) => inputs.price, * } * ) * ``` **/ read( /** The name of the value. **/ function_name: Name & Name extends keyof Functions ? never : Name, /** the extended configuration. **/ config: { /** The value returned to the assistant, @remarks this is not an {@link Expression} **/ value: (inputs: Inputs) => Variable; /** The optional description of the stream value. **/ value_description?: AbstractTypeBuilder | ((builder: TypeBuilder) => AbstractTypeBuilder); /** The description of the function. **/ function_description?: string; /** False if the function should return the value to the agent. **/ silent?: boolean; }): LLMAssistantBuilder; }, Functions & { [K in Name]: LLMReadFunction; }, Outputs, Samples>; /** * Allow the agent to write a value to an existing writable stream, if added to a layout the values will be shown in a chat message. * * @param function_name The unique identifier for the function. * @param config A configuration object providing options for the write operation. * @param config.value the description and type of the arguments that the agent may pass into the function * @param config.value_description The optional description the value (optional). * @param config.function_description A descriptive text explaining the purpose and behavior of the function. * @param config.return_error The predicate to check for an error, and message returned to the agent based on the arguments, return value, and inputs (optional). * @param config.return_error.is_error The {@link EastFunction} with a predicate indicating if an error has occurred (required when `return_error` is provided). * @param config.return_error.message The {@link EastFunction} with an error message (required when `return_error` is provided). * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .write( * "change_the_price", * { * value: price.outputStream(), * } * ) * ``` **/ write( /** The name of the value. **/ function_name: Name & Name extends keyof Functions ? never : Name, /** the extended configuration. **/ config: { /** The stream containing the value **/ value: Stream; /** The optional description of the stream. **/ value_description?: AbstractTypeBuilder | ((builder: TypeBuilder) => AbstractTypeBuilder); /** The description of the function. **/ function_description?: string; /** The predicate to check for an error, and message returned to the agent based on the arguments, and inputs. **/ return_error?: { /** * the {@link EastFunction} with a predicate indicating if an has occurred * * @param value the output value created by the agent to validate, as a {@link Variable} * @param inputs the input {@link Stream}s, which may be used in validation * **/ is_error: (args: Variable, inputs: Inputs) => EastFunction; /** * the {@link EastFunction} with an error message * * @param value the output value created by the agent to validate, as a {@link Variable} * @param inputs the input {@link Stream}s, which may be used in validation **/ message: (args: Variable, inputs: Inputs) => EastFunction; }; }): LLMAssistantBuilder; }, Outputs, Samples>; /** * Allow the agent to create a chart from a stream, if added to a layout the chart will be shown in a chat message. * * @param function_name The unique identifier for the function. * @param config A configuration object providing options for the chart operation. * @param config.value the {@link Stream} that the chart will visualize * @param config.value_description The optional description the value (optional). * @param config.function_description A descriptive text explaining the purpose and behavior of the function. * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .chart( * "chart_sales_data", * { * value: sales_data.outputStream(), * } * ) * ``` **/ chart>( /** The name of the function. **/ function_name: Name & Name extends keyof Functions ? never : Name, /** the extended configuration. **/ config: { /** The {@link Stream} to visualize. **/ value: Stream; /** The optional description of the {@link Stream} to visualize. **/ value_description?: AbstractTypeBuilder | ((builder: TypeBuilder) => AbstractTypeBuilder); /** The description of the function. **/ function_description?: string; }): LLMAssistantBuilder; }, Outputs, Samples>; /** * Add a chain of example messages, and functions calls to inform the agent. * * @param values The builder defining the examples. * @param function_description A descriptive text explaining the purpose and behavior of the function. * @param function_args the description and type of the arguments that the agent may pass into the function * @param value the {@link Stream} that the chart will visualize * @param config supplementary configuration definition * @param config.example_prompt The string hint to provide for use to the user and the agent (optional). * @param config.example_function_call The function call hint to provide for use to the agent (optional). * @param config.value_description The optional description of the stream to be visualized. * @returns a new {@link LLMBuilder} * * @category LLM * * @example * ```typescript * const price = new SourceBuilder("price") * .value({ value: 5 }); * * const message = new SourceBuilder("message",) * .writeable(AssistantInputStateType); * * const sales = new SourceBuilder("sales") * .writeable(DictType( * StringType, * StructType({ * date: DateTimeType, * item: StringType, * qty: IntegerType, * inventory: IntegerType, * price: FloatType, * amount: FloatType, * })) * ) * * const model = new SourceBuilder("model",) * .value({ value: variant('gpt-3.5-turbo-1106', null), type: LLMModelType }); * * const assistant = new LLMBuilder("assistant") * .input({ name: "sales", stream: sales.outputStream() }) * .input({ name: "message", stream: message.outputStream() }) * .input({ name: "model", stream: model.outputStream() }) * .input({ name: "price", stream: price.outputStream() }) * .assistant({ * api_key: "...", * purpose: "You are a business analyst assistant", * prompt: (inputs) => inputs.message, * model: (inputs) => inputs.model, * }) * .chart( * "chart_sales_data", * `Read, aggregate and chart the sales data`, * sales_data.outputStream(), * ) * .example(builder => builder * .message('user', "Can you show me the revenue over time per item, based on a price of $5.5?") * .call('write_inputs', builder => builder.args("Set the price.", 5.5)) * .call('read_and_aggregate_results_data', builder => builder * .args( * "A chart showing the total revenue per item over time.", * { * name: "Total revenue per item over time", * mark: { kind: "line" }, * x: { field: 'date', title: "Date", type: 'temporal' }, * y: { field: 'amount', title: "Revenue", type: 'quantitative', aggregate: 'sum' }, * color: { field: 'item', title: "Item", type: 'nominal' } * }) * ) * .message('assistant', "The chart of total revenue for a price of $5.5 was generated successfully.") * ) * ``` **/ example(values: (builder: LLMTrainingSampleBuilder) => LLMTrainingSampleBuilder): LLMAssistantBuilder; /** * Return the {@link Stream} containing the output of the agent. * * @category Source * */ outputStreams(): Outputs; /** @internal */ stateStream(): Stream; /** @internal */ stateJournalStream(): Stream>; /** @internal */ outputStream(): Stream; /** @internal */ toTemplate(): { streams: Record; defaults: Record; tasks: { [x: string]: { task_type: "llm_assistant"; module: ModulePath; name: string; api_key: EastFunction; model: EastFunction; instructions: EastFunction; prompt: EastFunction>; output: Stream; state: Stream; journal: Stream>; inputs: Record; outputs: Record; functions: Functions; examples: any; }; }; }; } /** @internal */ export declare class LLMTrainingBuilder { private name; private module; constructor(name: string, module?: ModulePath | ModuleBuilder); fromAssistant = Record, F extends Record = Record, O extends Record = Record>(assistant: LLMAssistantBuilder, model: Stream): LLMTrainingCaseBuilder; } /** @internal */ export declare class LLMTrainingCaseBuilder = Record, Samples extends VariantType<{ message: LLMMessage; } & { [K in keyof Functions]: LLMFunctionCall; }> = VariantType<{ message: LLMMessage; } & { [K in keyof Functions]: LLMFunctionCall; }>> extends Builder { private functions; private api_key; private model; private samples; /** @internal */ constructor(name: string, module: ModuleBuilder | ModulePath, functions: Functions, api_key: EastFunction, model: Stream, cases: ValueTypeOf>>); /** @internal */ constructor(name: string, module: ModulePath, functions: Functions, api_key: EastFunction, model: Stream, cases: ValueTypeOf>>); example(values: (builder: LLMTrainingSampleBuilder) => LLMTrainingSampleBuilder): LLMTrainingCaseBuilder; /** * Return a datastream containing training statistics per training iteration * * @returns The validation {@link Stream} * * @category ML * * */ validationStream(): Stream; /** @internal */ trainingStream(): Stream>>; /** @internal */ toTemplate(): { streams: Record; defaults: Record; tasks: { [x: string]: { task_type: "llm_training"; module: ModulePath; name: string; api_key: EastFunction; model: Stream; training: Stream>>; validation: Stream; functions: Functions; inputs: Record; outputs: Record; }; }; }; } /** @internal */ export declare class LLMTrainingSampleBuilder = Record, Samples extends VariantType<{ message: LLMMessage; } & { [K in keyof Functions]: LLMFunctionCall; }> = VariantType<{ message: LLMMessage; } & { [K in keyof Functions]: LLMFunctionCall; }>> { private functions; private samples; /** @internal */ constructor(functions: Functions, samples?: Samples); /** @internal */ constructor(functions: Functions, samples?: Samples); message(role: 'user' | 'assistant', content: string): LLMTrainingSampleBuilder; call : Functions[Name] extends LLMWriteFunction ? LLMWriteTrainingBuilder : Functions[Name] extends LLMChartFunction ? LLMChartTrainingBuilder : Functions[Name] extends LLMReadFunction ? LLMValueTrainingBuilder : Functions[Name] extends LLMExpressionFunction ? LLMExpressionTrainingBuilder : never)>(name: Name, builder: (builder: B) => LLMTrainingSampleFinalizer): LLMTrainingSampleBuilder; } /** @internal */ export declare class LLMWriteTrainingBuilder> { private f; constructor(f: F); args(caption: string, def: ValueTypeOf): LLMTrainingSampleFinalizer; } /** @internal */ export declare class LLMValueTrainingBuilder> { private f; constructor(f: F); args(caption: string): LLMTrainingSampleFinalizer; } /** @internal */ export declare class LLMExpressionTrainingBuilder> { private f; constructor(f: F); args(caption: string, def: ValueTypeOf): LLMTrainingSampleFinalizer; } /** @internal */ export declare class LLMAggregateTrainingBuilder, F extends LLMAggregateFunction> { private f; constructor(f: F); args, Value extends keyof Fields, Key extends keyof Fields, Group extends keyof Fields>(caption: string, def: { aggregate: "find_minimum" | "find_maximum"; value: Fields[Value]["type"] extends DateTimeType ? { field: Value; timeUnit?: SimpleAggregationTimeUnit; } : { field: Value; }; key: Fields[Key]["type"] extends DateTimeType ? { field: Key; timeUnit?: SimpleAggregationTimeUnit; } : { field: Key; }; group?: Fields[Group]["type"] extends DateTimeType ? { field: Group; timeUnit?: SimpleAggregationTimeUnit; } : { field: Group; }; } | { aggregate: "count" | "distinct" | "sum" | "mean" | "max" | "min" | "collect"; value: Fields[Value]["type"] extends DateTimeType ? { field: Value; timeUnit?: SimpleAggregationTimeUnit; } : { field: Value; }; key?: Fields[Key]["type"] extends DateTimeType ? { field: Key; timeUnit?: SimpleAggregationTimeUnit; } : { field: Key; }; group?: Fields[Group]["type"] extends DateTimeType ? { field: Group; timeUnit?: SimpleAggregationTimeUnit; } : { field: Group; }; }): LLMTrainingSampleFinalizer; } /** @internal */ export declare class LLMChartTrainingBuilder | ArrayType, F extends LLMChartFunction> { private f; constructor(f: F); args ? TypeToFields : V extends ArrayType ? ArrayToFields : never), X extends keyof Fields, Y extends keyof Fields, Color extends keyof Fields, Size extends keyof Fields, Detail extends keyof Fields>(caption: string, def: { name: string; mark: { kind: 'point'; } | { kind: 'bar'; orient?: Orientation; } | { kind: 'line'; interpolate?: 'linear' | 'monotone' | 'step'; } | { kind: 'boxplot'; extent?: "min-max" | number; } | { kind: 'tick'; }; x: Fields[X]["type"] extends FloatType | IntegerType ? { field: X; type: FieldType; title?: string; aggregate?: 'count' | 'distinct' | 'sum' | 'mean' | 'stdev' | 'median' | 'max' | 'min'; bin?: boolean; } : Fields[X]["type"] extends DateTimeType ? { field: X; type: FieldType; title?: string; timeUnit?: 'date' | 'day' | 'hours' | 'month' | 'week' | 'year'; } : Fields[X]["type"] extends StringType ? { field: X; type: FieldType; title?: string; } : never; y: Fields[Y]["type"] extends FloatType | IntegerType ? { field: Y; type: FieldType; title?: string; aggregate?: 'count' | 'distinct' | 'sum' | 'mean' | 'stdev' | 'median' | 'max' | 'min'; bin?: boolean; } : Fields[Y]["type"] extends DateTimeType ? { field: Y; type: FieldType; title?: string; timeUnit?: 'date' | 'day' | 'hours' | 'month' | 'week' | 'year'; } : Fields[Y]["type"] extends StringType ? { field: Y; type: FieldType; title?: string; } : never; color?: Fields[Color]["type"] extends FloatType | IntegerType ? { field: Color; type: FieldType; title?: string; aggregate?: 'count' | 'distinct' | 'sum' | 'mean' | 'stdev' | 'median' | 'max' | 'min'; bin?: boolean; } : Fields[Color]["type"] extends StringType ? { field: Color; type: FieldType; title?: string; } : never; size?: Fields[Size]["type"] extends FloatType | IntegerType ? { field: Size; type: FieldType; title?: string; aggregate?: 'count' | 'distinct' | 'sum' | 'mean' | 'stdev' | 'median' | 'max' | 'min'; bin?: boolean; } : Fields[Size]["type"] extends DateTimeType ? { field: Size; type: FieldType; title?: string; timeUnit?: 'date' | 'day' | 'hours' | 'month' | 'week' | 'year'; } : Fields[Size]["type"] extends StringType ? { field: Size; type: FieldType; title?: string; } : never; detail?: Fields[Detail]["type"] extends FloatType | IntegerType ? { field: Detail; type: FieldType; title?: string; aggregate?: 'count' | 'distinct' | 'sum' | 'mean' | 'stdev' | 'median' | 'max' | 'min'; bin?: boolean; } : Fields[Detail]["type"] extends StringType ? { field: Y; type: FieldType; title?: string; } : never; }): LLMTrainingSampleFinalizer; } /** @internal */ export declare class LLMTrainingSampleFinalizer { private sample; constructor(sample: ValueTypeOf); toValue(): ValueTypeOf; } /** * new BA({ * inputs: { * "A": * }, * output: { * "C": builder => * } * }) * .example() * .example() * */