Extract the first node id from a tracedecay_search response.
(search_resp: dict)
| 261 | |
| 262 | @staticmethod |
| 263 | def first_node_id(search_resp: dict) -> str | None: |
| 264 | """Extract the first node id from a tracedecay_search response.""" |
| 265 | try: |
| 266 | text = search_resp["result"]["content"][0]["text"] |
| 267 | items = json.loads(text) |
| 268 | if isinstance(items, list) and items: |
| 269 | return items[0].get("id") |
| 270 | except (KeyError, IndexError, TypeError, json.JSONDecodeError): |
| 271 | return None |
| 272 | return None |
| 273 | |
| 274 | |
| 275 | def benchmark_tracedecay(name: str, root: Path, sample_symbols: list[str]) -> dict: |
no outgoing calls
no test coverage detected