Copyright | (c) 2025 Tushar Adhatrao |
---|---|
License | MIT |
Maintainer | Tushar Adhatrao <[email protected]> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Data.Ollama.Common.Config
Description
Overview
This module defines the core configuration record used throughout the Ollama Haskell client.
Use defaultOllamaConfig
as a starting point and customize it with helper functions
like withOnModelStart
, withOnModelFinish
, or withOnModelError
.
Includes settings for base URL, timeout, retry logic, and custom HTTP managers.
Synopsis
- data OllamaConfig = OllamaConfig {
- hostUrl :: Text
- timeout :: Int
- onModelStart :: Maybe (IO ())
- onModelError :: Maybe (IO ())
- onModelFinish :: Maybe (IO ())
- retryCount :: Maybe Int
- retryDelay :: Maybe Int
- commonManager :: Maybe Manager
- defaultOllamaConfig :: OllamaConfig
- withOnModelStart :: IO () -> OllamaConfig -> OllamaConfig
- withOnModelFinish :: IO () -> OllamaConfig -> OllamaConfig
- withOnModelError :: IO () -> OllamaConfig -> OllamaConfig
Configuration Type
data OllamaConfig Source #
Configuration for the Ollama client. Used across all requests to customize behavior such as timeouts, retries, custom HTTP manager, and lifecycle hooks. -- -- @since 0.2.0.0
Constructors
OllamaConfig | |
Fields
|
Instances
Default Config
defaultOllamaConfig :: OllamaConfig Source #
A default configuration pointing to localhost:11434
with 90s timeout
and no hooks or retry logic.
Hook Helpers
withOnModelStart :: IO () -> OllamaConfig -> OllamaConfig Source #
Add a callback to be executed when a model starts.
withOnModelFinish :: IO () -> OllamaConfig -> OllamaConfig Source #
Add a callback to be executed when a model finishes successfully.
withOnModelError :: IO () -> OllamaConfig -> OllamaConfig Source #
Add a callback to be executed when a model errors.