parent
7e790f52c8
commit
22fa41e9c0
1 changed files with 24 additions and 6 deletions
|
@ -380,6 +380,24 @@ impl ClaudeAgentSession {
|
||||||
})
|
})
|
||||||
.log_err();
|
.log_err();
|
||||||
}
|
}
|
||||||
|
ContentChunk::Thinking { thinking } => {
|
||||||
|
thread
|
||||||
|
.update(cx, |thread, cx| {
|
||||||
|
thread.push_assistant_content_block(thinking.into(), true, cx)
|
||||||
|
})
|
||||||
|
.log_err();
|
||||||
|
}
|
||||||
|
ContentChunk::RedactedThinking => {
|
||||||
|
thread
|
||||||
|
.update(cx, |thread, cx| {
|
||||||
|
thread.push_assistant_content_block(
|
||||||
|
"[REDACTED]".into(),
|
||||||
|
true,
|
||||||
|
cx,
|
||||||
|
)
|
||||||
|
})
|
||||||
|
.log_err();
|
||||||
|
}
|
||||||
ContentChunk::ToolUse { id, name, input } => {
|
ContentChunk::ToolUse { id, name, input } => {
|
||||||
let claude_tool = ClaudeTool::infer(&name, input);
|
let claude_tool = ClaudeTool::infer(&name, input);
|
||||||
|
|
||||||
|
@ -429,8 +447,6 @@ impl ClaudeAgentSession {
|
||||||
}
|
}
|
||||||
ContentChunk::Image
|
ContentChunk::Image
|
||||||
| ContentChunk::Document
|
| ContentChunk::Document
|
||||||
| ContentChunk::Thinking
|
|
||||||
| ContentChunk::RedactedThinking
|
|
||||||
| ContentChunk::WebSearchToolResult => {
|
| ContentChunk::WebSearchToolResult => {
|
||||||
thread
|
thread
|
||||||
.update(cx, |thread, cx| {
|
.update(cx, |thread, cx| {
|
||||||
|
@ -580,11 +596,13 @@ enum ContentChunk {
|
||||||
content: Content,
|
content: Content,
|
||||||
tool_use_id: String,
|
tool_use_id: String,
|
||||||
},
|
},
|
||||||
|
Thinking {
|
||||||
|
thinking: String,
|
||||||
|
},
|
||||||
|
RedactedThinking,
|
||||||
// TODO
|
// TODO
|
||||||
Image,
|
Image,
|
||||||
Document,
|
Document,
|
||||||
Thinking,
|
|
||||||
RedactedThinking,
|
|
||||||
WebSearchToolResult,
|
WebSearchToolResult,
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
UntaggedText(String),
|
UntaggedText(String),
|
||||||
|
@ -594,12 +612,12 @@ impl Display for ContentChunk {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
ContentChunk::Text { text } => write!(f, "{}", text),
|
ContentChunk::Text { text } => write!(f, "{}", text),
|
||||||
|
ContentChunk::Thinking { thinking } => write!(f, "Thinking: {}", thinking),
|
||||||
|
ContentChunk::RedactedThinking => write!(f, "Thinking: [REDACTED]"),
|
||||||
ContentChunk::UntaggedText(text) => write!(f, "{}", text),
|
ContentChunk::UntaggedText(text) => write!(f, "{}", text),
|
||||||
ContentChunk::ToolResult { content, .. } => write!(f, "{}", content),
|
ContentChunk::ToolResult { content, .. } => write!(f, "{}", content),
|
||||||
ContentChunk::Image
|
ContentChunk::Image
|
||||||
| ContentChunk::Document
|
| ContentChunk::Document
|
||||||
| ContentChunk::Thinking
|
|
||||||
| ContentChunk::RedactedThinking
|
|
||||||
| ContentChunk::ToolUse { .. }
|
| ContentChunk::ToolUse { .. }
|
||||||
| ContentChunk::WebSearchToolResult => {
|
| ContentChunk::WebSearchToolResult => {
|
||||||
write!(f, "\n{:?}\n", &self)
|
write!(f, "\n{:?}\n", &self)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue