-
Notifications
You must be signed in to change notification settings - Fork 16
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
Changes from 1 commit
55eafa2
a8c103d
1d630d4
8366a85
4bc58f7
4ebc8c4
15ff290
16ffbac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,20 @@ def __init__( | |
| # Initialize conversation state tracking for proper OpenAI trajectories | ||
| self.initialized = False | ||
|
|
||
| def _supports_reasoning_details(self) -> bool: | ||
| """ | ||
| Returns True if this policy is configured for a provider/model that expects | ||
| top-level reasoning_details to be preserved (e.g., Gemini 3 via OpenRouter). | ||
| """ | ||
| model_id = getattr(self, "model_id", "") or "" | ||
| base_url = getattr(self, "base_url", "") or "" | ||
|
|
||
| if isinstance(model_id, str) and "openrouter" in model_id: | ||
| return True | ||
| if isinstance(base_url, str) and "openrouter.ai" in base_url: | ||
| return True | ||
| return False | ||
|
|
||
| @abstractmethod | ||
| async def _make_llm_call(self, messages: List[Dict], tools: List[Dict]) -> Dict: | ||
| """ | ||
|
|
@@ -199,6 +213,9 @@ async def _generate_live_tool_calls( | |
| if message.get("tool_calls"): | ||
| assistant_message_for_history["tool_calls"] = message["tool_calls"] | ||
|
|
||
| if message.get("reasoning_details") and self._supports_reasoning_details(): | ||
| assistant_message_for_history["reasoning_details"] = message["reasoning_details"] | ||
|
xzrderek marked this conversation as resolved.
Outdated
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Field name mismatch: reasoning_details vs reasoning_contentThe new code uses Additional Locations (1) |
||
|
|
||
| # Add to actual conversation history | ||
| conversation_history.append(assistant_message_for_history) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.