Ollama

Type Alias Ollama 

Source
pub type Ollama = GenericOpenAI<OllamaConfig>;
Available on crate feature ollama only.
Expand description

The Ollama struct encapsulates an Ollama client and default options for embedding and prompt models. It uses the Builder pattern for flexible and customizable instantiation.

By default it will look for a OLLAMA_API_KEY environment variable. Note that either a prompt model or embedding model always need to be set, either with Ollama::with_default_prompt_model or Ollama::with_default_embed_model or via the builder. You can find available models in the Ollama documentation.

Under the hood it uses async_openai, with the Ollama openai mapping. This means some features might not work as expected. See the Ollama documentation for details.

Aliased Type§

pub struct Ollama {
    pub stream_full: bool,
    /* private fields */
}

Fields§

§stream_full: bool

Convenience option to stream the full response. Defaults to true, because nobody has time to reconstruct the delta. Disabling this will make the streamed content only return the delta, for when performance matters. This only has effect when streaming is enabled.

Implementations§

Source§

impl Ollama

Source

pub fn builder() -> OllamaBuilder

Build a new Ollama instance

Trait Implementations§

Source§

impl Default for Ollama

Source§

fn default() -> Self

Returns the “default value” for a type. Read more