Skip to content

Commit

Permalink
add agent notebook and documentation (microsoft#1052)
Browse files Browse the repository at this point in the history
* add agent notebook and documentation

* fix bug

* set flush to True when printing msg in agent

* add a math problem in agent notebook

* remove

* header

* improve notebook doc

* notebook update

* improve notebook example

* improve doc

* improve notebook doc

* improve print

* doc

* human_input_mode

* human_input_mode str

* indent

* indent

* Update flaml/autogen/agent/user_proxy_agent.py

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update notebook/autogen_agent.ipynb

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update notebook/autogen_agent.ipynb

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* Update notebook/autogen_agent.ipynb

Co-authored-by: Chi Wang <wang.chi@microsoft.com>

* renaming and doc format

* typo

---------

Co-authored-by: Chi Wang <wang.chi@microsoft.com>
  • Loading branch information
qingyun-wu and sonichi committed May 28, 2023
1 parent c3381c0 commit 7551d18
Show file tree
Hide file tree
Showing 4 changed files with 718 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flaml/autogen/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ def _send(self, message, recipient):

def _receive(self, message, sender):
"""Receive a message from another agent."""
print("\n****", self.name, "received message from", sender.name, "****\n")
print(message)
print("\n****", self.name, "received message from", sender.name, "****\n", flush=True)
print(message, flush=True)
self._conversations[sender.name].append({"content": message, "role": "user"})

def receive(self, message, sender):
Expand Down
1 change: 1 addition & 0 deletions flaml/autogen/agent/user_proxy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,5 @@ def receive(self, message, sender):
return

self._consecutive_auto_reply_counter[sender.name] += 1
print("\n>>>>>>>> NO HUMAN INPUT RECEIVED. USING AUTO REPLY FOR THE USER...", flush=True)
self.auto_reply(message, sender, default_reply=reply)
Loading

0 comments on commit 7551d18

Please sign in to comment.