Josh-XT / AGiXT

AGiXT is a dynamic AI Agent Automation Platform that seamlessly orchestrates instruction management and complex task execution across diverse AI providers. Combining adaptive memory, smart features, and a versatile plugin system, AGiXT delivers efficient and comprehensive AI solutions.
https://AGiXT.com
MIT License
2.64k stars 352 forks source link

Errors when trying to chat with agent #183

Closed timuryung closed 1 year ago

timuryung commented 1 year ago

Description

When user clicks on "Message Agent" button, 2 errors are pop up:

Знімок екрана 2023-05-01 о 22 46 29 Знімок екрана 2023-05-01 о 22 46 42

here is backend server error: INFO: 127.0.0.1:50303 - "POST /api/agent/Agent-LLM/chat HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/protocols/http/httptools_impl.py", line 436, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fastapi/applications.py", line 276, in call await super().call(scope, receive, send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 92, in call await self.simple_response(scope, receive, send, request_headers=headers) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/middleware/cors.py", line 147, in simple_response await self.app(scope, receive, send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in call raise exc File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call raise e File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call await self.app(scope, receive, send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/starlette/routing.py", line 66, in app response = await func(request) ^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fastapi/routing.py", line 237, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function return await dependant.call(**values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/timur/Downloads/Agent-LLM-1.1.0-alpha/app.py", line 205, in chat agent = AgentLLM(agent_name) ^^^^^^^^^^^^^^^^^^^^ File "/Users/timur/Downloads/Agent-LLM-1.1.0-alpha/AgentLLM.py", line 34, in init if self.CFG.AI_PROVIDER == "openai": ^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Agent' object has no attribute 'AI_PROVIDER' .env file AI_PROVIDER=huggingchat AI_MODEL=openassistant AI_TEMPERATURE=0.2 MAX_TOKENS=2048

Steps to Reproduce the Bug

  1. Start up frontend server
  2. Start up backend server
  3. Go to the agent page
  4. Set some message for client
  5. Click "Message Agent" button

Expected Behavior

Sends message to client

Actual Behavior

Throws 2 errors

Additional Context / Screenshots

No response

Operating System

Python Version

Environment Type - Connection

Environment Type - Container

Acknowledgements

samuzaffar99 commented 1 year ago

Most likely the backend is unable to communicate with the LLM provider. Are you able to use the same connection in .env otherwise?

Josh-XT commented 1 year ago

Fixed in PR #196