Interface: AIFunction()<Schema, Return>
A function meant to be used with OpenAI function calling.
Type parameters
Parameter | Default |
---|---|
Schema extends z.ZodObject <any > | z.ZodObject <any > |
Return extends any | any |
AIFunction(
input
):Promise
<Return
>
The implementation of the function, with arg parsing and validation.
Parameters
Parameter | Type |
---|---|
input | string | Msg |
Returns
Promise
<Return
>
Source
src/prompt/types.ts:67 (opens in a new tab)
Properties
Property | Type | Description | Source |
---|---|---|---|
argsSchema | Schema | The Zod schema for the arguments string. | src/prompt/types.ts:69 (opens in a new tab) |
spec | AIFunctionSpec | The 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
Parameter | Type |
---|---|
input | string | Msg |
Returns
TypeOf
<Schema
>