@lobehub/chat 1.8.0 → 1.8.1
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 +25 -0
- package/Dockerfile.database +170 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/package.json +1 -1
- 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,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.8.1](https://github.com/lobehub/lobe-chat/compare/v1.8.0...v1.8.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-08-03**</sup>
|
|
8
|
+
|
|
9
|
+
#### 💄 Styles
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix `aya`, `mathstral` model tag icon & update ollama model info.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### Styles
|
|
19
|
+
|
|
20
|
+
- **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))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 1.8.0](https://github.com/lobehub/lobe-chat/compare/v1.7.10...v1.8.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2024-08-02**</sup>
|
|
@@ -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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
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",
|
|
@@ -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> {
|