Skip to content

control

agentic_ml.research.tools.control

The finish_research control tool.

make_finish_research

make_finish_research(ctx: ResearchContext)

Build a finish_research tool bound to ctx.

Source code in src/agentic_ml/research/tools/control.py
13
14
15
16
17
18
19
20
21
22
23
24
def make_finish_research(ctx: ResearchContext):
    """Build a ``finish_research`` tool bound to ``ctx``."""

    @tool
    def finish_research(reason: str = "") -> str:
        """Signal that the research loop is complete.

        Call this when the iteration budget is spent or no further improvement seems likely.
        """
        return f"Research finished. {reason}".strip()

    return finish_research