| 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(); |