Synchronous wrapper around [`run_tool_loop`].
(
provider: &LlmProvider,
executor: &dyn ToolExecutor,
query: &str,
config: &AgentConfig,
)
| 670 | |
| 671 | /// Synchronous wrapper around [`run_tool_loop`]. |
| 672 | pub fn run_tool_loop_sync( |
| 673 | provider: &LlmProvider, |
| 674 | executor: &dyn ToolExecutor, |
| 675 | query: &str, |
| 676 | config: &AgentConfig, |
| 677 | ) -> Result<AgentResult, AiError> { |
| 678 | let rt = tokio::runtime::Builder::new_current_thread() |
| 679 | .enable_all() |
| 680 | .build() |
| 681 | .map_err(|e| AiError::Runtime(e.to_string()))?; |
| 682 | rt.block_on(run_tool_loop(provider, executor, query, config)) |
| 683 | } |
| 684 | |
| 685 | // ── RepoToolExecutor ──────────────────────────────────────────── |
| 686 |
no test coverage detected