mirror of
https://github.com/mii443/rust-genai.git
synced 2025-08-22 16:25:27 +00:00
. minor clippy_clean
This commit is contained in:
@ -94,7 +94,7 @@ impl Adapter for AnthropicAdapter {
|
||||
payload.x_insert("temperature", temperature)?;
|
||||
}
|
||||
|
||||
if options_set.stop_sequences().len() > 0 {
|
||||
if !options_set.stop_sequences().is_empty() {
|
||||
payload.x_insert("stop_sequences", options_set.stop_sequences())?;
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
//! Note 1: In the future, we will probably allow setting the client
|
||||
//! Note 2: Extracting it from the `ChatRequest` object allows for better reusability of each component.
|
||||
|
||||
use std::ops::Deref;
|
||||
use crate::chat::chat_req_response_format::ChatResponseFormat;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::ops::Deref;
|
||||
|
||||
/// Chat Options that are taken into account for any `Client::exec...` calls.
|
||||
///
|
||||
@ -40,7 +40,7 @@ pub struct ChatOptions {
|
||||
pub response_format: Option<ChatResponseFormat>,
|
||||
|
||||
/// Specifies sequences used as end marker when generating text
|
||||
pub stop_sequences: Vec<String>
|
||||
pub stop_sequences: Vec<String>,
|
||||
}
|
||||
|
||||
/// Chainable Setters
|
||||
@ -173,7 +173,7 @@ impl ChatOptionsSet<'_, '_> {
|
||||
self.chat
|
||||
.map(|chat| chat.stop_sequences.deref())
|
||||
.or_else(|| self.client.map(|client| client.stop_sequences.deref()))
|
||||
.unwrap_or_else(|| &[])
|
||||
.unwrap_or(&[])
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user