From c99b73d40671a297b4cb4add67a2d72dc47add97 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Tue, 13 Jan 2026 00:20:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 6 +-- .../dev/trigger/http/OllamaController.java | 4 +- docs/docker-compose-environment-aliyun2.yml | 43 +++++++++++++++++++ docs/nginx/html/ai-case-04.html | 2 +- docs/nginx/html/index.html | 2 +- 5 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 docs/docker-compose-environment-aliyun2.yml diff --git a/ai-rag-app/src/main/resources/application-dev.yml b/ai-rag-app/src/main/resources/application-dev.yml index cc8f7f5..c94cc65 100644 --- a/ai-rag-app/src/main/resources/application-dev.yml +++ b/ai-rag-app/src/main/resources/application-dev.yml @@ -4,14 +4,14 @@ server: spring: ai: ollama: - base-url: http://117.72.202.142:11434 + base-url: http://192.168.109.134:11434 # Redis redis: sdk: config: - host: 117.72.202.142 - port: 16379 + host: 127.0.0.1 + port: 6379 pool-size: 10 min-idle-size: 5 idle-timeout: 30000 diff --git a/ai-rag-trigger/src/main/java/com/storm/dev/trigger/http/OllamaController.java b/ai-rag-trigger/src/main/java/com/storm/dev/trigger/http/OllamaController.java index b6a34c2..25e13be 100644 --- a/ai-rag-trigger/src/main/java/com/storm/dev/trigger/http/OllamaController.java +++ b/ai-rag-trigger/src/main/java/com/storm/dev/trigger/http/OllamaController.java @@ -22,7 +22,7 @@ public class OllamaController implements IAiService { private OllamaChatClient chatClient; /** - * http://localhost:8090/api/v1/ollama/generate?model=deepseek-r1:1.5b&message=1+1 + * http://localhost:8090/api/v1/ollama/generate?model=deepseek-r1:7b&message=1+1 */ @GetMapping("generate") @Override @@ -31,7 +31,7 @@ public class OllamaController implements IAiService { } /** - * http://localhost:8090/api/v1/ollama/generate_stream?model=deepseek-r1:1.5b&message=hi + * http://localhost:8090/api/v1/ollama/generate_stream?model=deepseek-r1:7b&message=hi */ @GetMapping("generate_stream") @Override diff --git a/docs/docker-compose-environment-aliyun2.yml b/docs/docker-compose-environment-aliyun2.yml new file mode 100644 index 0000000..ccaa254 --- /dev/null +++ b/docs/docker-compose-environment-aliyun2.yml @@ -0,0 +1,43 @@ +# docker-compose -f docker-compose-environment-aliyun.yml up -d +version: '3' +services: + # 对话模型 + # ollama pull deepseek-r1:1.5b + # 运行模型 + # ollama run deepseek-r1:1.5b + # 联网模型 + # ollama pull nomic-embed-text + ollama: + image: registry.cn-hangzhou.aliyuncs.com/xfg-studio/ollama:0.5.10 + container_name: ollama + restart: unless-stopped + ports: + - "11434:11434" + vector_db: + image: registry.cn-hangzhou.aliyuncs.com/xfg-studio/pgvector:v0.5.0 + container_name: vector_db + restart: always + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=ai-rag-knowledge + - PGPASSWORD=postgres + volumes: + - ./pgvector/sql/init.sql:/docker-entrypoint-initdb.d/init.sql + logging: + options: + max-size: 10m + max-file: "3" + ports: + - '15432:5432' + healthcheck: + test: "pg_isready -U postgres -d ai-rag-knowledge" + interval: 2s + timeout: 20s + retries: 10 + networks: + - my-network + +networks: + my-network: + driver: bridge \ No newline at end of file diff --git a/docs/nginx/html/ai-case-04.html b/docs/nginx/html/ai-case-04.html index 5ead4c2..6f7c70e 100644 --- a/docs/nginx/html/ai-case-04.html +++ b/docs/nginx/html/ai-case-04.html @@ -69,7 +69,7 @@ addMessage(''); // 构建API URL - const apiUrl = `http://localhost:8090/api/v1/ollama/generate_stream?model=deepseek-r1:1.5b&message=${encodeURIComponent(message)}`; + const apiUrl = `http://localhost:8090/api/v1/ollama/generate_stream?model=deepseek-r1:7b&message=${encodeURIComponent(message)}`; // 使用EventSource接收流式响应 const eventSource = new EventSource(apiUrl); diff --git a/docs/nginx/html/index.html b/docs/nginx/html/index.html index 5ffc838..6ef861a 100644 --- a/docs/nginx/html/index.html +++ b/docs/nginx/html/index.html @@ -56,7 +56,7 @@