-
Notifications
You must be signed in to change notification settings - Fork 75
refactor(openai-bridge): finish descriptor pattern, fix FileSearch routing gap #1450
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 6 commits
f069e88
074d8cd
2d10a9b
d9d362d
4d27779
283f27f
f93df56
59079f8
bbc603f
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 |
|---|---|---|
|
|
@@ -14,7 +14,24 @@ use openai_protocol::{ | |
| }, | ||
| }; | ||
| use serde_json::{json, Value}; | ||
| use smg_mcp::{ApprovalMode, McpToolSession}; | ||
| use smg_mcp::{ApprovalMode, BuiltinToolType, McpToolSession}; | ||
|
|
||
| /// Map a single `ResponseTool` variant to the `BuiltinToolType` the MCP | ||
| /// router uses for resolution. `None` for non-builtin tool kinds (e.g. | ||
| /// `Function`, `Mcp`, `Computer`). Centralizing here keeps the four | ||
| /// hosted families (web_search_preview / code_interpreter / file_search / | ||
| /// image_generation) in lockstep — every caller that previously matched | ||
| /// on `ResponseTool::*` independently was at risk of forgetting a variant | ||
| /// when a new builtin lands. | ||
| pub fn builtin_type_for_response_tool(tool: &ResponseTool) -> Option<BuiltinToolType> { | ||
| match tool { | ||
| ResponseTool::WebSearchPreview(_) => Some(BuiltinToolType::WebSearchPreview), | ||
| ResponseTool::CodeInterpreter(_) => Some(BuiltinToolType::CodeInterpreter), | ||
| ResponseTool::FileSearch(_) => Some(BuiltinToolType::FileSearch), | ||
|
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.
When a Responses request includes Useful? React with 👍 / 👎. |
||
| ResponseTool::ImageGeneration(_) => Some(BuiltinToolType::ImageGeneration), | ||
| _ => None, | ||
| } | ||
| } | ||
|
|
||
| #[inline] | ||
| fn schema_to_value(schema: &serde_json::Map<String, Value>) -> Value { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.