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. Please use English, otherwise it will be closed.
Motivation
In order to better support reasoning models, such as DeepSeek-R1, etc., the API needs to support the reasoning_effort parameter. In addition, it is recommended to add reasoning_content to the output field mentioned in reasoning_model , used to display step information of reasoning thinking.
Similar to the dialogue completion interface parameters provided by openai. The parameter reasoning_effort support o1 model: "constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."
Related resources
No response
The text was updated successfully, but these errors were encountered:
However, this doesn't break API compatibility since it's a newly added parameter. The code below still works even though the response.choices[0].message's data class, ChatCompletionMessage, doesn't include such a parameter. Given that, I think it’s safe to add such a parameter, especially since more reasoning models will likely output CoT tokens soon.
from openai import OpenAI
client = OpenAI(api_key="", base_url="https://api.deepseek.com")
# Round 1
messages = [{"role": "user", "content": "9.11 and 9.8, which is greater?"}]
response = client.chat.completions.create(
model="deepseek-reasoner",
messages=messages
)
+ reasoning_content = response.choices[0].message.reasoning_content
content = response.choices[0].message.content
classChatCompletionMessage(BaseModel):
content: Optional[str] =None"""The contents of the message."""refusal: Optional[str] =None"""The refusal message generated by the model."""role: Literal["assistant"]
"""The role of the author of this message."""audio: Optional[ChatCompletionAudio] =None""" If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio). """function_call: Optional[FunctionCall] =None"""Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. """tool_calls: Optional[List[ChatCompletionMessageToolCall]] =None"""The tool calls generated by the model, such as function calls."""
Checklist
Motivation
In order to better support reasoning models, such as DeepSeek-R1, etc., the API needs to support the reasoning_effort parameter. In addition, it is recommended to add reasoning_content to the output field mentioned in reasoning_model , used to display step information of reasoning thinking.
Similar to the dialogue completion interface parameters provided by openai. The parameter reasoning_effort support o1 model: "constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response."
Related resources
No response
The text was updated successfully, but these errors were encountered: