HuggingChat integration

Hi everyone, I’ve just created an integration with HuggingChat allowing you to create a conversational agent like the OpenAI integration but without an API key and for free. All you need is a HuggingFace account and your login details.

I look forward to your comments :wink: !

2 Likes

It would be great if we could self host the server and be totally private.

I’m sorry but it’s not possible with this integration, but I can advise you to take a look at this post which explains how to have a voice assistant with LocalAI. However, you’ll get much poorer response time performance if you’re local.

I’d like to point out that HuggingFace doesn’t collect data (unless you want it to) from your cats and doesn’t communicate it.

Thank you for your comment and don’t hesitate to send me your suggestions!

1 Like

I would Absolutely love to use this integration, but keep running into a problem with my new home assistant installation of it saying I need HACS, As best as I can tell is a repository similar to git? Sorry, I’ve been staring in front of the computer all day so I’m mistaken in that my apologies… Anyways, any assistance or guidance you could give me would be much appreciated!!! I’m actually developing my own face assistant that I would like to integrate into this if at all possible, And I’ve seen that hugging faces for A home assistant 3, billion model, Making me even more interested in it!

is it possible to interact with HA identities ? (like [Custom Component] extended_openai_conversation: Let's control entities via ChatGPT - #140 by viperxeno)

At the moment, it’s not possible, but I’m trying to develop a new version based on the code of the extended_openai_conversation integration.

I can’t guarantee that this version will ever be released, but I very much hope so :wink:

1 Like

If you want to integrate my Home Assistant integration without HACS, you can do this command:
git clone https://github.com/PhoenixR49/hass-huggingchat-conversation
Then integrate the contents of the custom_components folder into the custom_components folder in your HA config.

If you have any other problems, or if my explanation doesn’t solve your problem, please let me know :grin:

I’ve just found a solution!
To control entities, you can use Home Assistant’s basic automation:

  • A trigger on a certain phrase (like “Play a jazz playlist”)
  • Add the actions you want (like playing music on a speaker)
  • Process the response with the conversation agent created by the HuggingChat integration then set the response on a variable (like “jarvis”)
  • Reply the response generated by HuggingChat’s AI.

Here’s a complete example of automation:

alias: "Assist: Play Jazz"
description: "Play a jazz playlist using Assist and HuggingChat."
trigger:
  - platform: conversation
    command:
      - "Play a jazz playlist"
condition:
  - condition: not
    conditions:
      - condition: or
        conditions:
          - condition: state
            entity_id: media_player.speaker
            state: unavailable
          - condition: state
            entity_id: media_player.speaker
            state: unknown
action:
  - service: spotcast.start
    data:
      entity_id: media_player.speaker
      uri: spotify:playlist:37i9dQZF1DX2vYju3i0lNX
    enabled: true
  - service: conversation.process
    metadata: {}
    data:
      agent_id: your_agent_id
      text: Play a jazz playlist on Spotify
    response_variable: jarvis
  - set_conversation_response: "{{ jarvis.response.speech.plain.speech }}"
mode: single

Enjoy

Can you kindly clarify how to use the integration after it’s downloaded via HACS?

1 Like

Once the integration has been installed via HACS, all you have to do is go to your integration settings and add a HuggingChat configuration by clicking on the “add integration” button.