Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
577145e
fix generate reply for single message
priyansh4320 Sep 4, 2025
43f50bb
test: generate_reply() with dict[str,Any]
priyansh4320 Sep 4, 2025
ccf62fd
[skip ci] docs: fix outdated docs
joggrbot[bot] Sep 4, 2025
be37c86
fix: pre-commit
priyansh4320 Sep 5, 2025
86bf78b
fix: send(),a_send() handles list[messages]
priyansh4320 Sep 5, 2025
8b24066
fix: recieve(), a_recieve() handles list[messages]
priyansh4320 Sep 5, 2025
ecf3f80
fix: _process_messages_before_send() handles list[messages]
priyansh4320 Sep 5, 2025
6ceee7f
test: list[messages] on changed function
priyansh4320 Sep 5, 2025
15ad31f
fix: send(),a_send(),_process_message_before_send() handle list[messa…
priyansh4320 Sep 9, 2025
8807662
fix: recieve,a_recieve for list[messages]
priyansh4320 Sep 9, 2025
55afd58
[skip ci] docs: fix outdated docs
joggrbot[bot] Sep 4, 2025
4b3cd6c
fix: pre-commit
priyansh4320 Sep 5, 2025
bba855f
fix: add backward compatibility tests
priyansh4320 Sep 27, 2025
817dc87
fix: RandomPattern Handoff Error
priyansh4320 Sep 27, 2025
2f0e2c5
fix: tests
priyansh4320 Sep 27, 2025
bf47608
fix some tests
priyansh4320 Sep 27, 2025
06f741b
fix: tests
priyansh4320 Sep 28, 2025
7de9215
fix: conversable agent tests
priyansh4320 Sep 28, 2025
ecb2d3d
fix: nested chats
priyansh4320 Sep 28, 2025
28ecf29
fix:test interoperability
priyansh4320 Sep 28, 2025
a731349
fix: update tool registry with tool signature
priyansh4320 Oct 1, 2025
e656dbd
fix: tavily tests
priyansh4320 Oct 1, 2025
23751d4
test: [sync/async] run , run_group_chat
priyansh4320 Oct 1, 2025
56d5bbc
fix:tests
priyansh4320 Oct 1, 2025
ba14cf6
fix: minor fix
priyansh4320 Oct 2, 2025
6c5d852
Document: Update message= to list[messages]
priyansh4320 Oct 2, 2025
eb9a7bf
fix: mypy
priyansh4320 Oct 2, 2025
3dcdca0
documentation: fix notebooks for list[messages]
priyansh4320 Oct 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ assistant = AssistantAgent("assistant", llm_config=llm_config)

user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False})

user_proxy.run(assistant, message="Summarize the main differences between Python lists and tuples.").process()
user_proxy.run(assistant, message=[{"content":"Summarize the main differences between Python lists and tuples.","role":"user"}]).process()
```

## Example applications
Expand Down Expand Up @@ -177,7 +177,7 @@ reviewer = ConversableAgent(
# Start a conversation
response = reviewer.run(
recipient=coder,
message="Write a Python function that computes Fibonacci numbers.",
message=[{"content":"Write a Python function that computes Fibonacci numbers.","role":"user"}],
max_turns=10
)

Expand Down Expand Up @@ -365,7 +365,7 @@ register_function(
# Use tool in chat
chat_result = executor_agent.initiate_chat(
recipient=date_agent,
message="I was born on 1995-03-25, what day was it?",
message=[{"content":"I was born on 1995-03-25, what day was it?","role":"user"}],
max_turns=2,
)

Expand Down
28 changes: 16 additions & 12 deletions autogen/agentchat/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def description(self) -> str:

def send(
self,
message: dict[str, Any] | str,
message: list[dict[str, Any]] | str,
recipient: "Agent",
request_reply: bool | None = None,
) -> None:
"""Send a message to another agent.

Args:
message (dict or str): the message to send. If a dict, it should be
message (list[dict[str, Any]] or str): the message to send. If a list of messages, it should be
a JSON-serializable and follows the OpenAI's ChatCompletion schema.
recipient (Agent): the recipient of the message.
request_reply (bool): whether to request a reply from the recipient.
Expand All @@ -56,14 +56,14 @@ def send(

async def a_send(
self,
message: dict[str, Any] | str,
message: list[dict[str, Any]] | str,
recipient: "Agent",
request_reply: bool | None = None,
) -> None:
"""(Async) Send a message to another agent.

Args:
message (dict or str): the message to send. If a dict, it should be
message (list[messages] or str): the message to send. If a list of messages, it should be
a JSON-serializable and follows the OpenAI's ChatCompletion schema.
recipient (Agent): the recipient of the message.
request_reply (bool): whether to request a reply from the recipient.
Expand All @@ -72,45 +72,49 @@ async def a_send(

def receive(
self,
message: dict[str, Any] | str,
message: list[dict[str, Any]],
sender: "Agent",
request_reply: bool | None = None,
silent: bool | None = False,
) -> None:
"""Receive a message from another agent.

Args:
message (dict or str): the message received. If a dict, it should be
message (list[messages]): the list[messages] received. If a list of messages, it should be
a JSON-serializable and follows the OpenAI's ChatCompletion schema.
sender (Agent): the sender of the message.
request_reply (bool): whether the sender requests a reply.
silent (bool): whether to print the message received.
"""

async def a_receive(
self,
message: dict[str, Any] | str,
message: list[dict[str, Any]],
sender: "Agent",
request_reply: bool | None = None,
silent: bool | None = False,
) -> None:
"""(Async) Receive a message from another agent.

Args:
message (dict or str): the message received. If a dict, it should be
message (list[messages]): the list[messages] received. If a list of messages, it should be
a JSON-serializable and follows the OpenAI's ChatCompletion schema.
sender (Agent): the sender of the message.
request_reply (bool): whether the sender requests a reply.
silent (bool): whether to print the message received.
"""
...

def generate_reply(
self,
messages: list[dict[str, Any]] | None = None,
messages: list[dict[str, Any]] | dict[str, Any] | None = None,
sender: Optional["Agent"] = None,
**kwargs: Any,
) -> str | dict[str, Any] | None:
"""Generate a reply based on the received messages.

Args:
messages (list[dict[str, Any]]): a list of messages received from other agents.
messages (list[dict[str, Any]] or dict[str, Any]): a list of messages received from other agents. can be a single message.
The messages are dictionaries that are JSON-serializable and
follows the OpenAI's ChatCompletion schema.
sender: sender of an Agent instance.
Expand All @@ -122,14 +126,14 @@ def generate_reply(

async def a_generate_reply(
self,
messages: list[dict[str, Any]] | None = None,
messages: list[dict[str, Any]] | dict[str, Any] | None = None,
sender: Optional["Agent"] = None,
**kwargs: Any,
) -> str | dict[str, Any] | None:
"""(Async) Generate a reply based on the received messages.

Args:
messages (list[dict[str, Any]]): a list of messages received from other agents.
messages (list[dict[str, Any]] or dict[str, Any]): a list of messages received from other agents. can be a single message.
The messages are dictionaries that are JSON-serializable and
follows the OpenAI's ChatCompletion schema.
sender: sender of an Agent instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class GraphRagCapability(AgentCapability):
is_termination_msg=lambda msg: "TERMINATE" in msg["content"],
human_input_mode="ALWAYS",
)
user_proxy.initiate_chat(graph_rag_agent, message="Name a few actors who've played in 'The Matrix'")
user_proxy.initiate_chat(graph_rag_agent, message=[{"content":"Name a few actors who've played in 'The Matrix'","role":"user"}])

# ChatResult(
# chat_id=uuid.uuid4().int,
Expand Down
Loading
Loading