@lobehub/chat 1.15.16 → 1.15.18

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/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.15.18](https://github.com/lobehub/lobe-chat/compare/v1.15.17...v1.15.18)
6
+
7
+ <sup>Released on **2024-09-06**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Support anthropic browser request.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Support anthropic browser request, closes [#3798](https://github.com/lobehub/lobe-chat/issues/3798) ([743df51](https://github.com/lobehub/lobe-chat/commit/743df51))
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.15.17](https://github.com/lobehub/lobe-chat/compare/v1.15.16...v1.15.17)
31
+
32
+ <sup>Released on **2024-09-06**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix auth log.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix auth log, closes [#3795](https://github.com/lobehub/lobe-chat/issues/3795) ([71aa405](https://github.com/lobehub/lobe-chat/commit/71aa405))
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.15.16](https://github.com/lobehub/lobe-chat/compare/v1.15.15...v1.15.16)
6
56
 
7
57
  <sup>Released on **2024-09-06**</sup>
package/README.md CHANGED
@@ -462,8 +462,8 @@ If you want to deploy this service yourself on either Vercel or Zeabur, you can
462
462
 
463
463
  <div align="center">
464
464
 
465
- | Deploy with Vercel | Deploy with Zeabur | Deploy with Sealos | Deploy with RepoCloud |
466
- | :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :------------------------------------------------------------: |
465
+ | Deploy with Vercel | Deploy with Zeabur | Deploy with Sealos | Deploy with RepoCloud |
466
+ | :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------------: |
467
467
  | [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | [![][deploy-on-repocloud-button-image]][deploy-on-repocloud-link] |
468
468
 
469
469
  </div>
@@ -711,12 +711,12 @@ This project is [Apache 2.0](./LICENSE) licensed.
711
711
  [codespaces-shield]: https://github.com/codespaces/badge.svg
712
712
  [deploy-button-image]: https://vercel.com/button
713
713
  [deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat
714
+ [deploy-on-repocloud-button-image]: https://d16t0pc4846x52.cloudfront.net/deploylobe.svg
715
+ [deploy-on-repocloud-link]: https://repocloud.io/details/?app_id=248
714
716
  [deploy-on-sealos-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg
715
717
  [deploy-on-sealos-link]: https://cloud.sealos.io/?openapp=system-template%3FtemplateName%3Dlobe-chat
716
718
  [deploy-on-zeabur-button-image]: https://zeabur.com/button.svg
717
719
  [deploy-on-zeabur-link]: https://zeabur.com/templates/VZGGTI
718
- [deploy-on-repocloud-button-image]: https://d16t0pc4846x52.cloudfront.net/deploylobe.svg
719
- [deploy-on-repocloud-link]: https://repocloud.io/details/?app_id=248
720
720
  [discord-link]: https://discord.gg/AYFPHvv2jT
721
721
  [discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
722
722
  [discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge
@@ -17,7 +17,7 @@ S3_SECRET_ACCESS_KEY=
17
17
 
18
18
 
19
19
  # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
20
- # OPEANAI_API_KEY=sk-xxxx
20
+ # OPENAI_API_KEY=sk-xxxx
21
21
  # OPENAI_PROXY_URL=https://api.openai.com/v1
22
22
  # OPENAI_MODEL_LIST=...
23
23
 
@@ -17,7 +17,7 @@ S3_SECRET_ACCESS_KEY=
17
17
  # HTTPS_PROXY=http://localhost:7890
18
18
 
19
19
  # 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
20
- # OPEANAI_API_KEY=sk-xxxx
20
+ # OPENAI_API_KEY=sk-xxxx
21
21
  # OPENAI_PROXY_URL=https://api.openai.com/v1
22
22
  # OPENAI_MODEL_LIST=...
23
23
 
@@ -51,6 +51,6 @@ S3_ENABLE_PATH_STYLE=1
51
51
  # See: https://lobehub.com/docs/self-hosting/environment-variables/basic
52
52
  # Note: For server versions, the API must support embedding models (OpenAI text-embedding-3-small) for file processing
53
53
  # You don't need to specify this model in OPENAI_MODEL_LIST
54
- # OPEANAI_API_KEY=sk-xxxx
54
+ # OPENAI_API_KEY=sk-xxxx
55
55
  # OPENAI_PROXY_URL=https://api.openai.com/v1
56
56
  # OPENAI_MODEL_LIST=...
@@ -50,6 +50,6 @@ S3_ENABLE_PATH_STYLE=1
50
50
  # 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE
51
51
  # 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
52
52
  # 请注意,对于服务端版本,其 API 必须支持嵌入(即 OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型
53
- # OPEANAI_API_KEY=sk-xxxx
53
+ # OPENAI_API_KEY=sk-xxxx
54
54
  # OPENAI_PROXY_URL=https://api.openai.com/v1
55
55
  # OPENAI_MODEL_LIST=...
@@ -365,7 +365,7 @@ S3_SECRET_ACCESS_KEY=
365
365
  # HTTPS_PROXY=http://localhost:7890
366
366
 
367
367
  # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
368
- # OPEANAI_API_KEY=sk-xxxx
368
+ # OPENAI_API_KEY=sk-xxxx
369
369
  # OPENAI_PROXY_URL=https://api.openai.com/v1
370
370
  # OPENAI_MODEL_LIST=...
371
371
 
@@ -546,7 +546,7 @@ S3_ENABLE_PATH_STYLE=1
546
546
  # See: https://lobehub.com/docs/self-hosting/environment-variables/basic
547
547
  # Note: For server versions, the API must support embedding models (OpenAI text-embedding-3-small) for file processing
548
548
  # You don't need to specify this model in OPENAI_MODEL_LIST
549
- # OPEANAI_API_KEY=sk-xxxx
549
+ # OPENAI_API_KEY=sk-xxxx
550
550
  # OPENAI_PROXY_URL=https://api.openai.com/v1
551
551
  # OPENAI_MODEL_LIST=...
552
552
 
@@ -362,7 +362,7 @@ S3_SECRET_ACCESS_KEY=
362
362
  # HTTPS_PROXY=http://localhost:7890
363
363
 
364
364
  # 其他环境变量,视需求而定,可以参照客户端版本的环境变量配置,注意不要有 ACCESS_CODE
365
- # OPEANAI_API_KEY=sk-xxxx
365
+ # OPENAI_API_KEY=sk-xxxx
366
366
  # OPENAI_PROXY_URL=https://api.openai.com/v1
367
367
  # OPENAI_MODEL_LIST=...
368
368
 
@@ -542,7 +542,7 @@ S3_ENABLE_PATH_STYLE=1
542
542
  # 其他基础环境变量,视需求而定。注意不要有 ACCESS_CODE
543
543
  # 请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/basic
544
544
  # 请注意,对于服务端版本,其 API 必须支持嵌入(OpenAI text-embedding-3-small)模型,否则无法对上传文件进行处理,但你无需在 OPENAI_MODEL_LIST 中指定此模型
545
- # OPEANAI_API_KEY=sk-xxxx
545
+ # OPENAI_API_KEY=sk-xxxx
546
546
  # OPENAI_PROXY_URL=https://api.openai.com/v1
547
547
  # OPENAI_MODEL_LIST=...
548
548
 
@@ -85,7 +85,7 @@ S3_BUCKET=lobechat
85
85
  S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com
86
86
 
87
87
  # Other environment variables, as needed. You can refer to the environment variables configuration for the client version, making sure not to have ACCESS_CODE.
88
- # OPEANAI_API_KEY=sk-xxxx
88
+ # OPENAI_API_KEY=sk-xxxx
89
89
  # OPENAI_PROXY_URL=https://api.openai.com/v1
90
90
  # OPENAI_MODEL_LIST=...
91
91
  ```
@@ -89,7 +89,7 @@ S3_PUBLIC_DOMAIN=https://s3-for-lobechat.your-domain.com # 用于外网访问 S3
89
89
  # S3_REGION=ap-chengdu # 如果需要指定地域
90
90
 
91
91
  # 其他环境变量,视需求而定
92
- # OPEANAI_API_KEY=sk-xxxx
92
+ # OPENAI_API_KEY=sk-xxxx
93
93
  # OPENAI_PROXY_URL=https://api.openai.com/v1
94
94
  # OPENAI_MODEL_LIST=...
95
95
  # ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.15.16",
3
+ "version": "1.15.18",
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",
@@ -101,7 +101,7 @@
101
101
  "dependencies": {
102
102
  "@ant-design/icons": "^5.4.0",
103
103
  "@ant-design/pro-components": "^2.7.10",
104
- "@anthropic-ai/sdk": "^0.24.3",
104
+ "@anthropic-ai/sdk": "^0.27.0",
105
105
  "@auth/core": "0.28.0",
106
106
  "@aws-sdk/client-bedrock-runtime": "^3.637.0",
107
107
  "@aws-sdk/client-s3": "^3.637.0",
@@ -67,7 +67,6 @@ const Anthropic: ModelProviderCard = {
67
67
  },
68
68
  ],
69
69
  checkModel: 'claude-3-haiku-20240307',
70
- disableBrowserRequest: true,
71
70
  id: 'anthropic',
72
71
  name: 'Anthropic',
73
72
  proxyUrl: {
@@ -20,10 +20,10 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
20
20
 
21
21
  baseURL: string;
22
22
 
23
- constructor({ apiKey, baseURL = DEFAULT_BASE_URL }: ClientOptions = {}) {
23
+ constructor({ apiKey, baseURL = DEFAULT_BASE_URL, ...res }: ClientOptions = {}) {
24
24
  if (!apiKey) throw AgentRuntimeError.createError(AgentRuntimeErrorType.InvalidProviderAPIKey);
25
25
 
26
- this.client = new Anthropic({ apiKey, baseURL });
26
+ this.client = new Anthropic({ apiKey, baseURL, ...res });
27
27
  this.baseURL = this.client.baseURL;
28
28
  }
29
29
 
@@ -1,12 +1,18 @@
1
1
  import { TRPCError } from '@trpc/server';
2
2
 
3
+ import { enableClerk } from '@/const/auth';
4
+
3
5
  import { trpc } from '../init';
4
6
 
5
7
  export const userAuth = trpc.middleware(async (opts) => {
6
8
  const { ctx } = opts;
7
9
  // `ctx.user` is nullable
8
10
  if (!ctx.userId) {
9
- console.log('clerk auth:', ctx.clerkAuth);
11
+ if (enableClerk) {
12
+ console.log('clerk auth:', ctx.clerkAuth);
13
+ } else {
14
+ console.log('next auth:', ctx.nextAuth);
15
+ }
10
16
  throw new TRPCError({ code: 'UNAUTHORIZED' });
11
17
  }
12
18
 
@@ -134,12 +134,14 @@ export function initializeWithClientStore(provider: string, payload: any) {
134
134
  case ModelProvider.Qwen: {
135
135
  break;
136
136
  }
137
+
137
138
  case ModelProvider.Anthropic: {
138
139
  providerOptions = {
139
140
  baseURL: providerAuthPayload?.endpoint,
140
141
  };
141
142
  break;
142
143
  }
144
+
143
145
  case ModelProvider.Mistral: {
144
146
  break;
145
147
  }