gmq版本

This commit is contained in:
2026-04-21 11:51:20 +08:00
parent 42afbf878c
commit 92e9d6b4ff
6 changed files with 72 additions and 590 deletions

View File

@@ -3,26 +3,25 @@ FROM golang:1.26-alpine3.23 AS builder
RUN apk add --no-cache git ca-certificates tzdata
RUN go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w GOPRIVATE=gitea.com/red-future/*
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
ENV CGO_ENABLED=0
ENV GOTOOLCHAIN=auto
ENV GOPRIVATE=gitea.com/red-future/common
# 配置Git URL重定向到私有仓库
RUN git config --global url."http://116.204.74.41:3000/red-future/".insteadOf "https://gitea.com/red-future/" \
&& git config --global url."http://116.204.74.41:3000/red-future/".insteadOf "http://gitea.com/red-future/"
# 配置git使用私有Gitea仓库带Token认证
RUN git config --global url."http://x-token-auth:9b31146aa8c10a7cb4f2e49dcee0934a223be1076289810e1ad98b968066c2bc@116.204.74.41:3000/red-future/common.git".insteadOf "https://gitea.com/red-future/common.git" && \
git config --global credential.helper store
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download && go mod verify
# 复制父目录的 common 模块(因为 go.mod 中使用了本地 replace)
COPY ../common /build/common
COPY . .
RUN go mod tidy
RUN go mod download && go mod tidy
# 编译生成 rag 二进制
RUN CGO_ENABLED=0 GOOS=linux go build -v -o rag .
RUN go build -ldflags="-s -w" -o main ./main.go
# 第二阶段:运行
FROM alpine:3.23
@@ -34,12 +33,12 @@ RUN apk add --no-cache ca-certificates tzdata && \
WORKDIR /app
# 复制编译好的二进制文件
COPY --from=builder /build/rag .
COPY config.yml ./
COPY --from=builder /build/main .
COPY --from=builder /build/config.yml ./
# 创建日志目录
RUN mkdir -p /logs /app/resource/log/run /app/resource/log/server
EXPOSE 3006
CMD ["./rag"]
CMD ["./main"]

43
go.mod
View File

@@ -3,38 +3,36 @@ module rag
go 1.26.0
require (
gitea.com/red-future/common v0.0.14
gitea.com/red-future/common v0.0.15
github.com/bjang03/gmq v0.0.1
github.com/cloudwego/eino v0.8.6
github.com/cloudwego/eino-ext/components/document/loader/file v0.0.0-20250519091007-282cc7eb18d3
github.com/cloudwego/eino-ext/components/document/loader/url v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/document/parser/docx v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/document/parser/pdf v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/document/parser/xlsx v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/document/transformer/splitter/recursive v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/document/transformer/splitter/semantic v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/document/loader/file v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/document/loader/url v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/document/parser/docx v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/document/parser/pdf v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/document/parser/xlsx v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/document/transformer/splitter/recursive v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/document/transformer/splitter/semantic v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/embedding/ark v0.1.1
github.com/cloudwego/eino-ext/components/embedding/dashscope v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/embedding/ollama v0.0.0-20260413110502-8d10f059c9a4
github.com/cloudwego/eino-ext/components/embedding/openai v0.0.0-20260323112355-f061db7e8419
github.com/cloudwego/eino-ext/components/embedding/qianfan v0.0.0-20260413110502-8d10f059c9a4
github.com/cloudwego/eino-ext/components/embedding/tencentcloud v0.0.0-20260413110502-8d10f059c9a4
github.com/cloudwego/eino-ext/components/model/ark v0.1.65
github.com/cloudwego/eino-ext/components/embedding/dashscope v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/embedding/ollama v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/embedding/openai v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/embedding/qianfan v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/embedding/tencentcloud v0.0.0-20260416081055-0ebab92e14f2
github.com/cloudwego/eino-ext/components/model/ark v0.1.66
github.com/cloudwego/eino-ext/components/model/arkbot v0.1.2
github.com/cloudwego/eino-ext/components/model/claude v0.1.17
github.com/cloudwego/eino-ext/components/model/deepseek v0.1.2
github.com/cloudwego/eino-ext/components/model/ollama v0.1.9
github.com/cloudwego/eino-ext/components/model/openai v0.1.12
github.com/cloudwego/eino-ext/components/model/openai v0.1.13
github.com/cloudwego/eino-ext/components/model/qianfan v0.1.4
github.com/cloudwego/eino-ext/components/model/qwen v0.1.7
github.com/cloudwego/eino-ext/components/model/qwen v0.1.9
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0
github.com/gogf/gf/v2 v2.10.0
github.com/pgvector/pgvector-go v0.3.0
)
//replace gitea.com/red-future/common v0.0.12 => ../common
//replace github.com/bjang03/gmq => ../gmq
//replace gitea.com/red-future/common => ../common
require (
cloud.google.com/go/auth v0.7.2 // indirect
@@ -69,7 +67,6 @@ require (
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic v1.15.0 // indirect
github.com/bytedance/sonic/loader v0.5.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/clbanning/mxj/v2 v2.7.0 // indirect
@@ -77,12 +74,11 @@ require (
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/cloudwego/eino-ext/components/document/parser/html v0.0.0-20241224063832-9fbcc0e56c28 // indirect
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.16 // indirect
github.com/cloudwego/eino-ext/libs/acl/openai v0.1.17 // indirect
github.com/cohesion-org/deepseek-go v1.3.2 // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dslipak/pdf v0.0.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/eino-contrib/docx2md v0.0.1 // indirect
github.com/eino-contrib/jsonschema v1.0.3 // indirect
@@ -133,6 +129,7 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/ledongthuc/pdf v0.0.0-20250511090121-5959a4027728 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lib/pq v1.12.1 // indirect
github.com/magiconair/properties v1.8.10 // indirect
@@ -184,7 +181,7 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/vcaesar/cedar v0.30.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/volcengine/volc-sdk-golang v1.0.199 // indirect
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
github.com/volcengine/volcengine-go-sdk v1.2.9 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect

587
go.sum

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
Asia/Shanghai