changes
This commit is contained in:
+2
-1
@@ -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,6 +1,6 @@
|
||||
'use server';
|
||||
|
||||
import ollama from 'ollama';
|
||||
import ollama from '@/lib/ollama';
|
||||
|
||||
export interface OllamaModel {
|
||||
name: string;
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user