This commit is contained in:
Sakurasan
2024-04-21 00:54:57 +08:00
parent 151757c2fe
commit 752053f7c4
3 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ bin/
test/
*.log
*.db
demo/

View File

@@ -3,7 +3,7 @@ WORKDIR /frontend-build
COPY ./web/ .
RUN npm install && npm run build && rm -rf node_modules
FROM golang:1.19-alpine as builder
FROM golang:1.21-alpine as builder
LABEL anther="github.com/Sakurasan"
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk --no-cache add make cmake upx
WORKDIR /build
@@ -11,7 +11,7 @@ COPY --from=frontend /frontend-build/dist /build/dist
COPY . /build
ENV GO111MODULE=on
# ENV GOPROXY=https://goproxy.cn,direct
CMD [ "go mod download" ]
CMD [ "go mod tidy","go mod download" ]
RUN make build
FROM alpine:latest AS runner

View File

@@ -155,7 +155,8 @@ func Cost(model string, promptCount, completionCount int) float64 {
case "gemini-1.5-pro-latest":
cost = (0.00025/1000)*float64(prompt) + (0.0005/1000)*float64(completion)
// Mistral AI
// Mistral AI
// https://docs.mistral.ai/platform/pricing/
case "mistral-small-latest":
cost = (0.002/1000)*float64(prompt) + (0.006/1000)*float64(completion)
case "mistral-medium-latest":