function-gpt
▸ gptFunction(description
, inputType
): (target
: object
, propertyKey
: string
, descriptor
: PropertyDescriptor
) => void
Use this decorator on a method within a FunctionCallingProvider subclass to enable it for function-calling.
Name | Type | Description |
---|---|---|
description |
string |
A description of the function. |
inputType |
() => unknown |
Input for the function should be an object instance of a custom class. This parameter specifies the class of the object. |
fn
▸ (target
, propertyKey
, descriptor
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
descriptor |
PropertyDescriptor |
void
See
▸ gptObjectField(type
, description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on a property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
type |
"string" | "number" | "boolean" | { enum : string [] } | ["string" | "number" | "boolean" | { enum : string [] } | () => unknown ] | () => unknown |
undefined |
Type of the field. Use 'string' , 'number' , 'boolean' for primitive types. Use ['string'] , ['number'] , ['boolean'] for arrays of primitive types. Use a ClassName for custom types. Use [ClassName] for arrays of custom types. |
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void
▸ gptString(description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on a string property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void
▸ gptNumber(description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on a number property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void
▸ gptBoolean(description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on a boolean property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void
▸ gptObject(type
, description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on a custom class property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
type |
() => unknown |
undefined |
Type of the field. |
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void
▸ gptEnum(values
, description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on a custom class property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
values |
string [] |
undefined |
Possible values of the enum. |
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void
▸ gptArray(type
, description
, optional?
): (target
: object
, propertyKey
: string
) => void
Use this decorator on an array of strings property within a custom class to include it as a parameter for function-calling.
Name | Type | Default value | Description |
---|---|---|---|
type |
"string" | "number" | "boolean" | { enum : string [] } | () => unknown |
undefined |
- |
description |
string |
undefined |
Description of the field. |
optional |
boolean |
false |
Whether the field is optional. Default to false . |
fn
▸ (target
, propertyKey
): void
Name | Type |
---|---|
target |
object |
propertyKey |
string |
void