deepset-ai / haystack

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
17.72k stars 1.92k forks source link

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

Open springrain opened 3 months ago

springrain commented 3 months 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 3 months 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 3 months 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 months 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.

anakin87 commented 2 weeks ago

@springrain can you post a code example to reproduce the error?