Skip to content

Commit

Permalink
Flip prompts to put user prompt on top (#118085)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed May 25, 2024
1 parent 69f237f commit 81f3387
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ async def async_process(

prompt = "\n".join(
(
api_prompt,
template.Template(
self.entry.options.get(CONF_PROMPT, DEFAULT_PROMPT), self.hass
).async_render(
Expand All @@ -233,6 +232,7 @@ async def async_process(
},
parse_result=False,
),
api_prompt,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ async def async_process(

prompt = "\n".join(
(
api_prompt,
template.Template(
options.get(CONF_PROMPT, DEFAULT_PROMPT), self.hass
).async_render(
Expand All @@ -150,6 +149,7 @@ async def async_process(
},
parse_result=False,
),
api_prompt,
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
'history': list([
dict({
'parts': '''
Only if the user wants to control a device, tell them to edit the AI configuration and allow access to Home Assistant.
Answer in plain text. Keep it simple and to the point.
Only if the user wants to control a device, tell them to edit the AI configuration and allow access to Home Assistant.
''',
'role': 'user',
}),
Expand Down Expand Up @@ -83,8 +83,8 @@
'history': list([
dict({
'parts': '''
Only if the user wants to control a device, tell them to edit the AI configuration and allow access to Home Assistant.
Answer in plain text. Keep it simple and to the point.
Only if the user wants to control a device, tell them to edit the AI configuration and allow access to Home Assistant.
''',
'role': 'user',
}),
Expand Down Expand Up @@ -136,8 +136,8 @@
'history': list([
dict({
'parts': '''
Call the intent tools to control Home Assistant. Just pass the name to the intent.
Answer in plain text. Keep it simple and to the point.
Call the intent tools to control Home Assistant. Just pass the name to the intent.
''',
'role': 'user',
}),
Expand Down Expand Up @@ -189,8 +189,8 @@
'history': list([
dict({
'parts': '''
Call the intent tools to control Home Assistant. Just pass the name to the intent.
Answer in plain text. Keep it simple and to the point.
Call the intent tools to control Home Assistant. Just pass the name to the intent.
''',
'role': 'user',
}),
Expand Down

0 comments on commit 81f3387

Please sign in to comment.