这是indexloc提供的服务,不要输入任何密码
Skip to content

new FunctionDefinition incompatible with azure #15

@Ran-Mewo

Description

@Ran-Mewo

Using the new FunctionDefinition returns this on azure's gpt-4-turbo

  "error": {
    "message": "1 validation error for Request\nbody -> tools\n  extra fields not permitted (type=value_error.extra)",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }

Looking at the converted JSON (I used ObjectMapper().writeValueAsString so I am not sure if it's accurate)

{
    "type": "function",
    "function": {
      "name": "wolframAlpha",
      "description": "Computes mathematical expressions using WolframAlpha",
      "parameters": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Wolfram Alpha Function",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "input": {
            "type": "string"
          }
        }
      }
    }
  }

seems like azure doesn't support the "$schema", "title", "aditionalProperties" fields as I can't find these in any documentation

another limitation with the new FunctionDefinition is that it doesn't allow parameterless functions, the parameters field is optional and can be omitted

Omitting parameters defines a function with an empty parameter list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions