From a93ddcb83760c6c04c09259cecf9629796368032 Mon Sep 17 00:00:00 2001 From: yaso Date: Sat, 25 Jan 2025 12:49:05 +0200 Subject: [PATCH] v10 --- Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart | 7 ++++--- nginx/nginx.conf | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart b/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart index 73834709..24c8d010 100644 --- a/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart +++ b/Frontend/lib/mih_packages/mzansi_ai/ai_chat.dart @@ -31,9 +31,10 @@ class _AiChatState extends State { late types.User _mihAI; String systemPromt = "You are a helpful and friendly AI assistant. You are running on a system called MIH which was created by \"Mzansi Innovation Hub\" a South African based company."; - final client = ollama.OllamaClient( - baseUrl: "${AppEnviroment.baseAiUrl}/api", - ); + final client = + ollama.OllamaClient(baseUrl: "${AppEnviroment.baseAiUrl}/api", headers: { + "Content-Type": "application/json", + }); List _chatHistory = []; void _addMessage(types.Message message) { diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 2fedd8ed..361a2835 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -173,6 +173,9 @@ http { proxy_pass http://MIH-AI:11434/; proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; } location ~ /.well-known/acme-challenge/ {