OllamaClient class

Core Ollama HTTP client shared across all capability modules

This class provides the foundational HTTP functionality that all Ollama capability implementations can use. It handles:

  • Authentication (optional API key)
  • Request/response processing
  • Error handling
  • JSON streaming (Ollama's streaming format)
  • Provider-specific configurations

Constructors

OllamaClient.new(OllamaConfig config)

Properties

config OllamaConfig
final
dio ↔ Dio
latefinal
hashCode int
The hash code for this object.
no setterinherited
logger → Logger
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getJson(String endpoint) Future<Map<String, dynamic>>
Make a GET request and return JSON response
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postJson(String endpoint, Map<String, dynamic> data) Future<Map<String, dynamic>>
Make a POST request and return JSON response
postStreamRaw(String endpoint, Map<String, dynamic> data) Stream<String>
Make a POST request and return raw stream for JSON streaming
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited