Skip to content

Commit

Permalink
Register async human input handler (microsoft#794)
Browse files Browse the repository at this point in the history
* Update conversable_agent.py

* Add files via upload

* Delete notebook/Async_human_input.ipynb

* Add files via upload

* refactor:formatter

* feat:updated position

---------

Co-authored-by: Chi Wang <[email protected]>
  • Loading branch information
ShobhitVishnoi30 and sonichi authored Dec 3, 2023
1 parent a9dd2fe commit c2386bf
Show file tree
Hide file tree
Showing 4 changed files with 379 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autogen/agentchat/contrib/llava_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
)

assert self.llm_config is not None, "llm_config must be provided."
self.register_reply([Agent, None], reply_func=LLaVAAgent._image_reply, position=1)
self.register_reply([Agent, None], reply_func=LLaVAAgent._image_reply, position=2)

def _image_reply(self, messages=None, sender=None, config=None):
# Note: we did not use "llm_config" yet.
Expand Down
2 changes: 1 addition & 1 deletion autogen/agentchat/contrib/retrieve_user_proxy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def retrieve_docs(self, problem: str, n_results: int = 20, search_string: str =
self._is_termination_msg = (
self._is_termination_msg_retrievechat if is_termination_msg is None else is_termination_msg
)
self.register_reply(Agent, RetrieveUserProxyAgent._generate_retrieve_user_reply, position=1)
self.register_reply(Agent, RetrieveUserProxyAgent._generate_retrieve_user_reply, position=2)

def _is_termination_msg_retrievechat(self, message):
"""Check if a message is a termination message.
Expand Down
1 change: 1 addition & 0 deletions autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def __init__(
self.register_reply([Agent, None], ConversableAgent.generate_function_call_reply)
self.register_reply([Agent, None], ConversableAgent.generate_async_function_call_reply)
self.register_reply([Agent, None], ConversableAgent.check_termination_and_human_reply)
self.register_reply([Agent, None], ConversableAgent.a_check_termination_and_human_reply)

def register_reply(
self,
Expand Down
Loading

0 comments on commit c2386bf

Please sign in to comment.