Select the tools that should be exposed to the model for this turn. The executor still owns every registered tool. This function only trims the tool definitions sent to the LLM, keeping routine turns small while allowing specialized tools when the prompt asks for them.
(
tools: &[ToolDefinition],
messages: &[Message],
)
| 67 | /// tool definitions sent to the LLM, keeping routine turns small while allowing |
| 68 | /// specialized tools when the prompt asks for them. |
| 69 | pub fn select_tools_for_messages( |
| 70 | tools: &[ToolDefinition], |
| 71 | messages: &[Message], |
| 72 | ) -> Vec<ToolDefinition> { |
| 73 | let context = selection_context(messages); |
| 74 | select_tools_for_prompt(tools, &context) |
| 75 | } |
| 76 | |
| 77 | pub fn select_tools_for_prompt(tools: &[ToolDefinition], prompt: &str) -> Vec<ToolDefinition> { |
| 78 | if tools.is_empty() { |
no test coverage detected