Build a mock LLM response containing a tool call. Uses the chuk_llm native format (top-level tool_calls key), which is what the real client returns with stream=False.
(name: str, args: dict)
| 150 | |
| 151 | |
| 152 | def _tool_call_response(name: str, args: dict) -> dict: |
| 153 | """Build a mock LLM response containing a tool call. |
| 154 | |
| 155 | Uses the chuk_llm native format (top-level tool_calls key), |
| 156 | which is what the real client returns with stream=False. |
| 157 | """ |
| 158 | return { |
| 159 | "response": None, |
| 160 | "tool_calls": [ |
| 161 | { |
| 162 | "id": "call_1", |
| 163 | "type": "function", |
| 164 | "function": { |
| 165 | "name": name, |
| 166 | "arguments": json.dumps(args), |
| 167 | }, |
| 168 | } |
| 169 | ], |
| 170 | "usage": {"prompt_tokens": 50, "completion_tokens": 15}, |
| 171 | } |
| 172 | |
| 173 | |
| 174 | def _text_response(text: str = "Step complete.") -> dict: |
no outgoing calls
no test coverage detected