-
-
Notifications
You must be signed in to change notification settings - Fork 703
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
Support intent-progress for Assist #5132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
is AssistEvent.MessageChunk -> { | ||
val lastMessage = _conversation.last() | ||
if (lastMessage == haMessage) { | ||
// Remove '...' message and add the chunk received |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In iOS I have a "typing" animation while we don't get a response, perhaps something you could add in a future PR
@@ -40,6 +41,14 @@ data class AssistPipelineIntentStart( | |||
val intentInput: String | |||
) : AssistPipelineEventData | |||
|
|||
@JsonIgnoreProperties(ignoreUnknown = true) | |||
data class AssistPipelineIntentProgress( | |||
val chat_log_delta: AssistChatLogDelta? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val chat_log_delta: AssistChatLogDelta? | |
val chatLogDelta: AssistChatLogDelta? |
Doesn't this work? The code base uses camel case, Jackson will convert the snake case from the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I was too fast while copy pasting from JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not have a tool that check for this kind of thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
intent-progress
allow streaming the answer of a LLM, right now it is not playing the sound before the text is fully written but that's a limitation of the API nothing we can do in the app.This PR is inspired by iOS PR home-assistant/iOS#3483 and the frontend PR home-assistant/frontend#24143
The frontend is handling the
role
but it seems that in our case we don't need for now at least.I took the liberty to replace the callback with unnamed arguments with a sealed class for better usability and evolution.
Screenshots
demo_stream.webm
Any other notes
It only works with ChatGPT integration for now.