Add ability to use o1-preview and o1-mini as custom models (#17804)
This is a barebones modification of the OpenAI provider code to accommodate non-streaming completions. This is specifically for the o1 models, which do not support streaming. Tested that this is working by running a `/workflow` with the following (arbitrarily chosen) settings: ```json { "language_models": { "openai": { "version": "1", "available_models": [ { "name": "o1-preview", "display_name": "o1-preview", "max_tokens": 128000, "max_completion_tokens": 30000 }, { "name": "o1-mini", "display_name": "o1-mini", "max_tokens": 128000, "max_completion_tokens": 20000 } ] } }, } ``` Release Notes: - Changed `low_speed_timeout_in_seconds` option to `600` for OpenAI provider to accommodate recent o1 model release. --------- Co-authored-by: Peter <peter@zed.dev> Co-authored-by: Bennet <bennet@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
1b36c62188
commit
c71f052276
7 changed files with 136 additions and 4 deletions
|
@ -43,6 +43,7 @@ pub struct AvailableModel {
|
|||
pub display_name: Option<String>,
|
||||
pub max_tokens: usize,
|
||||
pub max_output_tokens: Option<u32>,
|
||||
pub max_completion_tokens: Option<u32>,
|
||||
}
|
||||
|
||||
pub struct OpenAiLanguageModelProvider {
|
||||
|
@ -175,6 +176,7 @@ impl LanguageModelProvider for OpenAiLanguageModelProvider {
|
|||
display_name: model.display_name.clone(),
|
||||
max_tokens: model.max_tokens,
|
||||
max_output_tokens: model.max_output_tokens,
|
||||
max_completion_tokens: model.max_completion_tokens,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue