Fix to accept both tool format chat/completion and responses

#11
by blancsw - opened

Fix Apertus jinja template to accept both tool call format (chat/completion and responses)

Chat Completions API

{
  "type": "function",
  "function": {
    "name": "get_weather",
    "description": "Determine weather in my location",
    "strict": true,
    "parameters": {
      "type": "object",
      "properties": {
        "location": {
          "type": "string",
        },
      },
      "additionalProperties": false,
      "required": [
        "location",
        "unit"
      ]
    }
  }
}

Responses API

{
  "type": "function",
  "name": "get_weather",
  "description": "Determine weather in my location",
  "parameters": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
      },
    },
    "additionalProperties": false,
    "required": [
      "location",
      "unit"
    ]
  }
}
Swiss AI Initiative org
Swiss AI Initiative org

I suggest we close this for now, and focus on getting ready to support this in the next release.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment