deepset-ai / haystack

:mag: AI orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
16.66k stars 1.83k forks source link

unknown variant `function`, expected one of `system`, `user`, `assistant`, `tool` #8194

Open springrain opened 1 month ago

springrain commented 1 month ago

Describe the bug unknown variant function, expected one of system, user, assistant, tool

Error message openai.UnprocessableEntityError: Failed to deserialize the JSON body into the target type: messages[1].role: unknown variant function, expected one of system, user, assistant, tool

FAQ Check

System:

Amnah199 commented 4 weeks ago

Hi @springrain, could you please provide more context around this error? Sharing the code snippet that's causing the issue would also be helpful.

lbux commented 4 weeks ago

Tools usage (which includes function calling) is not properly implemented into Haystack. The use of function is deprecated for OpenAI and ChatMessage does not yet support tool

Amnah199 commented 3 weeks ago

Thank you for the clarification. A PR (check it out) is currently open in the haystack-experimental to address this issue. Once it's finalized, you’ll be able to test it. If the implementation is successful, it will be integrated into Haystack in a future release.