Skip to content

Multi Agent Code is giving errors #159

@ArpitaisAn0maly

Description

@ArpitaisAn0maly

Operating System

Windows

Version Information

azureai-samples/scenarios/Assistants/multi-agent/multi-agent.ipynb at main · Azure-Samples/azureai-samples · GitHub. I am getting an error message on last code block "thread = assistant_client.beta.threads.create()


user_message = input("User Query: ")
message = dispatch_message(user_message, user_proxy, thread)"


The error message is below:

"{
"name": "AttributeError",
"message": "'ImageFileContentBlock' object has no attribute 'text'",
"stack": "---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[48], line 5
3 # Initiate proxy agent and the main thread. This thread will remain active until the task is completed and will serve as the main communication thread between the other agents.
4 user_message = input("User Query: ")
----> 5 message = dispatch_message(user_message, user_proxy, thread)

Cell In[24], line 49, in dispatch_message(message, agent, thread)
47 # Assign the appropriate function to the agent for invocation.
48 function_to_call = available_functions[call.function.name]
---> 49 tool_response = function_to_call(**json.loads(call.function.arguments))
50 tool_responses.append({"tool_call_id": call.id, "output": tool_response})
52 # Present the outcomes produced by the tool.

Cell In[23], line 31, in send_message(query, agent_name)
28 recipient_info["thread"] = thread_object
30 # This function dispatches a message to the proper agent and it's thread
---> 31 return dispatch_message(query, recipient_info["agent"], recipient_info["thread"])

Cell In[24], line 65, in dispatch_message(message, agent, thread)
62 messages = assistant_client.beta.threads.messages.list(thread_id=thread.id)
64 # Transmit the response message back to the facilitating agent.
---> 65 return messages.data[0].content[0].text.value

File /workspaces/azureai-assistant-tool/.venv/lib/python3.12/site-packages/pydantic/main.py:892, in BaseModel.getattr(self, item)
889 return super().getattribute(item) # Raises AttributeError if appropriate
890 else:
891 # this is the current error
--> 892 raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}')

AttributeError: 'ImageFileContentBlock' object has no attribute 'text'"
}

Steps to reproduce

enter user query: " Generate an image of a boat drifting in the water and analyze it and enhance the image"

Expected behavior

Image should be generated

Actual behavior

error message above

Addition information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions