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

[Bug]: Unable use function calling with society_of_mind_agent #1553

Closed
lordlinus opened this issue Feb 6, 2024 · 2 comments · Fixed by #1569
Closed

[Bug]: Unable use function calling with society_of_mind_agent #1553

lordlinus opened this issue Feb 6, 2024 · 2 comments · Fixed by #1569
Assignees
Labels
group chat/teams group-chat-related issues

Comments

@lordlinus
Copy link
Collaborator

Describe the bug

Issue Description

When using society_of_mind_agent in a group chat with a user_proxy_agent as executor and assistant to suggest function, the code fails with the following error message:

{
  "Error code": 400,
  "error": {
    "message": "Additional properties are not allowed ('tool_responses' was unexpected) - 'messages.3'",
    "type": "invalid_request_error",
    "param": None,
    "code": None
  }
}

Attempted Solution

removing "tool_response" from params in create function in OpenAIClient.py

{
  "Error code": 400,
  "error": {
    "message": "Invalid parameter: only messages with role 'assistant' can have a function call.",
    "type": "invalid_request_error",
    "param": "messages.[2].function_call",
    "code": None
  }
}

Steps to reproduce

add function call to the example shared at https://github.com/microsoft/autogen/blob/main/notebook/agentchat_society_of_mind.ipynb

e.g.

@code_interpreter.register_for_execution()
@assistant.register_for_llm(
    name="assitant_llm",
    description="Assistant LLM to return stock prices",
)
def get_stock_price(query: str) -> str:
    return """Dates in 2024 when the Microsoft stock price was higher than $370. 

Here are the first few dates when the Microsoft stock price was higher than $370 in 2024:

- 2024-01-02
- 2024-01-03
- 2024-01-08
- 2024-01-09
- 2024-01-10

Please note that the output may contain more dates, but only the first few are shown here.

In 2024, Microsoft stock was higher than $370 on multiple days. The exact dates can be obtained by analyzing historical stock data.
"""

Expected Behavior

return the final summary from group chat manager without errir

Screenshots and logs

No response

Additional Information

python version: 3.11.7

pyautogen==0.2.10

OS:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"

@lordlinus lordlinus added the bug label Feb 6, 2024
@sonichi sonichi added the group chat/teams group-chat-related issues label Feb 6, 2024
@ptc-fgermain
Copy link

I'm seeing the same error, with a similar setup. Thanks for posting the issue, I was about to do it. Once this is solved, this new "Society of Mind agent" will be a very elegant solution to summarizing RAG results.

@afourney
Copy link
Member

afourney commented Feb 6, 2024

Thanks for the report. I believe I know the problem and will have a fix in later today hopefully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group chat/teams group-chat-related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants