Skip to content

Commit

Permalink
Removed problematic import 'NotRegisteredError' from tool_parse library.
Browse files Browse the repository at this point in the history
For some reason we can't import NotRegisteredError -> The API doesn't run. it got replaced with a generic Exception inside �gent.py.
  • Loading branch information
antoninoLorenzo committed Aug 21, 2024
1 parent c41710c commit 3857c57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
from json import JSONDecodeError

from tool_parse import ToolRegistry, NotRegisteredError
from tool_parse import ToolRegistry

from src.agent.knowledge import Store
from src.agent.llm import LLM, AVAILABLE_PROVIDERS
Expand Down Expand Up @@ -121,7 +121,7 @@ def invoke_tools(self, tool_response):
)
call_stack.append(tool_meta)
results.append({'role': 'tool', 'content': str(res)})
except NotRegisteredError:
except Exception:
pass

return results
Expand Down
2 changes: 1 addition & 1 deletion src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import StreamingResponse
from pydantic_settings import BaseSettings
from tool_parse import ToolRegistry, NotRegisteredError
from tool_parse import ToolRegistry

from src import initialize_knowledge
from src.agent import Agent
Expand Down

0 comments on commit 3857c57

Please sign in to comment.