Skip to content

Commit e17084c

Browse files
fix(rig-1023): reasoning/thinking stream sends redundant data (#1002)
* fix(rig-1023): reasoning/thinking stream sends redundant data * refactor: needless clones
1 parent 3d5002b commit e17084c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rig-core/src/streaming.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ where
218218
RawStreamingChoice::Message(text) => {
219219
// Forward the streaming tokens to the outer stream
220220
// and concat the text together
221-
stream.text = format!("{}{}", stream.text, text.clone());
221+
stream.text = format!("{}{}", stream.text, text);
222222
Poll::Ready(Some(Ok(StreamedAssistantContent::text(&text))))
223223
}
224224
RawStreamingChoice::ToolCallDelta { id, delta } => {
@@ -234,10 +234,10 @@ where
234234
} => {
235235
// Forward the streaming tokens to the outer stream
236236
// and concat the text together
237-
stream.reasoning = format!("{}{}", stream.reasoning, reasoning.clone());
237+
stream.reasoning = format!("{}{}", stream.reasoning, reasoning);
238238
Poll::Ready(Some(Ok(StreamedAssistantContent::Reasoning(Reasoning {
239239
id,
240-
reasoning: vec![stream.reasoning.clone()],
240+
reasoning: vec![reasoning],
241241
signature,
242242
}))))
243243
}

0 commit comments

Comments
 (0)