async-openai
async-openai copied to clipboard
Make `ChatCompletionMessageToolCall` compatible with Mistral API
This PR modifies the chat types, specifically the ChatCompletionMessageToolCall struct, to make it compatible with the Mistral API. Mistral does not specify the type when it calls a function, but OpenAI always does. Unfortunately, this change is breaking. I don't quite understand why this example outputs show the type function but my tests with the mistral-saba-latest model don't.
About the diff, I had some issues with carriage returns \r. I don't understand why my editors (Zed, nano, Sublime Text) are not supporting them correctly. So, let me know if you don't plan to accept the changes as is, and I'll spend some time fixing it. The only line that actually changes is line 396.
Now that I have considered this PR a bit more, I wonder if it wouldn't be better to implement Default on ChatCompletionToolType and make ChatCompletionToolType::Function the default value.