Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Function tool definition

Example Usage

import { OpenResponsesNonStreamingResponseToolFunction } from "@openrouter/sdk/models";

let value: OpenResponsesNonStreamingResponseToolFunction = {
  type: "function",
  name: "get_weather",
  parameters: {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "The city and state",
      },
      "unit": {
        "type": "string",
        "enum": [
          "celsius",
          "fahrenheit",
        ],
        "x-speakeasy-unknown-values": "allow",
      },
    },
    "required": [
      "location",
    ],
  },
};

Fields

FieldTypeRequiredDescription
type”function”:heavy_check_mark:N/A
namestring:heavy_check_mark:N/A
descriptionstring:heavy_minus_sign:N/A
strictboolean:heavy_minus_sign:N/A
parametersRecord<string, *any*>:heavy_check_mark:N/A