Skip to content

Missing max_tokens Parameter Causes 400 Bad Request for claude-3.7-sonnet-thought #6

@DevFil

Description

@DevFil

When using the model claude-3.7-sonnet-thought, I receive a 400 Bad Request error:
{ "error": { "message": "Bad Request", "type": "response_error", "status": 400, "details": "Bad Request\n" } }.

Looking at the logs, I saw that the parameter max_tokens" : 8192 is missing, which in the case of the specific model "claude-3.7-sonnet-thought" i think is mandatory.

This is the body generated by the wrapper which causes error 400:

{
  "model": "claude-3.7-sonnet-thought",
  "temperature": 1,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0,
  "n": 1,
  "stream": true,
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ]
}

and this is the working body generated by the Copilot VS Code extension:

{
   "max_tokens" : 8192,
   "messages" : [
      {
         "content" : "Hello",
         "role" : "user"
      }
   ],
   "model" : "claude-3.7-sonnet-thought",
   "n" : 1,
   "stream" : true,
   "temperature" : 0.0000000000000000,
   "top_p" : 1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions