Files
baibot-withmcp/src/agent/provider/ollama/mod.rs
Slavi Pantaleev db9422740c Add support for OpenAI's o1 models by making max_response_tokens optional
The other prerequisite seems to be not using a `prompt` (`prompt: null`),
but we already supported this.

It'd be nice to add an optional `max_completion_tokens` parameter as
well, for the benefit of the o1 models, but this is not yet supported by
async-openai.
Possibly tracked here: https://github.com/64bit/async-openai/issues/272
2024-10-03 10:36:28 +03:00

25 lines
708 B
Rust

// At the time of testing, Ollama can be powered by `openai`, but we use `openai_compat` for better reliability
// in the event of future updates to `async-openai`.
use super::openai_compat::Config;
pub fn default_config() -> Config {
let mut config = Config {
base_url: "http://my-ollama-self-hosted-service:11434/v1".to_owned(),
text_to_speech: None,
image_generation: None,
speech_to_text: None,
..Default::default()
};
if let Some(ref mut config) = config.text_generation.as_mut() {
config.model_id = "gemma2:2b".to_owned();
config.max_context_tokens = 128_000;
config.max_response_tokens = Some(4096);
}
config
}