Documentation
Namespaces
Prompt
interfaces
Aifunction

Interface: AIFunction()<Schema, Return>

A function meant to be used with OpenAI function calling.

Type parameters

ParameterDefault
Schema extends z.ZodObject<any>z.ZodObject<any>
Return extends anyany

AIFunction(input): Promise<Return>

The implementation of the function, with arg parsing and validation.

Parameters

ParameterType
inputstring | Msg

Returns

Promise<Return>

Source

src/prompt/types.ts:67 (opens in a new tab)

Properties

PropertyTypeDescriptionSource
argsSchemaSchemaThe Zod schema for the arguments string.src/prompt/types.ts:69 (opens in a new tab)
specAIFunctionSpecThe function spec for the OpenAI API functions property.src/prompt/types.ts:73 (opens in a new tab)

Methods

parseArgs()

parseArgs(input): TypeOf<Schema>

Parse the function arguments from a message.

Parameters

ParameterType
inputstring | Msg

Returns

TypeOf<Schema>

Source

src/prompt/types.ts:71 (opens in a new tab)