Tool
Tool definition for function calling in chat.
params := JsonParser->TextToElement("{\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"}}}");
tool := Tool->New("get_weather", "Get the weather for a location", params);Operations
New
Constructor
New(name:String, description:String, parameters:JsonElement)Parameters
| Name | Type | Description |
|---|---|---|
| name | String | function name |
| description | String | function description |
| parameters | JsonElement | JSON schema for parameters |
ToJson
Converts tool to JSON for the request.
method : public : ToJson() ~ JsonElementReturn
| Type | Description |
|---|---|
| JsonElement | JSON element |