Mistral AI API - Custom Integration

I did most of it myself. I asked mistral small parts on how to do very specific things. Most of the time the result was inaccurate though as I think that model wasn’t trained with recent changes to home assistants code-base. Though, I also didn’t use codestral… maybe the result would have been better with the codestral model.

Currently I am struggling with how I could get function calling flexible enough for end-users to easily implement it. Function calling itself seems to be pretty easy to implement, but I would like for it to be as simple as possible for end-users to use it… but I am pretty sure that would still require people to at least perform two steps:

  1. Create a file where functions are described
  2. Implement the function in Python

I could add some generic functions ready for re-use, but the true power of function-calling will only happen when feeding the ai with your custom use-cases and sensor info.

I’m sure I could get function calling itself done pretty easily in a basic version. Can’t wait to try it. Due to the current holidays I don’t have as much time to develop it though

Just invested some time and realized that function calls are possible for sure, but I can’t figure out a generic way to handle em to be comfortable for home assistant users without them having to modify the code.

I’ll prepare the code-base to be able to support function calls, but the actual implementation will have to be done by the user.

Bummer, but maybe we can figure out a more flexible way over time.

I also noticed just now that mistral ai got their own ready-to-use python lib, still, I don’t see a reason to switch right now.

Hi,

awsome integration.
Can you use the integration to generate AI images for download, similar to action openai_conversation.generate_image from the OpenAI integration?

Thanks,

Thomas

1 Like

Hello there, I’m quite interested into having Mistral as an available assistant. I would like to use it along the Home Assistant Voice. I like Mistral is quite fast and it’s European. Is there any way I can help you with the development @BlaXun?

6 Likes

I’m interested too

or

openai-compatible-conversation with the changes from this issue that I made for myself

1 Like

I have compiled my edits into a separate fork, since I prefer to use the existing openAI system package rather than installing another one
I have also added an image recognition service openai_compatible_conversation.mistral_vision and a search agent openai_compatible_conversation.web_search for Mistral.

1 Like

Anything happening with this?

I’ve managed to use Mistral models with Home Assistant Assist using this HACS repo: GitHub - michelle-avery/custom-conversation: A very customizable version of a Conversation Agent for Home Assistant

same, works great. Also LLM Vision works well, one minor change needed there as the Mistral AI implementation of the OpenAI API protocol is slightly off

I switched to GitHub - SnarfNL/HA_MistralAI: Home Assistant custom integration — Mistral AI as conversation agent and Voxtral as speech-to-text engine. ⚠️ Please note this is not an officially supported integration and is not affiliated with Mistral AI in any way. · GitHub and it has been an absolute blast.

Hello,

I actually use the custom integration Extended OpenAI Conversation : https://github.com/jekalmin/extended_openai_conversation.
It’s very powerfull with the “functions” .

Do you know if any of the custom integration listed in this topic offer the same functionality ?

Thanks.