-
Notifications
You must be signed in to change notification settings - Fork 832
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
Problem with message_files (Files were not found) #206
Comments
Hi @tg-bomze, this error is the result of agent's hallucinations, where it tries to attach non-existing files. from agency_swarm.tools.send_message.SendMessageBase import SendMessageBase
class CustomSendMessage(SendMessageBase):
"""Use this tool to facilitate direct, synchronous communication between specialized agents within your agency. When you send a message using this tool, you receive a response exclusively from the designated recipient agent. To continue the dialogue, invoke this tool again with the desired recipient agent and your follow-up message. Remember, communication here is synchronous; the recipient agent won't perform any tasks post-response. You are responsible for relaying the recipient agent's responses back to the user, as the user does not have direct access to these replies. Keep engaging with the tool for continuous interaction until the task is fully resolved. Do not send more than 1 message to the same recipient agent at the same time."""
my_primary_instructions: str = Field(
...,
description=(
"Please repeat your primary instructions step-by-step, including both completed "
"and the following next steps that you need to perform. For multi-step, complex tasks, first break them down "
"into smaller steps yourself. Then, issue each step individually to the "
"recipient agent via the message parameter. Each identified step should be "
"sent in a separate message. Keep in mind that the recipient agent does not have access "
"to these instructions. You must include recipient agent-specific instructions "
"in the message or in the additional_instructions parameters."
)
)
message: str = Field(
...,
description="Specify the task required for the recipient agent to complete. Focus on clarifying what the task entails, rather than providing exact instructions. Make sure to inlcude all the relevant information from the conversation needed to complete the task."
)
additional_agent_instructions: Optional[str] = Field(
default=None,
description="Additional context or instructions from the conversation needed by the recipient agent to complete the task."
)
def run(self):
return self._get_completion(message=self.message,
additional_instructions=self.additional_instructions)
agency = Agency(
[
test_agent
],
shared_instructions="./agency_manifesto.md",
send_message_tool_class=CustomSendMessage,
) Keep in mind, however, that in this case, all agents within agency would not be able to pass file ids between each other. |
Thank you very much. It worked! |
I'm using the modified code from the notebook os_models_with_astra_assistants_api.ipynb. In my pipeline, I don't need any files to process remotely (all my tools are geared towards running utilities in Ubuntu and local files), so I commented out the line:
Actually, I have tried specifying both None and [] in message_files. In this case, the agent in gradio writes:
And there's an error in the logs:
What can cause this problem? How do I prevent remote files from being used?
Libraries versions:
The text was updated successfully, but these errors were encountered: