ChatOllama constructor

ChatOllama({
  1. String baseUrl = 'http://localhost:11434/api',
  2. Map<String, String>? headers,
  3. Map<String, dynamic>? queryParams,
  4. Client? client,
  5. ChatOllamaOptions defaultOptions = const ChatOllamaOptions(model: defaultModel),
  6. String encoding = 'cl100k_base',
})

Create a new ChatOllama instance.

Main configuration options:

  • baseUrl: the base URL of Ollama API.
  • ChatOllama.defaultOptions

Advance configuration options:

  • headers: global headers to send with every request. You can use this to set custom headers, or to override the default headers.
  • queryParams: global query parameters to send with every request. You can use this to set custom query parameters.
  • client: the HTTP client to use. You can set your own HTTP client if you need further customization (e.g. to use a Socks5 proxy).
  • ChatOllama.encoding

Implementation

ChatOllama({
  final String baseUrl = 'http://localhost:11434/api',
  final Map<String, String>? headers,
  final Map<String, dynamic>? queryParams,
  final http.Client? client,
  super.defaultOptions = const ChatOllamaOptions(
    model: defaultModel,
  ),
  this.encoding = 'cl100k_base',
}) : _client = OllamaClient(
        baseUrl: baseUrl,
        headers: headers,
        queryParams: queryParams,
        client: client,
      );