-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jekalmin
committed
Jan 19, 2024
1 parent
cbb4b3f
commit 7d6efa5
Showing
5 changed files
with
124 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
|
||
## Objective | ||
- Call service via area_id | ||
|
||
<img width="300" src="https://github.com/jekalmin/extended_openai_conversation/assets/2917984/78a5c829-a6b4-4f76-8c68-9fe0ccdca2e8"> | ||
|
||
|
||
## Function | ||
|
||
### get_attributes | ||
```yaml | ||
- spec: | ||
name: execute_services | ||
description: Execute service of devices in Home Assistant. | ||
parameters: | ||
type: object | ||
properties: | ||
list: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
domain: | ||
type: string | ||
description: The domain of the service. | ||
service: | ||
type: string | ||
description: The service to be called | ||
service_data: | ||
type: object | ||
description: The service data object to indicate what to control. | ||
properties: | ||
entity_id: | ||
type: array | ||
items: | ||
type: string | ||
description: The entity_id retrieved from available devices. It must start with domain, followed by dot character. | ||
area_id: | ||
type: array | ||
items: | ||
type: string | ||
description: The id retrieved from areas. You can specify only area_id without entity_id to act on all entities in that area | ||
required: | ||
- domain | ||
- service | ||
- service_data | ||
function: | ||
type: native | ||
name: execute_service | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Objective | ||
- Search from Google | ||
|
||
## Prerequisite | ||
Needs Google API Key | ||
|
||
## Function | ||
|
||
### search_google | ||
|
||
```yaml | ||
- spec: | ||
name: search_google | ||
description: Search Google using the Custom Search API. | ||
parameters: | ||
type: object | ||
properties: | ||
query: | ||
type: string | ||
description: The search query. | ||
required: | ||
- query | ||
function: | ||
type: rest | ||
resource_template: "https://www.googleapis.com/customsearch/v1?key=[GOOGLE_API_KEY]&cx=[GOOGLE_PROGRAMMING_SEARCH_ENGINE]:omuauf_lfve&q={{ query }}&num=3" | ||
value_template: >- | ||
{% if value_json.items %} | ||
```csv | ||
title,link | ||
{% for item in value_json.items %} | ||
"{{ item.title | replace(',', ' ') }}","{{ item.link }}" | ||
{% endfor %} | ||
``` | ||
{% else %} | ||
No results found, | ||
{% endif %} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Objective | ||
- Get current weather and forecasts | ||
|
||
<img width="300" src="https://github.com/jekalmin/extended_openai_conversation/assets/2917984/177f416e-2194-4a10-a3f6-39a94da942ce"> | ||
<img width="300" src="https://github.com/jekalmin/extended_openai_conversation/assets/2917984/3c861f37-3654-4f6b-bcbf-554f12189051"> | ||
|
||
## Prerequisite | ||
Expose `weather.xxxxx` entity | ||
|
||
## Function | ||
|
||
### get_attributes | ||
```yaml | ||
- spec: | ||
name: get_attributes | ||
description: Get attributes of any home assistant entity | ||
parameters: | ||
type: object | ||
properties: | ||
entity_id: | ||
type: string | ||
description: entity_id | ||
required: | ||
- entity_id | ||
function: | ||
type: template | ||
value_template: "{{states[entity_id]}}" | ||
``` |