@lobehub/chat 1.8.0 โ 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +0 -1
- package/.github/PULL_REQUEST_TEMPLATE.md +2 -1
- package/.github/workflows/docker-database.yml +46 -0
- package/CHANGELOG.md +50 -0
- package/Dockerfile +54 -7
- package/Dockerfile.database +170 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docs/self-hosting/environment-variables/basic.mdx +11 -0
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +12 -0
- package/package.json +2 -2
- package/scripts/migrateServerDB/docker.cjs +34 -0
- package/src/components/ModelIcon/index.tsx +4 -3
- package/src/components/ModelTag/ModelIcon.tsx +4 -3
- package/src/config/modelProviders/bedrock.ts +4 -0
- package/src/config/modelProviders/ollama.ts +116 -107
- package/src/libs/agent-runtime/bedrock/index.ts +3 -2
- package/src/libs/next-auth/adapter/index.ts +3 -7
package/.dockerignore
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Publish Database Docker Image
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
release:
|
|
6
|
+
types: [published]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
push_to_registry:
|
|
10
|
+
name: Push Docker image to Docker Hub
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Check out the repo
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
- name: Log in to Docker Hub
|
|
16
|
+
uses: docker/login-action@v3
|
|
17
|
+
with:
|
|
18
|
+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
|
|
19
|
+
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
|
20
|
+
|
|
21
|
+
- name: Extract metadata (tags, labels) for Docker
|
|
22
|
+
id: meta
|
|
23
|
+
uses: docker/metadata-action@v5
|
|
24
|
+
with:
|
|
25
|
+
images: lobehub/lobe-chat-database
|
|
26
|
+
tags: |
|
|
27
|
+
type=raw,value=latest
|
|
28
|
+
type=ref,event=tag
|
|
29
|
+
|
|
30
|
+
- name: Set up QEMU
|
|
31
|
+
uses: docker/setup-qemu-action@v3
|
|
32
|
+
|
|
33
|
+
- name: Set up Docker Buildx
|
|
34
|
+
uses: docker/setup-buildx-action@v3
|
|
35
|
+
|
|
36
|
+
- name: Build and push Docker image
|
|
37
|
+
uses: docker/build-push-action@v5
|
|
38
|
+
with:
|
|
39
|
+
context: .
|
|
40
|
+
file: ./Dockerfile.database # ๆๅฎไฝฟ็จ Dockerfile.database ๆไปถ
|
|
41
|
+
platforms: linux/amd64,linux/arm64
|
|
42
|
+
push: true
|
|
43
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
44
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
45
|
+
cache-from: type=gha
|
|
46
|
+
cache-to: type=gha,mode=max
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.8.2](https://github.com/lobehub/lobe-chat/compare/v1.8.1...v1.8.2)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-03**</sup>
|
|
8
|
+
|
|
9
|
+
#### ๐ Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Add `PROXY_URL` in docker with proxychains-ng.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Add `PROXY_URL` in docker with proxychains-ng, closes [#3362](https://github.com/lobehub/lobe-chat/issues/3362) ([920de7c](https://github.com/lobehub/lobe-chat/commit/920de7c))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 1.8.1](https://github.com/lobehub/lobe-chat/compare/v1.8.0...v1.8.1)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-08-03**</sup>
|
|
33
|
+
|
|
34
|
+
#### ๐ Styles
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix `aya`, `mathstral` model tag icon & update ollama model info.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### Styles
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix `aya`, `mathstral` model tag icon & update ollama model info, closes [#3382](https://github.com/lobehub/lobe-chat/issues/3382) ([ced95a8](https://github.com/lobehub/lobe-chat/commit/ced95a8))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
## [Version 1.8.0](https://github.com/lobehub/lobe-chat/compare/v1.7.10...v1.8.0)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-08-02**</sup>
|
package/Dockerfile
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
## Base image for all the stages
|
|
2
2
|
FROM node:20-alpine AS base
|
|
3
3
|
|
|
4
|
+
ARG USE_CN_MIRROR
|
|
5
|
+
|
|
4
6
|
RUN \
|
|
7
|
+
# If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true
|
|
8
|
+
if [ "${USE_CN_MIRROR:-false}" = "true" ]; then \
|
|
9
|
+
sed -i "s/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g" "/etc/apk/repositories"; \
|
|
10
|
+
fi \
|
|
11
|
+
# Add proxychains-ng package & update base package
|
|
12
|
+
&& apk update \
|
|
13
|
+
&& apk add --no-cache proxychains-ng \
|
|
14
|
+
&& apk upgrade --no-cache \
|
|
5
15
|
# Add user nextjs to run the app
|
|
6
|
-
addgroup --system --gid 1001 nodejs \
|
|
7
|
-
&& adduser --system --uid 1001 nextjs
|
|
16
|
+
&& addgroup --system --gid 1001 nodejs \
|
|
17
|
+
&& adduser --system --uid 1001 nextjs \
|
|
18
|
+
&& chown -R nextjs:nodejs "/etc/proxychains" \
|
|
19
|
+
&& rm -rf /tmp/* /var/cache/apk/*
|
|
8
20
|
|
|
9
21
|
## Builder image, install all the dependencies and build the app
|
|
10
22
|
FROM base AS builder
|
|
11
23
|
|
|
12
|
-
ARG
|
|
24
|
+
ARG USE_CN_MIRROR
|
|
13
25
|
|
|
14
26
|
ENV NEXT_PUBLIC_BASE_PATH=""
|
|
15
27
|
|
|
@@ -37,8 +49,8 @@ COPY package.json ./
|
|
|
37
49
|
COPY .npmrc ./
|
|
38
50
|
|
|
39
51
|
RUN \
|
|
40
|
-
# If you want to build docker in China, build with --build-arg
|
|
41
|
-
if [ "${
|
|
52
|
+
# If you want to build docker in China, build with --build-arg USE_CN_MIRROR=true
|
|
53
|
+
if [ "${USE_CN_MIRROR:-false}" = "true" ]; then \
|
|
42
54
|
export SENTRYCLI_CDNURL="https://npmmirror.com/mirrors/sentry-cli"; \
|
|
43
55
|
npm config set registry "https://registry.npmmirror.com/"; \
|
|
44
56
|
fi \
|
|
@@ -85,7 +97,10 @@ ENV HOSTNAME="0.0.0.0" \
|
|
|
85
97
|
# General Variables
|
|
86
98
|
ENV ACCESS_CODE="" \
|
|
87
99
|
API_KEY_SELECT_MODE="" \
|
|
88
|
-
|
|
100
|
+
DEFAULT_AGENT_CONFIG="" \
|
|
101
|
+
SYSTEM_AGENT="" \
|
|
102
|
+
FEATURE_FLAGS="" \
|
|
103
|
+
PROXY_URL=""
|
|
89
104
|
|
|
90
105
|
# Model Variables
|
|
91
106
|
ENV \
|
|
@@ -138,4 +153,36 @@ USER nextjs
|
|
|
138
153
|
|
|
139
154
|
EXPOSE 3210/tcp
|
|
140
155
|
|
|
141
|
-
CMD
|
|
156
|
+
CMD \
|
|
157
|
+
if [ -n "$PROXY_URL" ]; then \
|
|
158
|
+
# Set regex for IPv4
|
|
159
|
+
IP_REGEX="^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$"; \
|
|
160
|
+
# Set proxychains command
|
|
161
|
+
PROXYCHAINS="proxychains -q"; \
|
|
162
|
+
# Parse the proxy URL
|
|
163
|
+
host_with_port="${PROXY_URL#*//}"; \
|
|
164
|
+
host="${host_with_port%%:*}"; \
|
|
165
|
+
port="${PROXY_URL##*:}"; \
|
|
166
|
+
protocol="${PROXY_URL%%://*}"; \
|
|
167
|
+
# Resolve to IP address if the host is a domain
|
|
168
|
+
if ! [[ "$host" =~ "$IP_REGEX" ]]; then \
|
|
169
|
+
nslookup=$(nslookup -q="A" "$host" | tail -n +3 | grep 'Address:'); \
|
|
170
|
+
if [ -n "$nslookup" ]; then \
|
|
171
|
+
host=$(echo "$nslookup" | tail -n 1 | awk '{print $2}'); \
|
|
172
|
+
fi; \
|
|
173
|
+
fi; \
|
|
174
|
+
# Generate proxychains configuration file
|
|
175
|
+
printf "%s\n" \
|
|
176
|
+
'localnet 127.0.0.0/255.0.0.0' \
|
|
177
|
+
'localnet ::1/128' \
|
|
178
|
+
'proxy_dns' \
|
|
179
|
+
'remote_dns_subnet 224' \
|
|
180
|
+
'strict_chain' \
|
|
181
|
+
'tcp_connect_time_out 8000' \
|
|
182
|
+
'tcp_read_time_out 15000' \
|
|
183
|
+
'[ProxyList]' \
|
|
184
|
+
"$protocol $host $port" \
|
|
185
|
+
> "/etc/proxychains/proxychains.conf"; \
|
|
186
|
+
fi; \
|
|
187
|
+
# Run the server
|
|
188
|
+
${PROXYCHAINS} node "/app/server.js";
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
## Base image for all the stages
|
|
2
|
+
FROM node:20-alpine AS base
|
|
3
|
+
|
|
4
|
+
RUN \
|
|
5
|
+
# Add user nextjs to run the app
|
|
6
|
+
addgroup --system --gid 1001 nodejs \
|
|
7
|
+
&& adduser --system --uid 1001 nextjs
|
|
8
|
+
|
|
9
|
+
## Builder image, install all the dependencies and build the app
|
|
10
|
+
FROM base AS builder
|
|
11
|
+
|
|
12
|
+
ARG USE_NPM_CN_MIRROR
|
|
13
|
+
|
|
14
|
+
ENV KEY_VAULTS_SECRET="use-for-build" \
|
|
15
|
+
NEXT_PUBLIC_SERVICE_MODE="server" \
|
|
16
|
+
DATABASE_DRIVER="node" \
|
|
17
|
+
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres"
|
|
18
|
+
|
|
19
|
+
# Sentry
|
|
20
|
+
ENV NEXT_PUBLIC_SENTRY_DSN="" \
|
|
21
|
+
SENTRY_ORG="" \
|
|
22
|
+
SENTRY_PROJECT=""
|
|
23
|
+
|
|
24
|
+
# Posthog
|
|
25
|
+
ENV NEXT_PUBLIC_ANALYTICS_POSTHOG="" \
|
|
26
|
+
NEXT_PUBLIC_POSTHOG_HOST="" \
|
|
27
|
+
NEXT_PUBLIC_POSTHOG_KEY=""
|
|
28
|
+
|
|
29
|
+
# Umami
|
|
30
|
+
ENV NEXT_PUBLIC_ANALYTICS_UMAMI="" \
|
|
31
|
+
NEXT_PUBLIC_UMAMI_SCRIPT_URL="" \
|
|
32
|
+
NEXT_PUBLIC_UMAMI_WEBSITE_ID=""
|
|
33
|
+
|
|
34
|
+
# Node
|
|
35
|
+
ENV NODE_OPTIONS="--max-old-space-size=8192"
|
|
36
|
+
|
|
37
|
+
WORKDIR /app
|
|
38
|
+
|
|
39
|
+
COPY package.json ./
|
|
40
|
+
COPY .npmrc ./
|
|
41
|
+
|
|
42
|
+
RUN \
|
|
43
|
+
# If you want to build docker in China, build with --build-arg USE_NPM_CN_MIRROR=true
|
|
44
|
+
if [ "${USE_NPM_CN_MIRROR:-false}" = "true" ]; then \
|
|
45
|
+
export SENTRYCLI_CDNURL="https://npmmirror.com/mirrors/sentry-cli"; \
|
|
46
|
+
npm config set registry "https://registry.npmmirror.com/"; \
|
|
47
|
+
fi \
|
|
48
|
+
# Set the registry for corepack
|
|
49
|
+
&& export COREPACK_NPM_REGISTRY=$(npm config get registry | sed 's/\/$//') \
|
|
50
|
+
# Enable corepack
|
|
51
|
+
&& corepack enable \
|
|
52
|
+
# Use pnpm for corepack
|
|
53
|
+
&& corepack use pnpm \
|
|
54
|
+
# Install the dependencies
|
|
55
|
+
&& pnpm i \
|
|
56
|
+
# Add sharp and db migration dependencies
|
|
57
|
+
&& mkdir -p /deps \
|
|
58
|
+
&& pnpm add sharp pg drizzle-orm --prefix /deps
|
|
59
|
+
|
|
60
|
+
COPY . .
|
|
61
|
+
|
|
62
|
+
# run build standalone for docker version
|
|
63
|
+
RUN npm run build:docker
|
|
64
|
+
|
|
65
|
+
## Application image, copy all the files for production
|
|
66
|
+
FROM scratch AS app
|
|
67
|
+
|
|
68
|
+
COPY --from=builder /app/public /app/public
|
|
69
|
+
|
|
70
|
+
# Automatically leverage output traces to reduce image size
|
|
71
|
+
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
72
|
+
COPY --from=builder /app/.next/standalone /app/
|
|
73
|
+
COPY --from=builder /app/.next/static /app/.next/static
|
|
74
|
+
|
|
75
|
+
# copy dependencies
|
|
76
|
+
COPY --from=builder /deps/node_modules/.pnpm /app/node_modules/.pnpm
|
|
77
|
+
COPY --from=builder /deps/node_modules/pg /app/node_modules/pg
|
|
78
|
+
COPY --from=builder /deps/node_modules/drizzle-orm /app/node_modules/drizzle-orm
|
|
79
|
+
|
|
80
|
+
# Copy database migrations
|
|
81
|
+
COPY --from=builder /app/src/database/server/migrations /app/migrations
|
|
82
|
+
COPY --from=builder /app/scripts/migrateServerDB/docker.cjs /app/docker.cjs
|
|
83
|
+
|
|
84
|
+
## Production image, copy all the files and run next
|
|
85
|
+
FROM base
|
|
86
|
+
|
|
87
|
+
# Copy all the files from app, set the correct permission for prerender cache
|
|
88
|
+
COPY --from=app --chown=nextjs:nodejs /app /app
|
|
89
|
+
|
|
90
|
+
ENV NODE_ENV="production"
|
|
91
|
+
|
|
92
|
+
# set hostname to localhost
|
|
93
|
+
ENV HOSTNAME="0.0.0.0" \
|
|
94
|
+
PORT="3210"
|
|
95
|
+
|
|
96
|
+
# General Variables
|
|
97
|
+
ENV API_KEY_SELECT_MODE="" \
|
|
98
|
+
FEATURE_FLAGS=""
|
|
99
|
+
|
|
100
|
+
# Database
|
|
101
|
+
ENV KEY_VAULTS_SECRET="" \
|
|
102
|
+
DATABASE_DRIVER="node" \
|
|
103
|
+
DATABASE_URL=""
|
|
104
|
+
|
|
105
|
+
# Next Auth
|
|
106
|
+
ENV NEXT_AUTH_SECRET="" \
|
|
107
|
+
ACCESS_CODE="" \
|
|
108
|
+
NEXTAUTH_URL="" \
|
|
109
|
+
NEXT_AUTH_SSO_PROVIDERS=""
|
|
110
|
+
|
|
111
|
+
# S3
|
|
112
|
+
ENV S3_ACCESS_KEY_ID="" \
|
|
113
|
+
S3_SECRET_ACCESS_KEY="" \
|
|
114
|
+
NEXT_PUBLIC_S3_DOMAIN="" \
|
|
115
|
+
S3_ENDPOINT="" \
|
|
116
|
+
S3_BUCKET=""
|
|
117
|
+
|
|
118
|
+
# Model Variables
|
|
119
|
+
ENV \
|
|
120
|
+
# Ai360
|
|
121
|
+
AI360_API_KEY="" \
|
|
122
|
+
# Anthropic
|
|
123
|
+
ANTHROPIC_API_KEY="" ANTHROPIC_PROXY_URL="" \
|
|
124
|
+
# Amazon Bedrock
|
|
125
|
+
AWS_ACCESS_KEY_ID="" AWS_SECRET_ACCESS_KEY="" AWS_REGION="" \
|
|
126
|
+
# Azure OpenAI
|
|
127
|
+
AZURE_API_KEY="" AZURE_API_VERSION="" AZURE_ENDPOINT="" AZURE_MODEL_LIST="" \
|
|
128
|
+
# Baichuan
|
|
129
|
+
BAICHUAN_API_KEY="" \
|
|
130
|
+
# DeepSeek
|
|
131
|
+
DEEPSEEK_API_KEY="" \
|
|
132
|
+
# Google
|
|
133
|
+
GOOGLE_API_KEY="" GOOGLE_PROXY_URL="" \
|
|
134
|
+
# Groq
|
|
135
|
+
GROQ_API_KEY="" GROQ_PROXY_URL="" \
|
|
136
|
+
# Minimax
|
|
137
|
+
MINIMAX_API_KEY="" \
|
|
138
|
+
# Mistral
|
|
139
|
+
MISTRAL_API_KEY="" \
|
|
140
|
+
# Moonshot
|
|
141
|
+
MOONSHOT_API_KEY="" MOONSHOT_PROXY_URL="" \
|
|
142
|
+
# Novita
|
|
143
|
+
NOVITA_API_KEY="" \
|
|
144
|
+
# Ollama
|
|
145
|
+
OLLAMA_MODEL_LIST="" OLLAMA_PROXY_URL="" \
|
|
146
|
+
# OpenAI
|
|
147
|
+
OPENAI_API_KEY="" OPENAI_MODEL_LIST="" OPENAI_PROXY_URL="" \
|
|
148
|
+
# OpenRouter
|
|
149
|
+
OPENROUTER_API_KEY="" OPENROUTER_MODEL_LIST="" \
|
|
150
|
+
# Perplexity
|
|
151
|
+
PERPLEXITY_API_KEY="" PERPLEXITY_PROXY_URL="" \
|
|
152
|
+
# Qwen
|
|
153
|
+
QWEN_API_KEY="" \
|
|
154
|
+
# Stepfun
|
|
155
|
+
STEPFUN_API_KEY="" \
|
|
156
|
+
# Taichu
|
|
157
|
+
TAICHU_API_KEY="" \
|
|
158
|
+
# TogetherAI
|
|
159
|
+
TOGETHERAI_API_KEY="" TOGETHERAI_MODEL_LIST="" \
|
|
160
|
+
# 01.AI
|
|
161
|
+
ZEROONE_API_KEY="" \
|
|
162
|
+
# Zhipu
|
|
163
|
+
ZHIPU_API_KEY=""
|
|
164
|
+
|
|
165
|
+
USER nextjs
|
|
166
|
+
|
|
167
|
+
EXPOSE 3210/tcp
|
|
168
|
+
|
|
169
|
+
# run migration , then run app
|
|
170
|
+
CMD ["sh", "-c", "node /app/docker.cjs && node /app/server.js"]
|
package/README.md
CHANGED
|
@@ -266,14 +266,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
266
266
|
|
|
267
267
|
<!-- AGENT LIST -->
|
|
268
268
|
|
|
269
|
-
| Recent Submits | Description
|
|
270
|
-
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
271
|
-
| [
|
|
272
|
-
| [
|
|
273
|
-
| [
|
|
274
|
-
| [
|
|
275
|
-
|
|
276
|
-
> ๐ Total agents: [<kbd>**
|
|
269
|
+
| Recent Submits | Description |
|
|
270
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
271
|
+
| [Omnipedia](https://chat-preview.lobehub.com/market?agent=omnipedia)<br/><sup>By **[thedivergentai](https://github.com/thedivergentai)** on **2024-08-02**</sup> | Expert in providing high-quality, well-researched information on various topics, including history, science, literature, art, and more. Skilled in summarizing complex topics, assisting with research tasks, and offering creative prompts<br/>`artificial-intelligence` `information` `education` `communication` |
|
|
272
|
+
| [Code Snark Master](https://chat-preview.lobehub.com/market?agent=code-snark-master)<br/><sup>By **[leter](https://github.com/leter)** on **2024-07-29**</sup> | Specializes in sharp criticism of code, sarcastically pointing out inefficiencies and readability issues<br/>`tech-leadership` `code-review` `sarcastic-style` `programming-consultation` |
|
|
273
|
+
| [Unity Maestro](https://chat-preview.lobehub.com/market?agent=unity-maestro)<br/><sup>By **[thedivergentai](https://github.com/thedivergentai)** on **2024-07-29**</sup> | Expert Unity Game Development Companion<br/>`game-development` `unity` `software-engineering` |
|
|
274
|
+
| [C Program Learning Assistant](https://chat-preview.lobehub.com/market?agent=sichuan-university-941-c-programming-assistant)<br/><sup>By **[YBGuoYang](https://github.com/YBGuoYang)** on **2024-07-28**</sup> | Assist me in learning C program design<br/>`941` |
|
|
275
|
+
|
|
276
|
+
> ๐ Total agents: [<kbd>**310**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
277
277
|
|
|
278
278
|
<!-- AGENT LIST -->
|
|
279
279
|
|
package/README.zh-CN.md
CHANGED
|
@@ -254,14 +254,14 @@ LobeChat ็ๆไปถ็ๆ็ณป็ปๆฏๅ
ถๆ ธๅฟๅ่ฝ็้่ฆๆฉๅฑ๏ผๅฎๆๅคงๅฐ
|
|
|
254
254
|
|
|
255
255
|
<!-- AGENT LIST -->
|
|
256
256
|
|
|
257
|
-
| ๆ่ฟๆฐๅข | ๅฉๆ่ฏดๆ
|
|
258
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
259
|
-
| [
|
|
260
|
-
| [
|
|
261
|
-
| [
|
|
262
|
-
| [
|
|
263
|
-
|
|
264
|
-
> ๐ Total agents: [<kbd>**
|
|
257
|
+
| ๆ่ฟๆฐๅข | ๅฉๆ่ฏดๆ |
|
|
258
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
259
|
+
| [Omnipedia](https://chat-preview.lobehub.com/market?agent=omnipedia)<br/><sup>By **[thedivergentai](https://github.com/thedivergentai)** on **2024-08-02**</sup> | ไธไธๆไพ้ซ่ดจ้ใๆทฑๅ
ฅ็ ็ฉถ็ๅ็งไธป้ขไฟกๆฏ๏ผๅ
ๆฌๅๅฒใ็งๅญฆใๆๅญฆใ่บๆฏ็ญใๆ
้ฟๆป็ปๅคๆไธป้ข๏ผๅๅฉ็ ็ฉถไปปๅก๏ผๅนถๆไพๅๆๅฏ็คบใ<br/>`artificial-intelligence` `information` `education` `communication` |
|
|
260
|
+
| [ไปฃ็ ๆฏ่ๅคงๅธ](https://chat-preview.lobehub.com/market?agent=code-snark-master)<br/><sup>By **[leter](https://github.com/leter)** on **2024-07-29**</sup> | ๆ
้ฟๅฐๅปๆน่ฏไปฃ็ ๏ผ่ฎฝๅบๆงๅฐๆๅบไฝๆๅๅฏ่ฏปๆง้ฎ้ข<br/>`ๆๆฏ้ขๅฏผ` `ไปฃ็ ๅฎกๆฅ` `่ฎฝๅบ้ฃๆ ผ` `็ผ็จๅจ่ฏข` |
|
|
261
|
+
| [Unity Maestro](https://chat-preview.lobehub.com/market?agent=unity-maestro)<br/><sup>By **[thedivergentai](https://github.com/thedivergentai)** on **2024-07-29**</sup> | Expert Unity Game Development Companion<br/>`game-development` `unity` `software-engineering` |
|
|
262
|
+
| [c ็จๅบๅญฆไน ๅฉๆ](https://chat-preview.lobehub.com/market?agent=sichuan-university-941-c-programming-assistant)<br/><sup>By **[YBGuoYang](https://github.com/YBGuoYang)** on **2024-07-28**</sup> | ่พ
ๅฉๆ่ฟ่ก c ็จๅบ่ฎพ่ฎก็ๅญฆไน <br/>`941` |
|
|
263
|
+
|
|
264
|
+
> ๐ Total agents: [<kbd>**310**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
265
265
|
|
|
266
266
|
<!-- AGENT LIST -->
|
|
267
267
|
|
|
@@ -80,6 +80,17 @@ Further reading:
|
|
|
80
80
|
|
|
81
81
|
For specific content, please refer to the [Feature Flags](/docs/self-hosting/advanced/feature-flags) documentation.
|
|
82
82
|
|
|
83
|
+
### `PROXY_URL`
|
|
84
|
+
|
|
85
|
+
- Type: Optional
|
|
86
|
+
- Description: Used to specify the proxy URL for connecting to external services. The value of this variable should be different in different deployment environments.
|
|
87
|
+
- Default: -
|
|
88
|
+
- Example: `http://127.0.0.1:7890` or `socks5://localhost:7891`
|
|
89
|
+
|
|
90
|
+
<Callout type="info">
|
|
91
|
+
If you're using Docker Desktop on Windows or macOS, it relies on a virtual machine. In this setup, `localhost` / `127.0.0.1` refers to the localhost of the container itself. In such cases, please try using `host.docker.internal` instead of `localhost`.
|
|
92
|
+
</Callout>
|
|
93
|
+
|
|
83
94
|
## Plugin Service
|
|
84
95
|
|
|
85
96
|
### `PLUGINS_INDEX_URL`
|
|
@@ -76,6 +76,18 @@ LobeChat ๅจ้จ็ฝฒๆถๆไพไบไธไบ้ขๅค็้
็ฝฎ้กน๏ผไฝ ๅฏไปฅไฝฟ็จ็ฏๅข
|
|
|
76
76
|
|
|
77
77
|
ๅ
ทไฝ็ๅ
ๅฎนๅฏไปฅๅ่ง [็นๆงๆ ๅฟ](/zh/docs/self-hosting/advanced/feature-flags) ไธญ็่ฏดๆใ
|
|
78
78
|
|
|
79
|
+
### `PROXY_URL`
|
|
80
|
+
|
|
81
|
+
- ็ฑปๅ๏ผๅฏ้
|
|
82
|
+
- ๆ่ฟฐ๏ผ็จไบๆๅฎ่ฟๆฅๅฐๅค้จๆๅก็ไปฃ็ URLใ่ฏฅๅ้็ๅผๅจไธๅ็้จ็ฝฒ็ฏๅขไธญๅบ่ฏฅๆๆไธๅใ
|
|
83
|
+
- ้ป่ฎคๅผ๏ผ-
|
|
84
|
+
- ็คบไพ๏ผ`http://127.0.0.1:7890` ๆ `socks5://localhost:7891`
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
<Callout type="info">
|
|
88
|
+
`Docker Desktop` ๅจ `Windows `ๅ `macOS `ไธ่ตฐ็ๆฏ่ๆๆบๆนๆก๏ผๅฆๆๆฏ `localhost` / `127.0.0.1` ๆฏ่ตฐๅฐ่ช่บซๅฎนๅจ็ `localhost`๏ผๆญคๆถ่ฏทๅฐ่ฏ็จ `host.docker.internal` ๆฟไปฃ `localhost`
|
|
89
|
+
</Callout>
|
|
90
|
+
|
|
79
91
|
## ๆไปถๆๅก
|
|
80
92
|
|
|
81
93
|
### `PLUGINS_INDEX_URL`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"pull": "git pull",
|
|
55
55
|
"release": "semantic-release",
|
|
56
56
|
"self-hosting:docker": "docker build -t lobe-chat:local .",
|
|
57
|
-
"self-hosting:docker-cn": "docker build -t lobe-chat:local --build-arg
|
|
57
|
+
"self-hosting:docker-cn": "docker build -t lobe-chat:local --build-arg USE_CN_MIRROR=true .",
|
|
58
58
|
"start": "next start -p 3210",
|
|
59
59
|
"stylelint": "stylelint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
60
60
|
"test": "npm run test-app && npm run test-server",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const { join } = require('node:path');
|
|
2
|
+
const { Pool } = require('pg');
|
|
3
|
+
const { drizzle } = require('drizzle-orm/node-postgres');
|
|
4
|
+
const migrator = require('drizzle-orm/node-postgres/migrator');
|
|
5
|
+
|
|
6
|
+
if (!process.env.DATABASE_URL) {
|
|
7
|
+
throw new Error('DATABASE_URL is not set, please set it in your environment variables.');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const client = new Pool({ connectionString: process.env.DATABASE_URL });
|
|
11
|
+
|
|
12
|
+
const db = drizzle(client);
|
|
13
|
+
|
|
14
|
+
const runMigrations = async () => {
|
|
15
|
+
console.log('[Database] Start to migration...');
|
|
16
|
+
await migrator.migrate(db, {
|
|
17
|
+
migrationsFolder: join(__dirname, './migrations'),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
console.log('โ
database migration pass.');
|
|
21
|
+
console.log('-------------------------------------');
|
|
22
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
23
|
+
process.exit(0);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line unicorn/prefer-top-level-await
|
|
27
|
+
runMigrations().catch((err) => {
|
|
28
|
+
console.error(
|
|
29
|
+
'โ Database migrate failed. Please check your database is valid and DATABASE_URL is set correctly. The error detail is below:',
|
|
30
|
+
);
|
|
31
|
+
console.error(err);
|
|
32
|
+
// eslint-disable-next-line unicorn/no-process-exit
|
|
33
|
+
process.exit(1);
|
|
34
|
+
});
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
Ai21,
|
|
5
5
|
Ai360,
|
|
6
6
|
Aws,
|
|
7
|
+
Aya,
|
|
7
8
|
Azure,
|
|
8
9
|
Baichuan,
|
|
9
10
|
ByteDance,
|
|
@@ -62,11 +63,12 @@ const ModelIcon = memo<ModelProviderIconProps>(({ model: originModel, size = 12
|
|
|
62
63
|
if (model.includes('moonshot')) return <Moonshot.Avatar size={size} />;
|
|
63
64
|
if (model.includes('qwen')) return <Tongyi.Avatar background={Tongyi.colorPrimary} size={size} />;
|
|
64
65
|
if (model.includes('minmax') || model.includes('abab')) return <Minimax.Avatar size={size} />;
|
|
65
|
-
if (model.includes('mistral') || model.includes('mixtral') || model.includes('codestral')) return <Mistral.Avatar size={size} />;
|
|
66
|
+
if (model.includes('mistral') || model.includes('mixtral') || model.includes('codestral') || model.includes('mathstral')) return <Mistral.Avatar size={size} />;
|
|
66
67
|
if (model.includes('pplx') || model.includes('sonar')) return <Perplexity.Avatar size={size} />;
|
|
67
68
|
if (model.includes('yi-')) return <Yi.Avatar size={size} />;
|
|
68
69
|
if (model.startsWith('openrouter')) return <OpenRouter.Avatar size={size} />; // only for Cinematika and Auto
|
|
69
70
|
if (model.startsWith('openchat')) return <OpenChat.Avatar size={size} />;
|
|
71
|
+
if (model.includes('aya')) return <Aya.Avatar size={size} />;
|
|
70
72
|
if (model.includes('command')) return <Cohere.Avatar size={size} />;
|
|
71
73
|
if (model.includes('dbrx')) return <Dbrx.Avatar size={size} />;
|
|
72
74
|
if (model.includes('step')) return <Stepfun.Avatar size={size} />;
|
|
@@ -96,8 +98,7 @@ const ModelIcon = memo<ModelProviderIconProps>(({ model: originModel, size = 12
|
|
|
96
98
|
)
|
|
97
99
|
return <Stability.Avatar size={size} />;
|
|
98
100
|
|
|
99
|
-
if (model.includes('wizardlm')) return <Azure.Avatar size={size} />;
|
|
100
|
-
if (model.includes('phi3') || model.includes('phi-3')) return <Azure.Avatar size={size} />;
|
|
101
|
+
if (model.includes('phi3') || model.includes('phi-3') || model.includes('wizardlm')) return <Azure.Avatar size={size} />;
|
|
101
102
|
if (model.includes('firefly')) return <Adobe.Avatar size={size} />;
|
|
102
103
|
if (model.includes('jamba') || model.includes('j2-')) return <Ai21.Avatar size={size} />;
|
|
103
104
|
});
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
Ai360,
|
|
5
5
|
AiMass,
|
|
6
6
|
Aws,
|
|
7
|
+
Aya,
|
|
7
8
|
Azure,
|
|
8
9
|
Baichuan,
|
|
9
10
|
ByteDance,
|
|
@@ -62,11 +63,12 @@ const ModelIcon = memo<ModelIconProps>(({ model: originModel, size = 12 }) => {
|
|
|
62
63
|
if (model.includes('qwen')) return <Tongyi size={size} />;
|
|
63
64
|
if (model.includes('minmax')) return <Minimax size={size} />;
|
|
64
65
|
if (model.includes('abab')) return <Minimax size={size} />;
|
|
65
|
-
if (model.includes('mistral') || model.includes('mixtral') || model.includes('codestral')) return <Mistral size={size} />;
|
|
66
|
+
if (model.includes('mistral') || model.includes('mixtral') || model.includes('codestral') || model.includes('mathstral')) return <Mistral size={size} />;
|
|
66
67
|
if (model.includes('pplx') || model.includes('sonar')) return <Perplexity size={size} />;
|
|
67
68
|
if (model.includes('yi-')) return <Yi size={size} />;
|
|
68
69
|
if (model.startsWith('openrouter')) return <OpenRouter size={size} />; // only for Cinematika and Auto
|
|
69
70
|
if (model.startsWith('openchat')) return <OpenChat size={size} />;
|
|
71
|
+
if (model.includes('aya')) return <Aya.Avatar size={size} />;
|
|
70
72
|
if (model.includes('command')) return <Cohere size={size} />;
|
|
71
73
|
if (model.includes('dbrx')) return <Dbrx size={size} />;
|
|
72
74
|
if (model.includes('step')) return <Stepfun size={size} />;
|
|
@@ -95,8 +97,7 @@ const ModelIcon = memo<ModelIconProps>(({ model: originModel, size = 12 }) => {
|
|
|
95
97
|
)
|
|
96
98
|
return <Stability size={size} />;
|
|
97
99
|
|
|
98
|
-
if (model.includes('wizardlm')) return <Azure size={size} />;
|
|
99
|
-
if (model.includes('phi3') || model.includes('phi-3')) return <Azure size={size} />;
|
|
100
|
+
if (model.includes('phi3') || model.includes('phi-3') || model.includes('wizardlm')) return <Azure.Avatar size={size} />;
|
|
100
101
|
if (model.includes('firefly')) return <AdobeFirefly size={size} />;
|
|
101
102
|
if (model.includes('jamba') || model.includes('j2-')) return <Ai21 size={size} />;
|
|
102
103
|
});
|
|
@@ -37,6 +37,7 @@ const Bedrock: ModelProviderCard = {
|
|
|
37
37
|
'Claude 3 Opus ๆฏ Anthropic ๆๅผบๅคง็ไบบๅทฅๆบ่ฝๆจกๅ๏ผๅจๅค็้ซๅบฆๅคๆ็ไปปๅกๆน้ขๅ
ทๅค้กถๅฐๆง่ฝใ่ฏฅๆจกๅ่ฝๅคไปฅ้ๅก็ๆต็
ๆงๅ็ฑปไผผไบบ็ฑป็็่งฃ่ฝๅๅผๅฏผๅผๆพๅผ็ๆ็คบๅๆชๅฏ่ง็ๅบๆฏใClaude 3 Opus ๅๆไปฌๅฑ็คบ็ๆๅผไบบๅทฅๆบ่ฝ็็พๅฅฝๅๆฏใ Claude 3 Opus ๅฏไปฅๅค็ๅพๅๅ่ฟๅๆๆฌ่พๅบ๏ผๅนถไธๆไพ 200K ไธไธๆ็ชๅฃใ',
|
|
38
38
|
displayName: 'Claude 3 Opus',
|
|
39
39
|
enabled: true,
|
|
40
|
+
functionCall: true,
|
|
40
41
|
id: 'anthropic.claude-3-opus-20240229-v1:0',
|
|
41
42
|
tokens: 200_000,
|
|
42
43
|
vision: true,
|
|
@@ -46,6 +47,7 @@ const Bedrock: ModelProviderCard = {
|
|
|
46
47
|
'Anthropic ๆจๅบ็ Claude 3 Sonnet ๆจกๅๅจๆบ่ฝๅ้ๅบฆไน้ดๅๅพ็ๆณ็ๅนณ่กก๏ผๅฐคๅ
ถๆฏๅจๅค็ไผไธๅทฅไฝ่ด่ฝฝๆน้ขใ่ฏฅๆจกๅๆไพๆๅคง็ๆ็จ๏ผๅๆถไปทๆ ผไฝไบ็ซไบไบงๅ๏ผๅนถไธๅ
ถ็ป่ฟ็ฒพๅฟ่ฎพ่ฎก๏ผๆฏๅคง่งๆจก้จ็ฝฒไบบๅทฅๆบ่ฝ็ๅฏไฟก่ตใ้ซ่ไน
ๆง้ชจๅนฒๆจกๅใ Claude 3 Sonnet ๅฏไปฅๅค็ๅพๅๅ่ฟๅๆๆฌ่พๅบ๏ผๅนถไธๆไพ 200K ไธไธๆ็ชๅฃใ',
|
|
47
48
|
displayName: 'Claude 3 Sonnet',
|
|
48
49
|
enabled: true,
|
|
50
|
+
functionCall: true,
|
|
49
51
|
id: 'anthropic.claude-3-sonnet-20240229-v1:0',
|
|
50
52
|
tokens: 200_000,
|
|
51
53
|
vision: true,
|
|
@@ -55,6 +57,7 @@ const Bedrock: ModelProviderCard = {
|
|
|
55
57
|
'Claude 3.5 Sonnet ๆ้ซไบ่กไธ็ๆบ่ฝๆ ๅ, ๅจๅนฟๆณ็ๅบๅๆต่ฏไธญ่ถ
่ถไบ็ซไบๅฏนๆๆจกๅไปฅๅ Claude 3 Opus, ไปฅไธญ็ซฏๆจกๅ็้ๅบฆๅๆๆฌ๏ผๅฑ็ฐๅบๅ่ถๆง่ฝใ Claude 3.5 Sonnet ๅฏไปฅๅค็ๅพๅๅ่ฟๅๆๆฌ่พๅบ๏ผๅนถไธๆไพ 200K ไธไธๆ็ชๅฃใ',
|
|
56
58
|
displayName: 'Claude 3.5 Sonnet',
|
|
57
59
|
enabled: true,
|
|
60
|
+
functionCall: true,
|
|
58
61
|
id: 'anthropic.claude-3-5-sonnet-20240620-v1:0',
|
|
59
62
|
tokens: 200_000,
|
|
60
63
|
vision: true,
|
|
@@ -64,6 +67,7 @@ const Bedrock: ModelProviderCard = {
|
|
|
64
67
|
'Claude 3 Haiku ๆฏ Anthropic ๆๅฟซ้ใๆ็ดงๅ็ๆจกๅ๏ผๅ
ทๆ่ฟไนๅณๆถ็ๅๅบ่ฝๅใ่ฏฅๆจกๅๅฏไปฅๅฟซ้ๅ็ญ็ฎๅ็ๆฅ่ฏขๅ่ฏทๆฑใๅฎขๆทๅฐ่ฝๅคๆๅปบๆจกไปฟไบบ็ฑปไบคไบ็ๆ ็ผไบบๅทฅๆบ่ฝไฝ้ชใ Claude 3 Haiku ๅฏไปฅๅค็ๅพๅๅ่ฟๅๆๆฌ่พๅบ๏ผๅนถไธๆไพ 200K ไธไธๆ็ชๅฃใ',
|
|
65
68
|
displayName: 'Claude 3 Haiku',
|
|
66
69
|
enabled: true,
|
|
70
|
+
functionCall: true,
|
|
67
71
|
id: 'anthropic.claude-3-haiku-20240307-v1:0',
|
|
68
72
|
tokens: 200_000,
|
|
69
73
|
vision: true,
|
|
@@ -4,65 +4,52 @@ import { ModelProviderCard } from '@/types/llm';
|
|
|
4
4
|
const Ollama: ModelProviderCard = {
|
|
5
5
|
chatModels: [
|
|
6
6
|
{
|
|
7
|
-
displayName: 'Llama3 8B',
|
|
7
|
+
displayName: 'Llama3.1 8B',
|
|
8
8
|
enabled: true,
|
|
9
|
-
id: 'llama3',
|
|
10
|
-
tokens:
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
displayName: 'Llama3 70B',
|
|
14
|
-
id: 'llama3:70b',
|
|
15
|
-
tokens: 8000,
|
|
9
|
+
id: 'llama3.1',
|
|
10
|
+
tokens: 128_000,
|
|
16
11
|
},
|
|
17
12
|
{
|
|
18
|
-
displayName: '
|
|
19
|
-
|
|
20
|
-
id: 'phi3',
|
|
13
|
+
displayName: 'Llama3.1 70B',
|
|
14
|
+
id: 'llama3.1:70b',
|
|
21
15
|
tokens: 128_000,
|
|
22
16
|
},
|
|
23
17
|
{
|
|
24
|
-
displayName: '
|
|
25
|
-
id: '
|
|
18
|
+
displayName: 'Llama3.1 405B',
|
|
19
|
+
id: 'llama3.1:405b',
|
|
26
20
|
tokens: 128_000,
|
|
27
21
|
},
|
|
28
22
|
{
|
|
29
|
-
displayName: '
|
|
23
|
+
displayName: 'Code Llama 7B',
|
|
30
24
|
enabled: true,
|
|
31
|
-
id: '
|
|
32
|
-
tokens:
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
displayName: 'Aya 23 35B',
|
|
36
|
-
id: 'aya:35b',
|
|
37
|
-
tokens: 8192,
|
|
25
|
+
id: 'codellama',
|
|
26
|
+
tokens: 16_384,
|
|
38
27
|
},
|
|
39
28
|
{
|
|
40
|
-
displayName: '
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
tokens: 128_000,
|
|
29
|
+
displayName: 'Code Llama 13B',
|
|
30
|
+
id: 'codellama:13b',
|
|
31
|
+
tokens: 16_384,
|
|
44
32
|
},
|
|
45
33
|
{
|
|
46
|
-
displayName: '
|
|
47
|
-
id: '
|
|
48
|
-
tokens:
|
|
34
|
+
displayName: 'Code Llama 34B',
|
|
35
|
+
id: 'codellama:34b',
|
|
36
|
+
tokens: 16_384,
|
|
49
37
|
},
|
|
50
38
|
{
|
|
51
|
-
displayName: '
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
tokens: 131_072, // https://huggingface.co/CohereForAI/c4ai-command-r-v01/blob/main/config.json
|
|
39
|
+
displayName: 'Code Llama 70B',
|
|
40
|
+
id: 'codellama:70b',
|
|
41
|
+
tokens: 16_384,
|
|
55
42
|
},
|
|
56
43
|
{
|
|
57
|
-
displayName: '
|
|
58
|
-
id: '
|
|
59
|
-
tokens:
|
|
44
|
+
displayName: 'Gemma2 2B',
|
|
45
|
+
id: 'gemma2:2b',
|
|
46
|
+
tokens: 8192,
|
|
60
47
|
},
|
|
61
48
|
{
|
|
62
49
|
displayName: 'Gemma2 9B',
|
|
63
50
|
enabled: true,
|
|
64
51
|
id: 'gemma2',
|
|
65
|
-
tokens: 8192,
|
|
52
|
+
tokens: 8192,
|
|
66
53
|
},
|
|
67
54
|
{
|
|
68
55
|
displayName: 'Gemma2 27B',
|
|
@@ -70,134 +57,156 @@ const Ollama: ModelProviderCard = {
|
|
|
70
57
|
tokens: 8192,
|
|
71
58
|
},
|
|
72
59
|
{
|
|
73
|
-
displayName: '
|
|
74
|
-
id: '
|
|
75
|
-
tokens: 8192,
|
|
60
|
+
displayName: 'CodeGemma 2B',
|
|
61
|
+
id: 'codegemma:2b',
|
|
62
|
+
tokens: 8192,
|
|
76
63
|
},
|
|
77
64
|
{
|
|
78
|
-
displayName: '
|
|
79
|
-
|
|
65
|
+
displayName: 'CodeGemma 7B',
|
|
66
|
+
enabled: true,
|
|
67
|
+
id: 'codegemma',
|
|
80
68
|
tokens: 8192,
|
|
81
69
|
},
|
|
82
70
|
{
|
|
83
|
-
displayName: '
|
|
71
|
+
displayName: 'Phi-3 3.8B',
|
|
84
72
|
enabled: true,
|
|
85
|
-
id: '
|
|
86
|
-
tokens:
|
|
73
|
+
id: 'phi3',
|
|
74
|
+
tokens: 128_000,
|
|
87
75
|
},
|
|
88
76
|
{
|
|
89
|
-
displayName: '
|
|
90
|
-
id: '
|
|
77
|
+
displayName: 'Phi-3 14B',
|
|
78
|
+
id: 'phi3:14b',
|
|
91
79
|
tokens: 128_000,
|
|
92
80
|
},
|
|
93
81
|
{
|
|
94
|
-
displayName: '
|
|
82
|
+
displayName: 'WizardLM 2 7B',
|
|
95
83
|
enabled: true,
|
|
96
|
-
id: '
|
|
97
|
-
tokens:
|
|
84
|
+
id: 'wizardlm2',
|
|
85
|
+
tokens: 32_768,
|
|
98
86
|
},
|
|
99
87
|
{
|
|
100
|
-
displayName: '
|
|
101
|
-
id: '
|
|
102
|
-
tokens:
|
|
88
|
+
displayName: 'WizardLM 2 8x22B',
|
|
89
|
+
id: 'wizardlm2:8x22b',
|
|
90
|
+
tokens: 65_536,
|
|
103
91
|
},
|
|
104
92
|
{
|
|
105
|
-
displayName: '
|
|
106
|
-
|
|
107
|
-
|
|
93
|
+
displayName: 'Mathฮฃtral 7B',
|
|
94
|
+
enabled: true,
|
|
95
|
+
id: 'mathstral',
|
|
96
|
+
tokens: 32_768,
|
|
108
97
|
},
|
|
109
98
|
{
|
|
110
|
-
displayName: '
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
displayName: 'Mistral 7B',
|
|
100
|
+
enabled: true,
|
|
101
|
+
id: 'mistral',
|
|
102
|
+
tokens: 32_768,
|
|
113
103
|
},
|
|
114
104
|
{
|
|
115
|
-
displayName: '
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
displayName: 'Mixtral 8x7B',
|
|
106
|
+
enabled: true,
|
|
107
|
+
id: 'mixtral',
|
|
108
|
+
tokens: 32_768,
|
|
118
109
|
},
|
|
119
110
|
{
|
|
120
|
-
displayName: '
|
|
121
|
-
id: '
|
|
122
|
-
tokens:
|
|
111
|
+
displayName: 'Mixtral 8x22B',
|
|
112
|
+
id: 'mixtral:8x22b',
|
|
113
|
+
tokens: 65_536,
|
|
123
114
|
},
|
|
124
115
|
{
|
|
125
|
-
displayName: '
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
displayName: 'Mixtral Large 123B',
|
|
117
|
+
enabled: true,
|
|
118
|
+
id: 'mistral-large',
|
|
119
|
+
tokens: 128_000,
|
|
128
120
|
},
|
|
129
121
|
{
|
|
130
|
-
displayName: '
|
|
122
|
+
displayName: 'Mixtral Nemo 12B',
|
|
131
123
|
enabled: true,
|
|
132
|
-
id: '
|
|
133
|
-
tokens:
|
|
124
|
+
id: 'mistral-nemo',
|
|
125
|
+
tokens: 128_000,
|
|
134
126
|
},
|
|
135
127
|
{
|
|
136
|
-
displayName: '
|
|
137
|
-
|
|
138
|
-
|
|
128
|
+
displayName: 'Codestral 22B',
|
|
129
|
+
enabled: true,
|
|
130
|
+
id: 'codestral',
|
|
131
|
+
tokens: 32_768,
|
|
139
132
|
},
|
|
140
133
|
{
|
|
141
|
-
displayName: '
|
|
142
|
-
|
|
143
|
-
|
|
134
|
+
displayName: 'Aya 23 8B',
|
|
135
|
+
enabled: true,
|
|
136
|
+
id: 'aya',
|
|
137
|
+
tokens: 8192,
|
|
144
138
|
},
|
|
145
139
|
{
|
|
146
|
-
displayName: '
|
|
147
|
-
id: '
|
|
148
|
-
tokens:
|
|
140
|
+
displayName: 'Aya 23 35B',
|
|
141
|
+
id: 'aya:35b',
|
|
142
|
+
tokens: 8192,
|
|
149
143
|
},
|
|
150
144
|
{
|
|
151
|
-
displayName: '
|
|
152
|
-
|
|
153
|
-
|
|
145
|
+
displayName: 'Command R 35B',
|
|
146
|
+
enabled: true,
|
|
147
|
+
id: 'command-r',
|
|
148
|
+
tokens: 131_072,
|
|
154
149
|
},
|
|
155
150
|
{
|
|
156
|
-
displayName: '
|
|
157
|
-
|
|
158
|
-
|
|
151
|
+
displayName: 'Command R+ 104B',
|
|
152
|
+
enabled: true,
|
|
153
|
+
id: 'command-r-plus',
|
|
154
|
+
tokens: 131_072,
|
|
159
155
|
},
|
|
160
156
|
{
|
|
161
|
-
displayName: '
|
|
157
|
+
displayName: 'DeepSeek V2 16B',
|
|
162
158
|
enabled: true,
|
|
163
|
-
id: '
|
|
164
|
-
tokens:
|
|
159
|
+
id: 'deepseek-v2',
|
|
160
|
+
tokens: 32_768,
|
|
165
161
|
},
|
|
166
162
|
{
|
|
167
|
-
displayName: '
|
|
163
|
+
displayName: 'DeepSeek V2 236B',
|
|
164
|
+
id: 'deepseek-v2:236b',
|
|
165
|
+
tokens: 128_000,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
displayName: 'DeepSeek Coder V2 16B',
|
|
168
169
|
enabled: true,
|
|
169
|
-
id: '
|
|
170
|
-
tokens:
|
|
170
|
+
id: 'deepseek-coder-v2',
|
|
171
|
+
tokens: 128_000,
|
|
171
172
|
},
|
|
172
173
|
{
|
|
173
|
-
displayName: '
|
|
174
|
-
id: '
|
|
175
|
-
tokens:
|
|
174
|
+
displayName: 'DeepSeek Coder V2 236B',
|
|
175
|
+
id: 'deepseek-coder-v2:236b',
|
|
176
|
+
tokens: 128_000,
|
|
176
177
|
},
|
|
177
178
|
{
|
|
178
|
-
displayName: '
|
|
179
|
-
id: '
|
|
180
|
-
tokens:
|
|
179
|
+
displayName: 'Qwen2 0.5B',
|
|
180
|
+
id: 'qwen2:0.5b',
|
|
181
|
+
tokens: 128_000,
|
|
181
182
|
},
|
|
182
183
|
{
|
|
183
|
-
displayName: '
|
|
184
|
-
id: '
|
|
185
|
-
tokens:
|
|
184
|
+
displayName: 'Qwen2 1.5B',
|
|
185
|
+
id: 'qwen2:1.5b',
|
|
186
|
+
tokens: 128_000,
|
|
186
187
|
},
|
|
187
188
|
{
|
|
188
|
-
displayName: '
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
displayName: 'Qwen2 7B',
|
|
190
|
+
enabled: true,
|
|
191
|
+
id: 'qwen2',
|
|
192
|
+
tokens: 128_000,
|
|
191
193
|
},
|
|
192
194
|
{
|
|
193
|
-
displayName: '
|
|
194
|
-
id: '
|
|
195
|
-
tokens:
|
|
195
|
+
displayName: 'Qwen2 72B',
|
|
196
|
+
id: 'qwen2:72b',
|
|
197
|
+
tokens: 128_000,
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'CodeQwen1.5 7B',
|
|
201
|
+
enabled: true,
|
|
202
|
+
id: 'codeqwen',
|
|
203
|
+
tokens: 65_536,
|
|
196
204
|
},
|
|
197
205
|
{
|
|
198
206
|
displayName: 'LLaVA 7B',
|
|
207
|
+
enabled: true,
|
|
199
208
|
id: 'llava',
|
|
200
|
-
tokens: 4096,
|
|
209
|
+
tokens: 4096,
|
|
201
210
|
vision: true,
|
|
202
211
|
},
|
|
203
212
|
{
|
|
@@ -7,7 +7,7 @@ import { experimental_buildLlama2Prompt } from 'ai/prompts';
|
|
|
7
7
|
import { LobeRuntimeAI } from '../BaseAI';
|
|
8
8
|
import { AgentRuntimeErrorType } from '../error';
|
|
9
9
|
import { ChatCompetitionOptions, ChatStreamPayload, ModelProvider } from '../types';
|
|
10
|
-
import { buildAnthropicMessages } from '../utils/anthropicHelpers';
|
|
10
|
+
import { buildAnthropicMessages, buildAnthropicTools } from '../utils/anthropicHelpers';
|
|
11
11
|
import { AgentRuntimeError } from '../utils/createError';
|
|
12
12
|
import { debugStream } from '../utils/debugStream';
|
|
13
13
|
import { StreamingResponse } from '../utils/response';
|
|
@@ -53,7 +53,7 @@ export class LobeBedrockAI implements LobeRuntimeAI {
|
|
|
53
53
|
payload: ChatStreamPayload,
|
|
54
54
|
options?: ChatCompetitionOptions,
|
|
55
55
|
): Promise<Response> => {
|
|
56
|
-
const { max_tokens, messages, model, temperature, top_p } = payload;
|
|
56
|
+
const { max_tokens, messages, model, temperature, top_p, tools } = payload;
|
|
57
57
|
const system_message = messages.find((m) => m.role === 'system');
|
|
58
58
|
const user_messages = messages.filter((m) => m.role !== 'system');
|
|
59
59
|
|
|
@@ -65,6 +65,7 @@ export class LobeBedrockAI implements LobeRuntimeAI {
|
|
|
65
65
|
messages: buildAnthropicMessages(user_messages),
|
|
66
66
|
system: system_message?.content as string,
|
|
67
67
|
temperature: temperature,
|
|
68
|
+
tools: buildAnthropicTools(tools),
|
|
68
69
|
top_p: top_p,
|
|
69
70
|
}),
|
|
70
71
|
contentType: 'application/json',
|
|
@@ -145,13 +145,9 @@ export function LobeNextAuthDbAdapter(serverDB: NeonDatabase<typeof schema>): Ad
|
|
|
145
145
|
},
|
|
146
146
|
|
|
147
147
|
async getUser(id): Promise<AdapterUser | null> {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return mapLobeUserToAdapterUser(lobeUser);
|
|
152
|
-
} catch {
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
148
|
+
const lobeUser = await UserModel.findById(id);
|
|
149
|
+
if (!lobeUser) return null;
|
|
150
|
+
return mapLobeUserToAdapterUser(lobeUser);
|
|
155
151
|
},
|
|
156
152
|
|
|
157
153
|
async getUserByAccount(account): Promise<AdapterUser | null> {
|