Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reaching beyond entity_id, name and state in the prompt #256

Open
tomekwl opened this issue Sep 22, 2024 · 1 comment
Open

Reaching beyond entity_id, name and state in the prompt #256

tomekwl opened this issue Sep 22, 2024 · 1 comment

Comments

@tomekwl
Copy link

tomekwl commented Sep 22, 2024

I have an entity of a type water_hater. Currently with the example prompt the assistant is only aware of its state (in my example on or off). How can I make it aware and read more of the properties / attributes this type of entity carries? For example there is current_temperature.

@josh-blake
Copy link

josh-blake commented Nov 3, 2024

I use a spec function call to expose attributes to OpenAI on demand; I don’t need all attributes from every object exposed in my prompt (this consumes way too many tokens for generally unneeded information). Make sure your prompt exposes entities by listing an entity_id or modify the spec function to use whichever variable name you care to refer to your entities by.

- spec:
    name: get_attributes
    description: Get attributes of entity or multiple entities.
    parameters:
      type: object
      properties:
        entity_id:
          type: array
          description: entity_id of entity or multiple entities
          items:
            type: string
      required:
      - entity_id
  function:
    type: template
    value_template: >-
      ```csv
      entity,attributes
      {%for entity in entity_id%}
      {{entity}},{{states[entity].attributes}}
      {%endfor%}
      ``` 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants