Skip to content

Commit

Permalink
Don't error when Claude does a no-arg tool call in streaming mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheng5 committed Dec 18, 2024
1 parent 988550e commit 2ba2247
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/provider-claude.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ method(stream_merge_chunks, ProviderClaude) <- function(provider, result, chunk)
if (chunk$delta$type == "text_delta") {
paste(result$content[[chunk$index + 1L]]$text) <- chunk$delta$text
} else if (chunk$delta$type == "input_json_delta") {
paste(result$content[[chunk$index + 1L]]$input) <- chunk$delta$partial_json
if (chunk$delta$partial_json != "") {
# See issue #228 about partial_json sometimes being ""
paste(result$content[[chunk$index + 1L]]$input) <- chunk$delta$partial_json
}
} else {
cli::cli_inform(c("!" = "Unknown delta type {.str {chunk$delta$type}}."))
}
Expand Down

0 comments on commit 2ba2247

Please sign in to comment.