Skip to content

Conversation

@Phoenix500526
Copy link
Contributor

Closes: #1209

…ng requests

Change chat_history parameter type from Vec<Message> to Arc<RwLock<Vec<Message>>>
in StreamChat trait and StreamingPromptRequest. This allows callers to retain
access to the history and observe updates after the streaming request completes.

Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
…f tokio

Replace tokio::sync::RwLock with std::sync::RwLock for chat_history since
the lock is never held across await points. This reduces async overhead
for short-lived read/write operations.

Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
Ensure user prompt and assistant response are added to history when
streaming completes. Add test for shared ownership behavior.

Signed-off-by: Jiawei Zhao <Phoenix500526@163.com>
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.

feat(streaming): enable shared chat_history ownership in streaming requests

1 participant