mirror of
https://github.com/mii443/rust-genai.git
synced 2025-08-22 16:25:27 +00:00
+ cohere - add stop_sequences support
This commit is contained in:
@ -84,6 +84,9 @@ impl Adapter for CohereAdapter {
|
||||
if let Some(temperature) = options_set.temperature() {
|
||||
payload.x_insert("temperature", temperature)?;
|
||||
}
|
||||
if !options_set.stop_sequences().is_empty() {
|
||||
payload.x_insert("stop_sequences", options_set.stop_sequences())?;
|
||||
}
|
||||
if let Some(max_tokens) = options_set.max_tokens() {
|
||||
payload.x_insert("max_tokens", max_tokens)?;
|
||||
}
|
||||
|
@ -14,6 +14,11 @@ async fn test_chat_simple_ok() -> Result<()> {
|
||||
common_tests::common_test_chat_simple_ok(MODEL).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_chat_stop_sequences_ok() -> Result<()> {
|
||||
common_tests::common_test_chat_stop_sequences_ok(MODEL).await
|
||||
}
|
||||
|
||||
// endregion: --- Chat
|
||||
|
||||
// region: --- Chat Stream Tests
|
||||
|
Reference in New Issue
Block a user