-
Notifications
You must be signed in to change notification settings - Fork 9
allow reasoning details to pass through #355
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
Conversation
| assistant_message_for_history["tool_calls"] = message["tool_calls"] | ||
|
|
||
| if message.get("reasoning_details"): | ||
| assistant_message_for_history["reasoning_details"] = message["reasoning_details"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Field name mismatch: reasoning_details vs reasoning_content
The new code uses reasoning_details as the field name, but the rest of the codebase (including the Message model in eval_protocol/models.py and the langchain adapter) uses reasoning_content. LiteLLM's documentation also uses reasoning_content. If LiteLLM returns the reasoning in a field called reasoning_content via provider_specific_fields, checking for message.get("reasoning_details") would return None and the reasoning content wouldn't be captured. Similarly, adding reasoning_details to allowed_fields wouldn't preserve the actual reasoning_content field.
Note
Surfaces
provider_specific_fields(includingreasoning_details) from LiteLLM responses and preservesreasoning_detailsin conversation history; adds a unit test.provider_specific_fieldson the message; simplifytool_callsextraction via a singlemessage_obj.reasoning_detailsin_clean_messages_for_api.LLMBasePolicy, propagateprovider_specific_fields.reasoning_detailsintoassistantmessage asreasoning_details.tests/test_litellm_policy_provider_fields.pyto verifyprovider_specific_fields(incl.reasoning_detailsand other fields) are preserved.Written by Cursor Bugbot for commit 16ffbac. This will update automatically on new commits. Configure here.