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

agent_id parameter for home assistant #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions programs/handle/home_assistant/bin/converse.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def main():
)
parser.add_argument("token_file", help="Path to file with authorization token")
parser.add_argument("--language", help="Language code to use")
parser.add_argument("--agent_id", help="ID of conversation agent. The conversation agent is the brains of the assistant. It processes the incoming text commands")
parser.add_argument(
"--debug", action="store_true", help="Print DEBUG messages to console"
)
Expand All @@ -31,6 +32,8 @@ def main():
data_dict = {"text": sys.stdin.read()}
if args.language:
data_dict["language"] = args.language
if args.agent_id:
data_dict["agent_id"] = args.agent_id

data = json.dumps(data_dict, ensure_ascii=False).encode("utf-8")
request = Request(args.url, data=data, headers=headers)
Expand Down
3 changes: 2 additions & 1 deletion rhasspy3/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,13 @@ programs:
# 2. Put long-lived access token in etc/token
home_assistant:
command: |
bin/converse.py --language "${language}" "${url}" "${token_file}"
bin/converse.py --language "${language}" --agent_id "${agent_id}" "${url}" "${token_file}"
adapter: |
handle_adapter_text.py
template_args:
url: "http://localhost:8123/api/conversation/process"
token_file: "${data_dir}/token"
agent_id: "homeassistant"
language: ""

# Intent only: answer English date/time requests
Expand Down