[BUG] parsing error when tool_calls has array in arguments #3829
Labels
bug
Something isn't working
no-recent-activity
There has been no recent activity on this issue/pull request
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: