Skip to content

User873902/PaLM_Response

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant PaLM Response Sensor

This is a non-working custom component for Home Assistant intended to allow generation of text responses using Google's PaLM API. PaLM API allows access to the advanced capabilities of Google’s large language models like PaLM 2.

Join the waitlist for the public preview to get your API key via MakerSuite.

Development was discontinued secondary to the successful implementation of service call responses in 2023.7, specifically the conversation.process service. This service allows you to ask Assist a command or question, and get a response back. "In the morning, you could ask Home Assistant for todays calendar events, add things like weather information, send it to ChatGPT (or PaLM) using the conversation proceess and ask it to summerize it, and send a notification to your phone with the result."

The PaLM Response Sensor project was built parallel to openai_response by Hassassistant. Please contribute as able.

Installation

  1. Add the repository to HACS

  2. Add the following lines to your Home Assistant configuration.yaml file:

sensor:
  - platform: palm_response
    api_key: YOUR_PALM_API_KEY
    model: "models/chat-bison-001" # Optional, defaults to "models/chat-bison-001"
    name: "palm_response" # Optional, defaults to "palm_response"

Replace YOUR_PALM_API_KEY with your actual MakerSuite PaLM API key.

  1. Create an input_text.palm_input entity in Home Assistant to serve as the input for the PaLM model. Create this input_text via the device helpers page or add the following lines to your configuration.yaml file:
input_text:
  palm_input:
    name: PaLM Input
  1. Restart Home Assistant

Usage

To generate a response from PaLM, update the input_text.palm_input entity with the text you want to send to the model. The generated response will be available as an attribute of the sensor.palm_response entity.

Frontend

Add the following to your ui-lovelace.yaml file or create a card in the Lovelace UI:

type: grid
square: false
columns: 1
cards:
  - type: entities
    entities:
      - entity: input_text.palm_input
  - type: markdown
    content: '{{ state_attr(''sensor.palm_response'', ''chat_response'') }}'
    title: PaLM Response

Now you can type your text in the PaLM Input field, and the generated response will be displayed in the response card.

About

Home Assistant PaLM Response Sensor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages