anthropic-sdk-python icon indicating copy to clipboard operation
anthropic-sdk-python copied to clipboard

API allows temperature of -1

Open phgas opened this issue 10 months ago • 2 comments

While playing around with Postman, I randomly discovered you can set the temperature to -1:

{
    "type": "error",
    "error": {
        "type": "invalid_request_error",
        "message": "temperature: range: -1 or 0..1"
    }
}

Surprisingly setting the temperature to -1 doesn't trigger an error, even though your documentation specifies a valid range of (0,1). https://github.com/anthropics/anthropic-sdk-python/blob/8b244157a7d03766bec645b0e1dc213c6d462165/src/anthropic/types/message_create_params.py#L164

Why is this the case?

phgas avatar Mar 05 '25 00:03 phgas

Oops, thanks for the bug report, we'll add this task internally!

chaselambda avatar Mar 28 '25 23:03 chaselambda

Thanks! Feel free to let me know once fixed :)

phgas avatar Apr 07 '25 16:04 phgas