Open matheusfvesco opened 1 month ago
This might be relevant for #7674
Also noticed the current ChatMessage and ChatRole classes (and therefore OpenAiFunctionCaller too) use "function" as the role for returning the function calls, but apparently "function" was deprecated on the openai spec, and will probably not be accepted by some providers
see: https://github.com/ollama/ollama/issues/6213#issuecomment-2273952121
But i also see you guys are already updating it with the tool abstraction :)
@matheusfvesco thanks for these detailed reports. Would you perhaps be open taking on implementation of the fix for this issue?
Describe the bug When using the OpenAIFunctionCaller from haystack experimental, if the return of the function includes special characters, these are not correctly parsed. This is important for some languages and also some models like gemma do enjoy using emojis.
Error message Example chat: Style: ChatMessage.role ChatMessage.content
The model calls a RAG pipeline, but the return is incorrectly parsed.
Expected behavior
Additional context I believe the problem is related to the json.dumps inside the OpenAiFunctionCaller class.
Example:
Output:
To Reproduce Make any function that returns a string with special characters and use the OpenAiFunctionCaller to handle it, or use the snippet above to test how json.dumps handles special characters. I believe the same thing is happening in this class.
FAQ Check
System: