Structure of function calling

Hey there,

within the docs it’s described how to write a function:

tools: [{
    "type": "function",
    "function": {
      "name": "getCurrentWeather",
      "description": "Get the weather in location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {"type": "string", "description": "The city and state e.g. San Francisco, CA"},
          "unit": {"type": "string", "enum": ["c", "f"]}
        },
        "required": ["location"]
      }
    }
  }, {
    "type": "function",
    "function": {
      "name": "getNickname",
      "description": "Get the nickname of a city",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {"type": "string", "description": "The city and state e.g. San Francisco, CA"},
        },
        "required": ["location"]
      }
    }
  }]

However: It’s described nowhere where this structure comes from, on what it’s based.

What I mean by that: Which option to we hav efor example for type, which do we have for properties. What can we use other than type: string enum etc.

Can someone point me into the right direction?

Based on OpenAPI:

1 Like