function-gpt / FunctionCallingProvider
Extend this class to create your own function-calling provider.
Provide functions to be called by decorating them with the @gptFunction
decorator.
See
• new FunctionCallingProvider()
src/public.ts:16
• Private
Readonly
metadata: FunctionCallingProviderMetadata
src/public.ts:14
▸ handleFunctionCalling(name
, argumentsJson
): Promise
<unknown
>
Name | Type | Description |
---|---|---|
name |
string |
Name of the function that is being called. |
argumentsJson |
string |
JSON string of all input arguments to the function call. |
Promise
<unknown
>
Result value of the function call.
src/public.ts:31
▸ getSchema(): undefined
| { name
: string
= f.name; description
: string
= f.description; parameters
: Record
<string
, unknown
> }[]
Generate function schema objects that can be passed directly to OpenAI's Node.js client whenever function calling schema is needed.
undefined
| { name
: string
= f.name; description
: string
= f.description; parameters
: Record
<string
, unknown
> }[]
An array of function schema objects.
src/public.ts:52