fix: configurable OLLAMA_URL for Docker container
Ollama runs on host, container needs host.docker.internal mapping. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -65,7 +65,8 @@ JSON:`
|
||||
const controller = new AbortController()
|
||||
setTimeout(() => controller.abort(), 15000)
|
||||
|
||||
const res = await fetch('http://localhost:11434/api/generate', {
|
||||
const ollamaUrl = process.env.OLLAMA_URL || 'http://localhost:11434'
|
||||
const res = await fetch(`${ollamaUrl}/api/generate`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
signal: controller.signal,
|
||||
|
||||
@@ -15,7 +15,8 @@ export async function POST(req: NextRequest) {
|
||||
}
|
||||
|
||||
// Ollama API aufrufen
|
||||
const ollamaResponse = await fetch('http://localhost:11434/api/generate', {
|
||||
const ollamaUrl = process.env.OLLAMA_URL || 'http://localhost:11434'
|
||||
const ollamaResponse = await fetch(`${ollamaUrl}/api/generate`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user