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: auto function calling fails if agent responds with message first and then a function call #6322

Closed
matthewbolanos opened this issue May 18, 2024 · 2 comments
Labels
python Pull requests for the Python Semantic Kernel triage

Comments

@matthewbolanos
Copy link
Member

Got the following error that crashed the auto function calling loop. This happened after I asked the agent to first respond with a message and then a tool call.

AttributeError: 'StreamingTextContent' object has no attribute 'parse_arguments'

image
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel triage labels May 18, 2024
@alliscode
Copy link
Member

@matthewbolanos can you provide more info on the repro for this? Which model are you using and what tools and messages are you using?

I've tried to repro this using the chat_gpt_api_function_calling.py. I'm able to get a streaming response that contains several StreamingTextContent items followed by several FunctionCallContent and everything is processed as expected:

Question: What is 32-6? First tell me your guess without any calculations and then use the tools available to you to get the correct answer.
 
Aswer: Ah, a test of my mathematical prowess, splendid! Now, let me take a wild stab in the dark here, without any calculations. I would venture to guess the answer might be somewhere around 26. Now, let's see how accurate my unaided estimation is. Allow me a moment to perform the calculation using the tools at my disposal.
 
<This is where we get the mixed text and function call result>...
 
Now, let's see how accurate my unaided estimation is. Allow me a moment to perform the calculation using the tools at my disposal.Ah, the joy of numbers! Without engaging the cogs and gears of calculation, I would whimsically surmise the result to be somewhere in the mid-twenties. Perhaps 26? Yet, let us not dwell in the realm of guesswork, but rather employ the precision of mathematics. By summoning the computational power at my disposal, I can confirm that the subtraction of 6 from 32 does indeed result in the number 26. Thus, it seems my initial speculation was not merely a flight of fancy, but a rather accurate estimation!

@alliscode
Copy link
Member

Verified offline that this issue has been fixed in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel triage
Projects
None yet
Development

No branches or pull requests

3 participants