MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / tools_to_input_tools

Method tools_to_input_tools

crates/opencode-provider/src/openai.rs:595–610  ·  view source on GitHub ↗
(tools: Option<&Vec<crate::ToolDefinition>>)

Source from the content-addressed store, hash-verified

593 }
594
595 fn tools_to_input_tools(tools: Option<&Vec<crate::ToolDefinition>>) -> Option<Vec<InputTool>> {
596 let tools = tools?;
597 if tools.is_empty() {
598 return None;
599 }
600 Some(
601 tools
602 .iter()
603 .map(|tool| InputTool::Function {
604 name: tool.name.clone(),
605 description: tool.description.clone(),
606 input_schema: tool.parameters.clone(),
607 })
608 .collect(),
609 )
610 }
611
612 fn responses_generate_options(&self, request: &ChatRequest) -> GenerateOptions {
613 let mut prompt = request.messages.clone();

Callers

nothing calls this directly

Calls 2

is_emptyMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected