story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat

This commit is contained in:
Dave
2026-02-23 18:38:15 +00:00
parent da8ded460e
commit af1625a132
5 changed files with 54 additions and 4 deletions

View File

@@ -176,13 +176,15 @@ pub fn set_anthropic_api_key(store: &dyn StoreOps, api_key: String) -> Result<()
set_anthropic_api_key_impl(store, &api_key)
}
pub async fn chat<F, U>(
#[allow(clippy::too_many_arguments)]
pub async fn chat<F, U, A>(
messages: Vec<Message>,
config: ProviderConfig,
state: &SessionState,
store: &dyn StoreOps,
mut on_update: F,
mut on_token: U,
mut on_activity: A,
permission_tx: Option<
tokio::sync::mpsc::UnboundedSender<
crate::llm::providers::claude_code::PermissionReqMsg,
@@ -192,6 +194,7 @@ pub async fn chat<F, U>(
where
F: FnMut(&[Message]) + Send,
U: FnMut(&str) + Send,
A: FnMut(&str) + Send,
{
use crate::llm::providers::anthropic::AnthropicProvider;
use crate::llm::providers::ollama::OllamaProvider;
@@ -322,6 +325,7 @@ where
tools,
&mut cancel_rx,
|token| on_token(token),
|tool_name| on_activity(tool_name),
)
.await
.map_err(|e| format!("Anthropic Error: {e}"))?