Skip to content
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

Assistants won't call functions, only User Proxy will #2392

Open
tyler-suard-parker opened this issue Apr 16, 2024 · 1 comment
Open

Assistants won't call functions, only User Proxy will #2392

tyler-suard-parker opened this issue Apr 16, 2024 · 1 comment
Labels
0.2 Issues which are related to the pre 0.4 codebase needs-triage tool-usage suggestion and execution of function/tool call

Comments

@tyler-suard-parker
Copy link
Contributor

tyler-suard-parker commented Apr 16, 2024

Describe the issue

Hello. I have one user proxy, with no functions registered to it. I have 3 different assistant agents, each one with their own functions registered. When I start my async chat, the user proxy sends a question to each of the assistant agents. The system prompt for each agent tells them to use a specific function to search on their own. Instead of doing that, each agent recommends a search function to the user proxy, which it of course does not have access to. How can I solve this issue? Using windows and GPT-4.

Steps to reproduce

self.user_proxy = autogen.UserProxyAgent(
name="user_proxy",
human_input_mode="NEVER",
max_consecutive_auto_reply=10,
is_termination_msg=self.is_termination_msg_func,
llm_config=self.llm_config_userproxy,
system_message="""End your last message with TERMINATE if the user's question has been answered at full satisfaction.
Otherwise, reply CONTINUE, with the reason why the task is not solved yet.
Please use CONTINUE sparingly, and only when you strongly feel that another search would retrieve more information that would
help answer the user's question.
DO NOT answer based on your own knowledge, ONLY answer using the data presented.
Remember, you may reply with TERMINATE, or CONTINUE with a reason why the task is not solved yet.
If an agent recommends a search to you, tell the agent to search themself, because you don't have access to any tunctions.""",
)

    if len(self.message_history) > 1:
        for message in self.message_history[:-1]:
            self.user_proxy.send(
                str(message), self.documents_searchbot, request_reply=False
            )
            self.user_proxy.send(
                str(message), self.pim_wcs_searchbot, request_reply=False
            )
            self.user_proxy.send(
                str(message), self.crossref_searchbot, request_reply=False
            )

    self.documents_searchbot.register_function(
        function_map={
            "docs_search": self.exec_product_docs_search,
        }
    )
    self.pim_wcs_searchbot.register_function(
        function_map={
            "pim_wcs_search": self.exec_pim_wcs_search,
        }
    )
    self.crossref_searchbot.register_function(
        function_map={
            "crossref_acs": self.exec_crossref_search,
        }
    )

async def run_agents(self):
    async with aiohttp.ClientSession() as self.session:

        agent_chat_start = time.time()

        chat_results = await self.user_proxy.a_initiate_chats(
            [
                {
                    "chat_id": 1,
                    "recipient": self.documents_searchbot,
                    "message": {"content": str(self.message_history[-1])},
                    "silent": False,
                    # "summary_method": "reflection_with_llm",
                },
                {
                    "chat_id": 2,
                    "recipient": self.pim_wcs_searchbot,
                    "message": {"content": str(self.message_history[-1])},
                    "silent": False,
                    # "summary_method": "reflection_with_llm",
                },
                {
                    "chat_id": 3,
                    "recipient": self.crossref_searchbot,
                    "message": {"content": str(self.message_history[-1])},
                    "silent": False,
                },
                # {
                #     "chat_id": 4,
                #     "prerequisites": [1, 2, 3],
                #     "recipient": self.user_proxy,
                #     "silent": False,
                #     "message": "",
                # },
            ]
        )

Screenshots and logs

2024-04-15 22_27_07-autogen_productgpt py - ParkerOpenAi-API-Latest - Visual Studio Code

Additional Information

No response

@sonichi
Copy link
Contributor

sonichi commented Apr 17, 2024

Sounds that you need agents like described in #2223
Let's see who will implement that first.

@qingyun-wu qingyun-wu added the tool-usage suggestion and execution of function/tool call label Jun 18, 2024
@rysweet rysweet added 0.2 Issues which are related to the pre 0.4 codebase needs-triage labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which are related to the pre 0.4 codebase needs-triage tool-usage suggestion and execution of function/tool call
Projects
None yet
Development

No branches or pull requests

4 participants