. minor clippy_clean

This commit is contained in:
Jeremy Chone
2024-12-07 10:31:31 -08:00
parent 08a51836b4
commit 90fac76625
2 changed files with 4 additions and 4 deletions

View File

@ -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())?;
}

View File

@ -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(&[])
}
}