ChatFunctionToolFunction - TypeScript SDK

ChatFunctionToolFunction type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Example Usage

1import { ChatFunctionToolFunction } from "@openrouter/sdk/models";
2
3let value: ChatFunctionToolFunction = {
4 function: {
5 name: "get_weather",
6 },
7 type: "function",
8};

Fields

FieldTypeRequiredDescriptionExample
cacheControlmodels.ChatContentCacheControlCache control for the content part{"ttl": "5m","type": "ephemeral"}
functionmodels.ChatFunctionToolFunctionFunction✔️Function definition for tool calling{"description": "Get the current weather for a location","name": "get_weather","parameters": {"properties": {"location": {"description": "City name","type": "string"}
},
“required”: [
“location”
],
“type”: “object”
}
}
typemodels.ChatFunctionToolType✔️N/A