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

Example Usage

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

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

Fields

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