Base: codex-main originale (prima del fork aKode)
This commit is contained in:
19
codex-rs/tools/src/dynamic_tool.rs
Normal file
19
codex-rs/tools/src/dynamic_tool.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use crate::ToolDefinition;
|
||||
use crate::parse_tool_input_schema;
|
||||
use codex_protocol::dynamic_tools::DynamicToolFunctionSpec;
|
||||
|
||||
pub fn parse_dynamic_tool(
|
||||
tool: &DynamicToolFunctionSpec,
|
||||
) -> Result<ToolDefinition, serde_json::Error> {
|
||||
Ok(ToolDefinition {
|
||||
name: tool.name.clone(),
|
||||
description: tool.description.clone(),
|
||||
input_schema: parse_tool_input_schema(&tool.input_schema)?,
|
||||
output_schema: None,
|
||||
defer_loading: tool.defer_loading,
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "dynamic_tool_tests.rs"]
|
||||
mod tests;
|
||||
Reference in New Issue
Block a user