createOllamaProvider function

OllamaProvider createOllamaProvider({
  1. String? baseUrl,
  2. String? apiKey,
  3. String? model,
  4. int? maxTokens,
  5. double? temperature,
  6. String? systemPrompt,
  7. Duration? timeout,
  8. double? topP,
  9. int? topK,
  10. List<Tool>? tools,
  11. StructuredOutputFormat? jsonSchema,
  12. int? numCtx,
  13. int? numGpu,
  14. int? numThread,
  15. bool? numa,
  16. int? numBatch,
  17. String? keepAlive,
  18. bool? raw,
})

Create an Ollama provider with default configuration

Implementation

OllamaProvider createOllamaProvider({
  String? baseUrl,
  String? apiKey,
  String? model,
  int? maxTokens,
  double? temperature,
  String? systemPrompt,
  Duration? timeout,
  double? topP,
  int? topK,
  List<Tool>? tools,
  StructuredOutputFormat? jsonSchema,
  // Ollama-specific parameters
  int? numCtx,
  int? numGpu,
  int? numThread,
  bool? numa,
  int? numBatch,
  String? keepAlive,
  bool? raw,
}) {
  final config = OllamaConfig(
    baseUrl: baseUrl ?? 'http://localhost:11434',
    apiKey: apiKey,
    model: model ?? 'llama3.2',
    maxTokens: maxTokens,
    temperature: temperature,
    systemPrompt: systemPrompt,
    timeout: timeout,
    topP: topP,
    topK: topK,
    tools: tools,
    jsonSchema: jsonSchema,
    numCtx: numCtx,
    numGpu: numGpu,
    numThread: numThread,
    numa: numa,
    numBatch: numBatch,
    keepAlive: keepAlive,
    raw: raw,
  );

  return OllamaProvider(config);
}