Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new FunctionDefinition incompatible with azure #15

Closed
Ran-Mewo opened this issue May 11, 2024 · 2 comments
Closed

new FunctionDefinition incompatible with azure #15

Ran-Mewo opened this issue May 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Ran-Mewo
Copy link
Contributor

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:https://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.

@Lambdua
Copy link
Owner

Lambdua commented May 12, 2024

Okay, I'll see later

@Lambdua Lambdua added the bug Something isn't working label May 13, 2024
@Lambdua
Copy link
Owner

Lambdua commented May 13, 2024

I don't have an Azure API key. It would be great if you could provide one for me to test. Currently, I can only streamline the response schema

@Lambdua Lambdua mentioned this issue May 13, 2024
@Lambdua Lambdua closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants