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

Python: Fix openai assistant function calling bug #8817

Merged

Conversation

moonbox3
Copy link
Contributor

Motivation and Context

We weren't properly handling the available FunctionResultContent in an OpenAI assistant if multiple tool calls were included in the chat history.

Description

Fix this issue by making sure we use the function call contents list as the source of truth (the model is expecting that we return the tool call ids that were sent). We then use these function call content ids to grab the corresponding function result content from the chat history and this is sent back to the model.

Contribution Checklist

@moonbox3 moonbox3 self-assigned this Sep 16, 2024
@moonbox3 moonbox3 requested a review from a team as a code owner September 16, 2024 16:46
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Sep 16, 2024
@moonbox3 moonbox3 added this pull request to the merge queue Sep 16, 2024
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Sep 16, 2024

Python Unit Test Overview

Tests Skipped Failures Errors Time
2431 1 💤 0 ❌ 0 🔥 56.406s ⏱️

Merged via the queue into microsoft:main with commit db0faca Sep 16, 2024
25 checks passed
@moonbox3 moonbox3 deleted the fix_openai_assistant_format_tool_output branch September 16, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agents python Pull requests for the Python Semantic Kernel
Projects
Status: Sprint: Done
Development

Successfully merging this pull request may close these issues.

Python: Bug: OpenAI Assistants Bad Request Error Expected tool outputs for call_ids
4 participants