Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genesis stuck in ToolCreator loop #150

Open
phuzzled opened this issue Jun 19, 2024 · 6 comments
Open

Genesis stuck in ToolCreator loop #150

phuzzled opened this issue Jun 19, 2024 · 6 comments

Comments

@phuzzled
Copy link

Have just had a loop upon loop with user input experience.

Genesis creating a tool before experiencing no change to its approach and repeating the same over and over infinitum. It never actually works out its issue and just keeps saying it has tried a different approach (which is always the same exact approach that doesn't function).

`
Please make sure to now test this tool if possible.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
🐨 ToolCreator 🛠️ Executing Function
Function(arguments='{"agent_name":"BrandStrategist","chain_of_thought":"To re-test the InterviewTool, I will provide mock inputs for the client's name and interview questions. The tool should simulate asking the
questions and storing the responses, using a local dictionary to simulate the shared_state for testing purposes.","tool_name":"InterviewTool","arguments":"{"client_name":"John
Doe","interview_questions":["What is your unique value proposition?","What are your personal brand aspirations?"]}"}', name='TestTool', output=None)
What is your unique value proposition? I provide value
What are your personal brand aspirations? To have a working example
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
TestTool ⚙️ Function Output
Error: Error running tool InterviewTool: 'NoneType' object has no attribute 'set'
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
🐨 ToolCreator 🗣️ @AgentCreator
It seems the issue persists. The error indicates that the shared_state is still not being handled correctly. To resolve this, I'll ensure that the shared_state is properly managed within the tool's context.

                                                                       Step 5: Modify InterviewTool to Handle Shared State Correctly

I'll update the InterviewTool to ensure it uses a local dictionary to simulate the shared_state for testing purposes.

                                                                                  Updated Requirements for InterviewTool:

• Conduct in-depth client interviews to gather information about their unique value propositions and personal brand aspirations.
• Store and organize the interview data for further analysis.
• Use a local dictionary to simulate the shared_state for testing purposes.

Let's proceed with modifying the tool.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
🐨 ToolCreator 🛠️ Executing Function
Function(arguments='{"agent_name":"BrandStrategist","tool_name":"InterviewTool","requirements":"This tool will conduct in-depth client interviews to gather information about their unique value propositions and
personal brand aspirations. It should be able to store and organize the interview data for further analysis. Use a local dictionary to simulate the shared_state for testing purposes.","mode":"modify"}',
name='CreateTool', output=None)
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
CreateTool ⚙️ Function Output
Certainly! Below is the revised InterviewTool class that meets the specified requirements and uses a local dictionary to simulate the shared_state for testing purposes:

from agency_swarm.tools import BaseTool
from pydantic import Field
from typing import List, Dict

class InterviewTool(BaseTool):
"""
This tool will conduct in-depth client interviews to gather information about their unique value propositions and personal brand aspirations.
It should be able to store and organize the interview data for further analysis.
"""

 client_name: str = Field(
     ..., description="The name of the client being interviewed."
 )
 interview_questions: List[str] = Field(
     ..., description="A list of questions to ask the client during the interview."
 )
 interview_responses: Dict[str, str] = Field(
     default_factory=dict, description="A dictionary to store the client's responses to the interview questions."
 )

 # Simulate shared_state with a local dictionary
 shared_state: Dict[str, Dict] = {}

 def run(self):
     """
     Conducts the interview by asking each question and storing the responses.
     """
     for question in self.interview_questions:
         # Simulate asking the question and getting a response
         response = input(f"{question} ")
         self.interview_responses[question] = response

     # Organize the interview data for further analysis
     organized_data = {
         "client_name": self.client_name,
         "responses": self.interview_responses
     }

     # Store the organized data in the shared state for further analysis
     self.shared_state[f"{self.client_name}_interview_data"] = organized_data

     return f"Interview with {self.client_name} completed and data stored."

Example usage:

tool = InterviewTool(client_name="John Doe", interview_questions=["What is your unique value proposition?", "What are your personal brand aspirations?"])

tool.run()

In this version, the shared_state is simulated using a local dictionary within the InterviewTool class. This allows for testing the tool's functionality without relying on an external shared state mechanism. The
interview data is stored in this local dictionary for further analysis.

Please make sure to now test this tool if possible.
`

@phuzzled
Copy link
Author

image

@phuzzled
Copy link
Author

image

@VRSEN
Copy link
Owner

VRSEN commented Jun 27, 2024

I've had this issue a couple times even with more basic agents. I think it might be related to OpenAI API having issues from time to time, but I can add a response validator to prevent this in genesis

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity. Please upgrade to the latest version and test it again.

@github-actions github-actions bot added the stale label Jul 28, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale. If the issue still persists, please reopen.

@phuzzled
Copy link
Author

Came back and retried new scenario with latest build (as of 10/01/2025) and it still got stuck in the tool creation loop.

@bonk1t bonk1t reopened this Jan 11, 2025
@github-actions github-actions bot removed the stale label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants