Skip to content

Commit 81fcc7e

Browse files
committed
chore: amendments/clippy
1 parent 4a380ab commit 81fcc7e

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rig-integrations/rig-gemini-grpc/src/completion.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,11 @@ fn rig_assistant_content_to_grpc_part(
302302
})
303303
}
304304
message::AssistantContent::Reasoning(reasoning) => Ok(proto::Part {
305-
data: Some(proto::part::Data::Text(reasoning.reasoning.join("\n"))),
305+
data: Some(proto::part::Data::Text(reasoning.display_text())),
306306
thought: true,
307-
thought_signature: decode_optional_base64(reasoning.signature)?,
307+
thought_signature: decode_optional_base64(
308+
reasoning.first_signature().map(|s| s.to_string()),
309+
)?,
308310
part_metadata: None,
309311
}),
310312
_ => Err(CompletionError::RequestError(
@@ -335,10 +337,10 @@ impl TryFrom<GenerateContentResponse> for completion::CompletionResponse<Generat
335337
let assistant_content = match &part.data {
336338
Some(proto::part::Data::Text(text)) => {
337339
if part.thought {
338-
completion::AssistantContent::Reasoning(
339-
Reasoning::new(text)
340-
.with_signature(encode_optional_base64(&part.thought_signature)),
341-
)
340+
completion::AssistantContent::Reasoning(Reasoning::new_with_signature(
341+
text,
342+
encode_optional_base64(&part.thought_signature),
343+
))
342344
} else {
343345
completion::AssistantContent::text(text)
344346
}
@@ -418,6 +420,7 @@ impl TryFrom<GenerateContentResponse> for completion::CompletionResponse<Generat
418420
choice,
419421
usage,
420422
raw_response: response,
423+
message_id: None,
421424
})
422425
}
423426
}

0 commit comments

Comments
 (0)