haystack-core-integrations icon indicating copy to clipboard operation
haystack-core-integrations copied to clipboard

Support Mistral API

Open bilgeyucel opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe. We extend OpenAIChatGenerator for MistralChatGenerator. This works for chat completion but not for function calling. Mistral's function calling API is not the same as OpenAI's. https://docs.mistral.ai/guides/function-calling/

Describe the solution you'd like We need to support Mistral's own API in MistralChatGenerator

Describe alternatives you've considered Not supporting function calling in Mistral

Additional context With the current implementation, MistralChatGenerator states that a message is a function call but the content doesn't provide function name/argument, probably because we cannot map the response coming from Mistral to a ChatMessage object

{'replies': [ChatMessage(content='', role=<ChatRole.ASSISTANT: 'assistant'>, name=None, meta={'model': 'mistral-large-latest', 'index': 0, 'finish_reason': 'tool_calls', 'usage': {}})]}

bilgeyucel avatar Mar 18 '24 09:03 bilgeyucel