You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If the chat history rendered in the template includes an "assistant" message that has tool_calls, if any call has arguments with an array, the parsing is done incorrectly, and is impossible to include this in the chat_history
This is the error I get when the call to Azure OpenAI is made:
'Error code: 400 - {\'error\': {\'message\': "Invalid parameter: messages with role \'tool\' must be a response to a preceeding message with \'tool_calls\'.", \'type\': \'invalid_request_error\', \'param\': \'messages.[3].role\', \'code\': None}}'
But the problem is not that the message is not in response to a previous one, but that the previous message is wrongly parsed and thus not correctly seen by ChatGPT.
this is the result of prompty.parse for the offending message:
As you can see the ## tool_calls: was not correctly parsed as the regex used failed with the ] in the text. It was sent as part of content instead as tool_calls array.
How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
define a tool that accepts an array and generate a prompt that makes the assistant decide to call it
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Running Information(please complete the following information):
Promptflow Package Version using pf -v: [e.g. 0.0.102309906]
Operating System: [e.g. Ubuntu 20.04, Windows 11]
Python Version using python --version: [e.g. python==3.10.12]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
If the chat history rendered in the template includes an "assistant" message that has tool_calls, if any call has arguments with an array, the parsing is done incorrectly, and is impossible to include this in the chat_history
This is the error I get when the call to Azure OpenAI is made:
But the problem is not that the message is not in response to a previous one, but that the previous message is wrongly parsed and thus not correctly seen by ChatGPT.
this is the result of prompty.parse for the offending message:
As you can see the
## tool_calls:
was not correctly parsed as the regex used failed with the]
in the text. It was sent as part ofcontent
instead astool_calls
array.How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Running Information(please complete the following information):
pf -v
: [e.g. 0.0.102309906]python --version
: [e.g. python==3.10.12]Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: