Add support for configuring max_completion_tokens for OpenAI

Related to db9422740c
This commit is contained in:
Slavi Pantaleev
2025-02-27 09:52:24 +02:00
parent 692d61b239
commit 47d8edea70
5 changed files with 13 additions and 2 deletions

View File

@@ -58,6 +58,9 @@ pub struct TextGenerationConfig {
#[serde(default)]
pub max_response_tokens: Option<u32>,
#[serde(default)]
pub max_completion_tokens: Option<u32>,
#[serde(default)]
pub max_context_tokens: u32,
}
@@ -69,6 +72,7 @@ impl Default for TextGenerationConfig {
prompt: Some(default_prompt().to_owned()),
temperature: super::super::default_temperature(),
max_response_tokens: Some(16_384),
max_completion_tokens: None,
max_context_tokens: 128_000,
}
}