Tool message whose content JSON contains som_elements.
(n_elements: int, url: str = "https://example.com")
| 180 | |
| 181 | |
| 182 | def _som_tool_msg(n_elements: int, url: str = "https://example.com"): |
| 183 | """Tool message whose content JSON contains som_elements.""" |
| 184 | content = json.dumps( |
| 185 | { |
| 186 | "url": url, |
| 187 | "som_filename": "/shots/shot.png", |
| 188 | "som_elements": [ |
| 189 | f"id: {i}, text: elem{i}, tag: button" for i in range(1, n_elements + 1) |
| 190 | ], |
| 191 | } |
| 192 | ) |
| 193 | return { |
| 194 | "role": "tool", |
| 195 | "tool_call_id": "x", |
| 196 | "name": "browser_navigate", |
| 197 | "content": content, |
| 198 | } |
| 199 | |
| 200 | |
| 201 | def _plain_tool_msg(): |
no outgoing calls
no test coverage detected