-
Notifications
You must be signed in to change notification settings - Fork 201
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]: Reopen: Missing Tool Tutputs error when using Azure OpenAI Assistants, when the Assistant planner calls the same tool multiple times in a run #1705 #2154
Comments
This is my analysis of the problem and fix. Pardon the verbosity.I have found the problem, it was being triggered when the same tool was being called more than once. The Teams AI library contains a dictionary of tools being called I have fixed it but I don't know how to submit the actual fix to the correct repository, or the protocol. Also, I fixed this scenario but did not explore any kind of impact anywhere else, testing included. Current tests should pass though, because functionality was not changed. The fix consists on changing a variable from containing a list of calls
Fix in two places: This is the before and after exported as a git diff. Not certain if this is the best way to pass this info though.
|
Thanks for deep diving into the issue. We've added this to the backlog and will be tackling it soon. Looks like you have a fix for this so feel free to open a PR if you want. |
closing as duplicate with #1705 |
@lilyydu, could you explain the rationale behind 'not planned' if possible? This is a bug that prevents multiple calls to the same tool from the AI with no workaround. For example, not being able to run EDIT: Added example. |
@andres-swax GH groups the tag as "not planned" but this includes "marking as duplicate ticket". We are still addressing this issue via #1705 (#2154 (comment)) |
😬😖😊 so very sorry, saw the other one as closed as well. Not familiar with GH procedures/etiquette my bad. |
no worries at all, the wording is quite confusing! the other issue is open & in progress now |
Language
Python
Version
1.4.1 and previous
Description
I wrote this as a comment on the original report (https://github.com/microsoft/teams-ai/issues/1705 closed already due to inactivity). I am reproducing here my resolution which involves making changes to TTK.AI.
I experienced this ever since I started working with the Assistants version of the template...and hoped the issue would just go away [yeah, right]. Versions of the conversation such as:
Where should I go this weekend, Los Angeles or Las Vegas? I prefer warm weather.
or something like this which would trigger this scenario.This is an example of the errors I get. Notice that the error is shown 3 times, I suppose while the exception bubbles up. None of the text below is mine or my code's:
The error 400 from the LLM states that it received the return value of call 1 with the correct call ID but the LLM is expecting the results of BOTH tool calls on the same response, so it throws a HTTP error 400
Reproduction Steps
Create an assistant on Azure AI Studio -> Assistants Playground, following the source code for the Assistants sample (I would need to search how I found it - I think it is on the current as of 2024/10/20 version of the Teams AI Assistants documentation). I am pasting the complete code of the assistant definition at the end of this post.
Create a simple sample app from Teams Toolit [TTK version 5.10 current as of 2024/10/28] as follows:
Teams Toolkit -> New Project -> Custom Engine Agent -> AI Agent -> Build with Assistants API (Preview) -> Python
.Once the assistant is running test it by asking for
3a. something that will trigger two calls to different sequential tools. It runs them one after the other so the output of one becomes the input of another. It will work. Example:
USER
Give me the weather of the city nicknamed The Golden City
--- Tool call to getNickname(The Golden City) --> tool returns to LLM San Francisco
--- Tool call to getWeather(San Francisco) --> tool returns to LLM 44 C
LLM for example
San Francisco is a little warm today, it is 44 degrees Celsius
3b. something that will triger two simultaneous calls to the same tool where no input is dependent on the output of another call. The stack trace and error message make clear that they were called in parallel. It will fail. 100% repeatable:
USER
Give me the name of both cites nicknamed Sin City and The Golden City
. There will be one POST from the LLM to the tool, with an array of calls, one for each parameter (city in this case). This means one Run, two Calls I believe.Python / tool implementation:
--- Tool call to getNickname(Sin City) --> tool returns a proper response
--- Tool call to getNickname(The Golden City) --> Tool executes but response never goes back to the LLM.
LLM
Error 400
.----- From this point forward, the Teams agent (or the Bot?) will not reply to any requests/posts so it seems mute, stunned or just dead until the run that triggered this 400 error expires, then it may or may not process the other accumulated inputs I supposed based on whether they have expired or not.
Another example:
How is the weather in both Vegas and San Francisco?
, triggers the same problem.Code for the Assistant definition, copied from the Asistants Playground on Azure AI Studio:
Code for the tool implementations (called from the LLM)
EDIT 5 mins later: Formatting and fixing the second sample prompt that triggers an error
The text was updated successfully, but these errors were encountered: