@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 CHANGED
@@ -4,7 +4,6 @@ node_modules
4
4
  npm-debug.log
5
5
  .next
6
6
  .git
7
- scripts
8
7
  docs
9
8
  .github
10
9
  *.md
@@ -6,9 +6,10 @@
6
6
  - [ ] ๐Ÿ› fix
7
7
  - [ ] โ™ป๏ธ refactor
8
8
  - [ ] ๐Ÿ’„ style
9
- - [ ] ๐Ÿ”จ chore
9
+ - [ ] ๐Ÿ‘ท build
10
10
  - [ ] โšก๏ธ perf
11
11
  - [ ] ๐Ÿ“ docs
12
+ - [ ] ๐Ÿ”จ chore
12
13
 
13
14
  #### ๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change
14
15
 
@@ -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
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#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
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#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 USE_NPM_CN_MIRROR
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 USE_NPM_CN_MIRROR=true
41
- if [ "${USE_NPM_CN_MIRROR:-false}" = "true" ]; then \
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
- FEATURE_FLAGS=""
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 ["node", "/app/server.js"]
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
- | [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` |
272
- | [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` |
273
- | [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` |
274
- | [Brand Pioneer](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | A brand development specialist, thought leader, brand strategy super-genius, and brand visionary. Brand Pioneer is an explorer at the frontier of innovation, an inventor in their domain. Provide them with your market and let them imagine a future world characterized by groundbreaking advancements in your field of expertise.<br/>`business` `brand-pioneer` `brand-development` `business-assistant` `brand-narrative` |
275
-
276
- > ๐Ÿ“Š Total agents: [<kbd>**309**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
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
- | [ไปฃ็ ๆฏ’่ˆŒๅคงๅธˆ](https://chat-preview.lobehub.com/market?agent=code-snark-master)<br/><sup>By **[leter](https://github.com/leter)** on **2024-07-29**</sup> | ๆ“…้•ฟๅฐ–ๅˆปๆ‰น่ฏ„ไปฃ็ ๏ผŒ่ฎฝๅˆบๆ€งๅœฐๆŒ‡ๅ‡บไฝŽๆ•ˆๅ’Œๅฏ่ฏปๆ€ง้—ฎ้ข˜<br/>`ๆŠ€ๆœฏ้ข†ๅฏผ` `ไปฃ็ ๅฎกๆŸฅ` `่ฎฝๅˆบ้ฃŽๆ ผ` `็ผ–็จ‹ๅ’จ่ฏข` |
260
- | [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` |
261
- | [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` |
262
- | [ๅ“็‰Œๅ…ˆ้”‹](https://chat-preview.lobehub.com/market?agent=brand-pioneer)<br/><sup>By **[SaintFresh](https://github.com/SaintFresh)** on **2024-07-25**</sup> | ไธ€ไฝๅ“็‰Œๅ‘ๅฑ•ไธ“ๅฎถใ€ๆ€ๆƒณ้ข†่ข–ใ€ๅ“็‰Œๆˆ˜็•ฅ่ถ…็บงๅคฉๆ‰ๅ’Œๅ“็‰Œ่ฟœ่ง่€…ใ€‚ๅ“็‰Œๅ…ˆ้”‹ๆ˜ฏๅˆ›ๆ–ฐๅ‰ๆฒฟ็š„ๆŽข้™ฉๅฎถ๏ผŒๅœจๅ…ถ้ข†ๅŸŸๆ˜ฏไธ€ไฝๅ‘ๆ˜Žๅฎถใ€‚ๅฐ†ๆ‚จ็š„ๅธ‚ๅœบๆไพ›็ป™ไป–ไปฌ๏ผŒ่ฎฉไป–ไปฌๆƒณ่ฑกไธ€ไธชๆœชๆฅไธ–็•Œ๏ผŒๅ…ถไธญไปฅๆ‚จ็š„ไธ“ไธš้ข†ๅŸŸ็š„็ช็ ดๆ€ง่ฟ›ๅฑ•ไธบ็‰นๅพใ€‚<br/>`ๅ•†ไธš` `ๅ“็‰Œๅ…ˆ้”‹` `ๅ“็‰Œๅ‘ๅฑ•` `ๅ•†ไธšๅŠฉๆ‰‹` `ๅ“็‰Œๅ™ไบ‹` |
263
-
264
- > ๐Ÿ“Š Total agents: [<kbd>**309**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
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.0",
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 USE_NPM_CN_MIRROR=true .",
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: 8000, // https://huggingface.co/blog/zh/llama3#llama-3-็š„ๆ–ฐ่ฟ›ๅฑ•
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: 'Phi-3 3.8B',
19
- enabled: true,
20
- id: 'phi3',
13
+ displayName: 'Llama3.1 70B',
14
+ id: 'llama3.1:70b',
21
15
  tokens: 128_000,
22
16
  },
23
17
  {
24
- displayName: 'Phi-3 14B',
25
- id: 'phi3:14b',
18
+ displayName: 'Llama3.1 405B',
19
+ id: 'llama3.1:405b',
26
20
  tokens: 128_000,
27
21
  },
28
22
  {
29
- displayName: 'Aya 23 8B',
23
+ displayName: 'Code Llama 7B',
30
24
  enabled: true,
31
- id: 'aya',
32
- tokens: 8192, // https://cohere.com/research/papers/aya-command-23-8b-and-35b-technical-report-2024-05-23
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: 'Qwen2 7B',
41
- enabled: true,
42
- id: 'qwen2',
43
- tokens: 128_000,
29
+ displayName: 'Code Llama 13B',
30
+ id: 'codellama:13b',
31
+ tokens: 16_384,
44
32
  },
45
33
  {
46
- displayName: 'Qwen2 72B',
47
- id: 'qwen2:72b',
48
- tokens: 128_000,
34
+ displayName: 'Code Llama 34B',
35
+ id: 'codellama:34b',
36
+ tokens: 16_384,
49
37
  },
50
38
  {
51
- displayName: 'Command R 35B',
52
- enabled: true,
53
- id: 'command-r',
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: 'Command R+ 104B (Q2_K)',
58
- id: 'command-r-plus:104b-q2_K',
59
- tokens: 131_072, // https://huggingface.co/CohereForAI/c4ai-command-r-plus/blob/main/config.json
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, // https://huggingface.co/blog/zh/gemma2
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: 'Gemma 7B',
74
- id: 'gemma',
75
- tokens: 8192, // https://huggingface.co/google/gemma-7b-it/discussions/73#65e9678c0cda621164a95bad
60
+ displayName: 'CodeGemma 2B',
61
+ id: 'codegemma:2b',
62
+ tokens: 8192,
76
63
  },
77
64
  {
78
- displayName: 'Gemma 2B',
79
- id: 'gemma:2b',
65
+ displayName: 'CodeGemma 7B',
66
+ enabled: true,
67
+ id: 'codegemma',
80
68
  tokens: 8192,
81
69
  },
82
70
  {
83
- displayName: 'Deepseek V2 16B',
71
+ displayName: 'Phi-3 3.8B',
84
72
  enabled: true,
85
- id: 'deepseek-v2',
86
- tokens: 32_000,
73
+ id: 'phi3',
74
+ tokens: 128_000,
87
75
  },
88
76
  {
89
- displayName: 'Deepseek V2 236B',
90
- id: 'deepseek-v2:236b',
77
+ displayName: 'Phi-3 14B',
78
+ id: 'phi3:14b',
91
79
  tokens: 128_000,
92
80
  },
93
81
  {
94
- displayName: 'Deepseek Coder V2 16B', // https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct
82
+ displayName: 'WizardLM 2 7B',
95
83
  enabled: true,
96
- id: 'deepseek-coder-v2',
97
- tokens: 128_000,
84
+ id: 'wizardlm2',
85
+ tokens: 32_768,
98
86
  },
99
87
  {
100
- displayName: 'Deepseek Coder V2 236B', // https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct
101
- id: 'deepseek-coder-v2:236b',
102
- tokens: 128_000,
88
+ displayName: 'WizardLM 2 8x22B',
89
+ id: 'wizardlm2:8x22b',
90
+ tokens: 65_536,
103
91
  },
104
92
  {
105
- displayName: 'Llama2 Chat 13B',
106
- id: 'llama2:13b',
107
- tokens: 4096, // https://llama.meta.com/llama2/
93
+ displayName: 'Mathฮฃtral 7B',
94
+ enabled: true,
95
+ id: 'mathstral',
96
+ tokens: 32_768,
108
97
  },
109
98
  {
110
- displayName: 'Llama2 Chat 7B',
111
- id: 'llama2',
112
- tokens: 4096,
99
+ displayName: 'Mistral 7B',
100
+ enabled: true,
101
+ id: 'mistral',
102
+ tokens: 32_768,
113
103
  },
114
104
  {
115
- displayName: 'Llama2 Chat 70B',
116
- id: 'llama2:70b',
117
- tokens: 4096,
105
+ displayName: 'Mixtral 8x7B',
106
+ enabled: true,
107
+ id: 'mixtral',
108
+ tokens: 32_768,
118
109
  },
119
110
  {
120
- displayName: 'Llama2 CN 13B',
121
- id: 'llama2-chinese:13b',
122
- tokens: 4096,
111
+ displayName: 'Mixtral 8x22B',
112
+ id: 'mixtral:8x22b',
113
+ tokens: 65_536,
123
114
  },
124
115
  {
125
- displayName: 'Llama2 CN 7B',
126
- id: 'llama2-chinese',
127
- tokens: 4096,
116
+ displayName: 'Mixtral Large 123B',
117
+ enabled: true,
118
+ id: 'mistral-large',
119
+ tokens: 128_000,
128
120
  },
129
121
  {
130
- displayName: 'WizardLM 2 7B',
122
+ displayName: 'Mixtral Nemo 12B',
131
123
  enabled: true,
132
- id: 'wizardlm2',
133
- tokens: 65_536,
124
+ id: 'mistral-nemo',
125
+ tokens: 128_000,
134
126
  },
135
127
  {
136
- displayName: 'WizardLM 2 8x22B',
137
- id: 'wizardlm2:8x22b',
138
- tokens: 65_536,
128
+ displayName: 'Codestral 22B',
129
+ enabled: true,
130
+ id: 'codestral',
131
+ tokens: 32_768,
139
132
  },
140
133
  {
141
- displayName: 'Code Llama 7B',
142
- id: 'codellama',
143
- tokens: 16_384, // https://huggingface.co/codellama/CodeLlama-7b-hf/blob/main/config.json
134
+ displayName: 'Aya 23 8B',
135
+ enabled: true,
136
+ id: 'aya',
137
+ tokens: 8192,
144
138
  },
145
139
  {
146
- displayName: 'Code Llama 34B',
147
- id: 'codellama:34b',
148
- tokens: 16_384,
140
+ displayName: 'Aya 23 35B',
141
+ id: 'aya:35b',
142
+ tokens: 8192,
149
143
  },
150
144
  {
151
- displayName: 'Code Llama 70B',
152
- id: 'codellama:70b',
153
- tokens: 16_384,
145
+ displayName: 'Command R 35B',
146
+ enabled: true,
147
+ id: 'command-r',
148
+ tokens: 131_072,
154
149
  },
155
150
  {
156
- displayName: 'Code Llama 7B (Python)',
157
- id: 'codellama:python',
158
- tokens: 16_384,
151
+ displayName: 'Command R+ 104B',
152
+ enabled: true,
153
+ id: 'command-r-plus',
154
+ tokens: 131_072,
159
155
  },
160
156
  {
161
- displayName: 'Mathฮฃtral',
157
+ displayName: 'DeepSeek V2 16B',
162
158
  enabled: true,
163
- id: 'mathstral',
164
- tokens: 32_000, // https://huggingface.co/mistralai/mathstral-7B-v0.1
159
+ id: 'deepseek-v2',
160
+ tokens: 32_768,
165
161
  },
166
162
  {
167
- displayName: 'Mixtral 8x7B',
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: 'mixtral',
170
- tokens: 32_768,
170
+ id: 'deepseek-coder-v2',
171
+ tokens: 128_000,
171
172
  },
172
173
  {
173
- displayName: 'Mixtral 8x22B',
174
- id: 'mixtral:8x22b',
175
- tokens: 65_536, // https://huggingface.co/mistralai/Mixtral-8x22B-v0.1/blob/main/config.json
174
+ displayName: 'DeepSeek Coder V2 236B',
175
+ id: 'deepseek-coder-v2:236b',
176
+ tokens: 128_000,
176
177
  },
177
178
  {
178
- displayName: 'Qwen Chat 4B',
179
- id: 'qwen',
180
- tokens: 32_768,
179
+ displayName: 'Qwen2 0.5B',
180
+ id: 'qwen2:0.5b',
181
+ tokens: 128_000,
181
182
  },
182
183
  {
183
- displayName: 'Qwen Chat 7B',
184
- id: 'qwen:7b',
185
- tokens: 32_768,
184
+ displayName: 'Qwen2 1.5B',
185
+ id: 'qwen2:1.5b',
186
+ tokens: 128_000,
186
187
  },
187
188
  {
188
- displayName: 'Qwen Chat 14B',
189
- id: 'qwen:14b',
190
- tokens: 32_768,
189
+ displayName: 'Qwen2 7B',
190
+ enabled: true,
191
+ id: 'qwen2',
192
+ tokens: 128_000,
191
193
  },
192
194
  {
193
- displayName: 'Qwen Chat 72B',
194
- id: 'qwen:72b',
195
- tokens: 32_768,
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, // https://huggingface.co/llava-hf/llava-1.5-7b-hf/blob/main/config.json
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
- try {
149
- const lobeUser = await UserModel.findById(id);
150
- if (!lobeUser) return null;
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> {