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

feat: Attach the user's name to the user message payload if known #28

Merged
merged 5 commits into from
Dec 6, 2023

Conversation

Teagan42
Copy link
Contributor

Motivation

I wanted my assistant to know who it was talking to.

Approach

If there is a user_id attached to the context that is provided via user_input, retrieve the name of the user from HASS's authentication manager. This primarily applies when interacting with the UI or invoking the process service from a user context.

Future Work

Wake Words

Add voice recognition to wake word detection to differentiate the user who started the conversation

Full Feature

Add voice recognition to differentiate the user who is currently speaking - allowing for multiple participate in a conversation

@jekalmin
Copy link
Owner

Thank you for your work!
I just tried and seems to work well for me.

One concern I have is that since this is the first custom field(not required for openai) to put in the message, wonder if everyone want it to be added or not.

@Teagan42
Copy link
Contributor Author

I was thinking about adding it to the core project as well

@jekalmin
Copy link
Owner

If you don't mind, please let me keep this PR open for a while.
I am quite not sure whether this should be configurable or mandatory yet.

@Teagan42
Copy link
Contributor Author

No problem

@Teagan42
Copy link
Contributor Author

Went ahead and added it to the config_flow as you’re right, it should be optional for users.

@jekalmin
Copy link
Owner

Thanks for going ahead!
I will try this today or tomorrow, and let you know if anything is needed.

Copy link
Owner

@jekalmin jekalmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a label of new field in translations?

@jekalmin jekalmin added this to the 0.0.8 milestone Nov 23, 2023
@jekalmin jekalmin changed the base branch from main to v0.0.8 November 23, 2023 12:21
Copy link
Owner

@jekalmin jekalmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for a change!
I left a quick comment below :D

README.md Outdated
@@ -55,6 +56,7 @@ https://github.com/jekalmin/extended_openai_conversation/assets/2917984/64ba656e
By clicking a button from Edit Assist, Options can be customized.<br/>
Options include [OpenAI Conversation](https://www.home-assistant.io/integrations/openai_conversation/) options and two new options.

- `Attach Username`: Pass the active user's name (if applicaple) to OpenAI via rhe message payload. Currently, this only applies to conversations through the UI or REST API.
Copy link
Owner

@jekalmin jekalmin Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious of what rhe stands for. Can it be a typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typeo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

@jekalmin jekalmin modified the milestones: 0.0.8, 0.0.9 Dec 3, 2023
@jekalmin jekalmin changed the base branch from v0.0.8 to v0.0.9 December 3, 2023 11:35
Spelling issues
Copy link
Owner

@jekalmin jekalmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work!
I will apply this change in next release (currently released in 0.0.9-beta)

@jekalmin jekalmin merged commit 08b3dd0 into jekalmin:v0.0.9 Dec 6, 2023
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

Successfully merging this pull request may close these issues.

2 participants