AdieLaine / multi-agent-reasoning

The Multi-Agent Reasoning framework creates an interactive chatbot where AI agents collaborate via structured reasoning and Swarm Integration for optimal answers. Simulating a team that discusses, debates, and refines responses, it enables complex problem-solving and precise results. Now with Prompt Caching to reduce latency and costs.
MIT License
134 stars 23 forks source link

AttributeError in Agent Chat System: 'PromptTokensDetails' object has no attribute 'get' #2

Closed alexmanner closed 1 month ago

alexmanner commented 1 month ago

Description: When attempting to chat with agents (Agent 47 and Agent 74) in the Multi-Agent Reasoning Chatbot, the following error repeatedly occurs:

AttributeError: 'PromptTokensDetails' object has no attribute 'get'

The issue persists across multiple agents, and the system retries the request several times before eventually reaching the maximum retry limit. The error prevents generating a response from the agents.

Steps to Reproduce:

Start the chatbot and select an agent (Agent 47 or Agent 74).
Enter a message, such as "how are you."
Observe the error in the logs, showing the AttributeError.

Expected Behavior: The agents should respond to the message as expected without encountering any errors.

Actual Behavior: The system encounters an AttributeError in the token handling process, and no response is generated from the agents.

Environment:

macOS
Multi-Agent Reasoning Chatbot
Error occurs for both Agent 47 and Agent 74
alexmanner commented 1 month ago

The script reasoning.py was executed successfully, but it encountered an issue when attempting to chat with "Agent 47". The error indicates that there is an AttributeError related to the PromptTokensDetails object, which suggests there may be a bug in the script where it tries to access a non-existent get attribute. This caused repeated failed retries when communicating.

To resolve this, you may want to review the part of the code that handles interaction with agents, especially where PromptTokensDetails is used. Ensure the correct methods or attributes are available and used correctly. Debugging this code section or checking the documentation or source for PromptTokensDetails could also provide insights.

alexmanner commented 1 month ago

The error is indepent of the prompts I use.

"python reasoning.py Successfully loaded agents configuration from 'agents.json'. Available agents:

AdieLaine commented 1 month ago
Screenshot 2024-10-13 at 4 13 43 PM

Using both agents with a minimal greeting is not reproducing this error.

Please run in a fresh terminal, a prompt of: Hello how are you?

AdieLaine commented 1 month ago

Issue not reproducible when run using current code version. Please update local defined script imports. If error persist, reopen.