This commit is contained in:
Zacharias-Brohn
2026-01-14 19:15:48 +01:00
parent e479c24484
commit e2afe1a522
3 changed files with 15 additions and 2 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
'use server';
import ollama, { Tool } from 'ollama';
import { Tool } from 'ollama';
import ollama from '@/lib/ollama';
export interface ChatMessage {
role: 'user' | 'assistant' | 'system' | 'tool';
+1 -1
View File
@@ -1,6 +1,6 @@
'use server';
import ollama from 'ollama';
import ollama from '@/lib/ollama';
export interface OllamaModel {
name: string;
+12
View File
@@ -0,0 +1,12 @@
import { Ollama } from 'ollama';
// Initialize Ollama with the host from environment variables
// defaulting to localhost if not specified.
// This ensures that OLLAMA_HOST is respected.
const host = process.env.OLLAMA_HOST || 'http://127.0.0.1:11434';
console.log(`Initializing Ollama client with host: ${host}`);
const ollama = new Ollama({ host });
export default ollama;