-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_chatgpt_response.yaml
More file actions
61 lines (61 loc) · 1.43 KB
/
get_chatgpt_response.yaml
File metadata and controls
61 lines (61 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
alias: Get ChatGPT Response
fields:
prompt:
selector:
text: null
name: Prompt
required: true
language:
selector:
select:
options:
- nl
name: Language
required: true
default: nl
instruction:
selector:
text: {}
name: Instruction
required: false
default: >-
You are a voice assistant for Home Assistant. Answer in plain text. Keep
it simple and to the point.
model:
selector:
select:
options:
- chatgpt_3_5_turbo
- chatgpt_4o
- gpt_4o_mini
name: Model
required: true
default: chatgpt_3_5_turbo
sequence:
- variables:
agent_id: "{{ 'conversation.' + model }}"
instruction_language: |-
{% if language == 'nl' %}
{{ instruction + ' Answer in Dutch.' }}
{% endif %}
- metadata: {}
data:
value: "{{ instruction_language }}"
target:
entity_id: input_text.chat_gpt_instruction
action: input_text.set_value
- data:
agent_id: "{{ agent_id }}"
language: "{{ language }}"
text: "{{ prompt }}"
response_variable: agent
action: conversation.process
- variables:
success: |
{{ agent.response.response_type == 'action_done' }}
message: >
{{ {'success': success, 'message': agent.response.speech.plain.speech}
}}
- stop: returning message
response_variable: message
description: ""