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.62k stars 349 forks source link

Error Loading Agent Configuration: 'str' object has no attribute 'get' #849

Closed sambickeita closed 1 year ago

sambickeita commented 1 year ago

Description

When I attempt to load a local model, I encounter the error message 'str' object has no attribute 'get'. This error occurs during the process of loading the agent configuration, indicating a problem with accessing a specific attribute within the configuration.

Steps to Reproduce the Bug

  1. Agent Settings
  2. Agent Name
  3. wizardLM-13B.ggmlv3.q4_0
  4. error : Error loading agent configuration: 'str' object has no attribute 'get'

agixt-main-agixt-1 | INFO: Started server process [15] agixt-main-agixt-1 | INFO: Waiting for application startup. agixt-main-agixt-1 | INFO: Application startup complete. agixt-main-agixt-1 | INFO: Started server process [14] agixt-main-agixt-1 | INFO: Waiting for application startup. agixt-main-agixt-1 | INFO: Application startup complete. agixt-main-agixt-1 | INFO: Started server process [12] agixt-main-agixt-1 | INFO: Waiting for application startup. agixt-main-agixt-1 | INFO: Application startup complete. agixt-main-agixt-1 | INFO: Started server process [13] agixt-main-agixt-1 | INFO: Waiting for application startup. agixt-main-agixt-1 | INFO: Application startup complete. agixt-main-agixt-1 | INFO: 172.19.0.3:58908 - "GET /api/agent HTTP/1.1" 200 OK agixt-main-agixt-1 | INFO: 172.19.0.3:58912 - "GET /api/agent/wizardLM-13B-Uncensored.ggmlv3.q4_0 HTTP/1.1" 500 Internal Server Error agixt-main-agixt-1 | ERROR: Exception in ASGI application agixt-main-agixt-1 | Traceback (most recent call last): agixt-main-agixt-1 | File "/agixt/Providers.py", line 36, in init agixt-main-agixt-1 | self.instance = provider_class(kwargs) agixt-main-agixt-1 | File "/agixt/providers/openai.py", line 32, in init agixt-main-agixt-1 | self.stream = True if stream.lower() == "true" else False agixt-main-agixt-1 | AttributeError: 'bool' object has no attribute 'lower' agixt-main-agixt-1 | agixt-main-agixt-1 | The above exception was the direct cause of the following exception: agixt-main-agixt-1 | agixt-main-agixt-1 | Traceback (most recent call last): agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi agixt-main-agixt-1 | result = await app( # type: ignore[func-returns-value] agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call agixt-main-agixt-1 | return await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 276, in call agixt-main-agixt-1 | await super().call(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 122, in call agixt-main-agixt-1 | await self.middleware_stack(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call agixt-main-agixt-1 | raise exc agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call agixt-main-agixt-1 | await self.app(scope, receive, _send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 83, in call agixt-main-agixt-1 | await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call agixt-main-agixt-1 | raise exc agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call agixt-main-agixt-1 | await self.app(scope, receive, sender) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call agixt-main-agixt-1 | raise e agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call agixt-main-agixt-1 | await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 718, in call agixt-main-agixt-1 | await route.handle(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle agixt-main-agixt-1 | await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app agixt-main-agixt-1 | response = await func(request) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app agixt-main-agixt-1 | raw_response = await run_endpoint_function( agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function agixt-main-agixt-1 | return await dependant.call(values) agixt-main-agixt-1 | File "/agixt/app.py", line 395, in get_agentconfig agixt-main-agixt-1 | agent_config = Agent(agent_name=agent_name).get_agent_config() agixt-main-agixt-1 | File "/agixt/fb/Agent.py", line 125, in init agixt-main-agixt-1 | self.PROVIDER = Providers(self.AI_PROVIDER, self.PROVIDER_SETTINGS) agixt-main-agixt-1 | File "/agixt/Providers.py", line 42, in init agixt-main-agixt-1 | raise AttributeError(f"module {name} has no attribute {name}") from e agixt-main-agixt-1 | AttributeError: module Providers has no attribute openai agixt-main-agixt-1 | INFO: 172.19.0.3:43454 - "GET /api/agent HTTP/1.1" 200 OK agixt-main-agixt-1 | INFO: 172.19.0.3:43470 - "GET /api/agent HTTP/1.1" 200 OK agixt-main-agixt-1 | INFO: 172.19.0.3:43484 - "GET /api/agent/Llamacpp HTTP/1.1" 500 Internal Server Error agixt-main-agixt-1 | ERROR: Exception in ASGI application agixt-main-agixt-1 | Traceback (most recent call last): agixt-main-agixt-1 | File "/agixt/Providers.py", line 36, in init agixt-main-agixt-1 | self.instance = provider_class(kwargs) agixt-main-agixt-1 | File "/agixt/providers/openai.py", line 32, in init agixt-main-agixt-1 | self.stream = True if stream.lower() == "true" else False agixt-main-agixt-1 | AttributeError: 'bool' object has no attribute 'lower' agixt-main-agixt-1 | agixt-main-agixt-1 | The above exception was the direct cause of the following exception: agixt-main-agixt-1 | agixt-main-agixt-1 | Traceback (most recent call last): agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 435, in run_asgi agixt-main-agixt-1 | result = await app( # type: ignore[func-returns-value] agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call agixt-main-agixt-1 | return await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 276, in call agixt-main-agixt-1 | await super().call(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 122, in call agixt-main-agixt-1 | await self.middleware_stack(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in call agixt-main-agixt-1 | raise exc agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in call agixt-main-agixt-1 | await self.app(scope, receive, _send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 83, in call agixt-main-agixt-1 | await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in call agixt-main-agixt-1 | raise exc agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in call agixt-main-agixt-1 | await self.app(scope, receive, sender) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call agixt-main-agixt-1 | raise e agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call agixt-main-agixt-1 | await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 718, in call agixt-main-agixt-1 | await route.handle(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle agixt-main-agixt-1 | await self.app(scope, receive, send) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app agixt-main-agixt-1 | response = await func(request) agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 237, in app agixt-main-agixt-1 | raw_response = await run_endpoint_function( agixt-main-agixt-1 | File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 163, in run_endpoint_function agixt-main-agixt-1 | return await dependant.call(values) agixt-main-agixt-1 | File "/agixt/app.py", line 395, in get_agentconfig agixt-main-agixt-1 | agent_config = Agent(agent_name=agent_name).get_agent_config() agixt-main-agixt-1 | File "/agixt/fb/Agent.py", line 125, in init agixt-main-agixt-1 | self.PROVIDER = Providers(self.AI_PROVIDER, self.PROVIDER_SETTINGS) agixt-main-agixt-1 | File "/agixt/Providers.py", line 42, in init agixt-main-agixt-1 | raise AttributeError(f"module {name} has no attribute {name}") from e agixt-main-agixt-1 | AttributeError: module Providers has no attribute openai

Expected Behavior

Agent loaded

Operating System

Python Version

Environment Type - Connection

Runtime environment

Acknowledgements

sambickeita commented 1 year ago

Same error when I am loading starchat or gpt4free

Missing Submit Button

This form has no submit button, which means that user interactions will never be sent to your Streamlit app.

To create a submit button, use the st.form_submit_button() function.

For more information, refer to the documentation for forms.

Error loading agent configuration: 'str' object has no attribute 'pop'

Josh-XT commented 1 year ago

Updated OpenAI provider to fix this in both hubs.