VRSEN / agency-swarm

The only reliable agent framework built on top of the latest OpenAI Assistants API.
https://vrsen.github.io/agency-swarm/
MIT License
2.05k stars 537 forks source link

Bug in `Agent.init_oai` Method Prevents Assistants from Updating Correctly #126

Closed bonk1t closed 1 month ago

bonk1t commented 1 month ago

File: agency_swarm/agents/agent.py
Method: Agent.init_oai
Line: 180

Description

In the Agent.init_oai method, the _check_parameters method is called after the agent's attributes (such as instructions, name, description, etc.) have been updated. This results in the _check_parameters method always returning True, as it compares the updated attributes with themselves. Consequently, the assistant is never updated even when the parameters differ.

Impact

This issue prevents the assistant from being updated when its parameters change, potentially leading to outdated or incorrect assistant configurations being used.

Suggested Solution

To resolve this issue, the _check_parameters method should be called before updating the agent's attributes. This way, the method can correctly determine if the parameters have changed and update the assistant if necessary.