story-kit: merge 174_story_constrain_thinking_traces_in_chat_panel

This commit is contained in:
Dave
2026-02-25 09:32:48 +00:00
parent 4b161d7c87
commit 42c40209d2
5 changed files with 204 additions and 68 deletions

View File

@@ -180,18 +180,20 @@ pub fn set_anthropic_api_key(store: &dyn StoreOps, api_key: String) -> Result<()
}
#[allow(clippy::too_many_arguments)]
pub async fn chat<F, U, A>(
pub async fn chat<F, U, T, A>(
messages: Vec<Message>,
config: ProviderConfig,
state: &SessionState,
store: &dyn StoreOps,
mut on_update: F,
mut on_token: U,
mut on_thinking: T,
mut on_activity: A,
) -> Result<ChatResult, String>
where
F: FnMut(&[Message]) + Send,
U: FnMut(&str) + Send,
T: FnMut(&str) + Send,
A: FnMut(&str) + Send,
{
use crate::llm::providers::anthropic::AnthropicProvider;
@@ -244,6 +246,7 @@ where
config.session_id.as_deref(),
&mut cancel_rx,
|token| on_token(token),
|thinking| on_thinking(thinking),
|tool_name| on_activity(tool_name),
)
.await
@@ -799,6 +802,7 @@ mod tests {
|_| {},
|_| {},
|_| {},
|_| {},
)
.await;
@@ -840,6 +844,7 @@ mod tests {
|_| {},
|_| {},
|_| {},
|_| {},
)
.await;
@@ -879,6 +884,7 @@ mod tests {
|_| {},
|_| {},
|_| {},
|_| {},
)
.await;