Skip to content

tools

diapason.agents.hybrid.skillorchestra.tools

The three SkillOrchestra tools: search, enhance_reasoning (code), answer.

Faithful port of orchestration/eval_frames.py:call_tool — same worker prompts, same extraction, same Python subprocess execution. Two deltas, both forced by the Diapason environment and documented inline:

  • search — the original POSTs to a FAISS wiki retriever service. We honor method_cfg.retriever_url and POST the exact same payload when it's set; with no retriever configured we fall back to Anthropic's server-side web_search tool so the stage still grounds.
  • in-tool correctness check — the original answer tool LLM-judges the prediction against the gold answer inside call_tool. Diapason scores with its own harness judge downstream, so we only return the prediction; no gold answer is threaded in.

anthropic_tools()

The 3 orchestrator tools in Anthropic input_schema shape.

gemini_tools()

The 3 orchestrator tools in Gemini function-declaration shape.

openai_tools()

The 3 orchestrator tools in OpenAI function shape.

run_answer(agent, spec, *, context_str, problem, max_tokens=40000)

Generate the final answer with spec and extract the prediction.

The original branches the prompt by model family: Qwen-3 / Qwen-math get a \boxed{} system prompt; GPT-5 / Claude (and we extend this to every other model) get the <think>/<answer> instruction. The in-tool LLM correctness check is dropped — Diapason scores downstream.

run_code(agent, spec, *, context_str, problem, bash_timeout_s=60)

Generate self-contained Python with spec, execute it, return stdout.

Mirrors the original worker prompt and subprocess.run(['python', ...], timeout=60) verbatim. Execution failures yield empty exec_result rather than raising — the orchestrator learns the model can't code.

Write a search query with spec, then retrieve documents.

Query generation is the original verbatim worker prompt. Retrieval: if retriever_url is set we POST the original /retrieve payload; otherwise we fall back to Anthropic web_search (the documented Diapason substitution for the missing FAISS wiki index).