| 19 | |
| 20 | |
| 21 | class DummyLLM: |
| 22 | def __init__(self): |
| 23 | self.calls = 0 |
| 24 | |
| 25 | async def generate(self, messages, tools): |
| 26 | self.calls += 1 |
| 27 | if self.calls == 1: |
| 28 | return LLMResponse( |
| 29 | content="", |
| 30 | thinking="calling echo", |
| 31 | tool_calls=[ |
| 32 | ToolCall( |
| 33 | id="tool1", |
| 34 | type="function", |
| 35 | function=FunctionCall(name="echo", arguments={"text": "ping"}), |
| 36 | ) |
| 37 | ], |
| 38 | finish_reason="tool", |
| 39 | ) |
| 40 | return LLMResponse(content="done", thinking=None, tool_calls=None, finish_reason="stop") |
| 41 | |
| 42 | |
| 43 | class EchoTool(Tool): |