(tool_name: str, tool_params: dict)
| 51 | |
| 52 | |
| 53 | def dispatch_tool(tool_name: str, tool_params: dict) -> str: |
| 54 | if tool_name not in _TOOL_HOOKS: |
| 55 | return f"Tool `{tool_name}` not found. Please use a provided tool." |
| 56 | tool_call = _TOOL_HOOKS[tool_name] |
| 57 | try: |
| 58 | ret = tool_call(**tool_params) |
| 59 | except: |
| 60 | ret = traceback.format_exc() |
| 61 | return str(ret) |
| 62 | |
| 63 | |
| 64 | def get_tools() -> dict: |
no test coverage detected