You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. What is the weather like today? (Should use get_current_location tool first)
320
+
321
+
322
+
## Reasoning
323
+
324
+
**Important Notice**: Please carefully review the following points before using reasoning mode for Chat completion API.
325
+
- The only model supports Reasoning is Claude 3.7 Sonnet (extended thinking) so far. Please make sure the model supports reasoning.
326
+
- The reasoning mode (or thinking mode) is not enabled by default, you must pass additional `reasoning_effort` parameter in your request.
327
+
- The reasoning response (CoT, thoughts) is added in an additional tag 'reasoning_content' which is not officially supported by OpenAI. This is to follow [Deepseek Reasoning Model](https://api-docs.deepseek.com/guides/reasoning_model#api-example). This may be changed in the future.
328
+
- Please provide the right max_tokens (or max_completion_tokens) in your request. The budget_tokens is based on reasoning_effort (low: 30%, medium: 60%, high: 100% of max tokens), ensuring minimum budget_tokens of 1,024 with Anthropic recommending at least 4,000 tokens for comprehensive reasoning. Check [Bedrock Document](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-37.html) for more details.
"content": "3.9 is bigger than 3.11.\n\nWhen comparing decimal numbers, we need to understand what these numbers actually represent:...",
366
+
"reasoning_content": "I need to compare the decimal numbers 3.9 and 3.11.\n\nFor decimal numbers, we first compare the whole number parts, and if they're equal, we compare the decimal parts. \n\nBoth numbers ..."
367
+
}
368
+
}
369
+
],
370
+
"object": "chat.completion",
371
+
"usage": {
372
+
"prompt_tokens": 51,
373
+
"completion_tokens": 565,
374
+
"total_tokens": 616
375
+
}
376
+
}
377
+
```
378
+
379
+
You can also use OpenAI SDK (run `pip3 install -U openai` first )
380
+
381
+
```python
382
+
from openai import OpenAI
383
+
client = OpenAI()
384
+
385
+
messages = [{"role": "user", "content": "which one is bigger, 3.9 or 3.11?"}]
"content": "3.9 is bigger than 3.11.\n\nWhen comparing decimal numbers, we need to understand what these numbers actually represent:...",
365
+
"reasoning_content": "I need to compare the decimal numbers 3.9 and 3.11.\n\nFor decimal numbers, we first compare the whole number parts, and if they're equal, we compare the decimal parts. \n\nBoth numbers ..."
0 commit comments