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