jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
834 stars 108 forks source link

Notify function for any device/messenger #187

Open jleinenbach opened 3 months ago

jleinenbach commented 3 months ago

This is my version of the notify function. It is tested with GPT 4. Just tell which entity should be notified. (Disclaimer: With great power comes great responsibility. More capabilities for ChatGPT also mean a higher security risk if an unknown person gains access to it.)

- spec:
    name: send_message_to_messenger
    description: Use this function to send messages to a messenger.
    parameters:
      type: object
      properties:
        service_name:
          type: string
          description: The specific notify service to use, dynamically set at runtime.
        message:
          type: string
          description: The message you want to send.
        title:
          type: string
          optional: true
          description: The title of the notification, if applicable.
        target:
          type: array
          items:
            type: string
          optional: true
          description: The recipient that will receive the notification. It's platform specific.
        data:
          type: object
          optional: true
          description: Additional data for extended functionality, it's platform specific.
      required:
      - service_name
      - message
  function:
    type: script
    sequence:
    - service: "{{ service_name }}"
      data:
        message: "{{ message }}"
        title: "{{ title | default('') }}"
        target: "{{ target | default([]) }}"
jleinenbach commented 1 month ago

I don't know if this has something to do with ChatGPT 4, but with GPT 3.5 this does not work for me.