@lobehub/chat 1.16.8 → 1.16.10
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.
Potentially problematic release.
This version of @lobehub/chat might be problematic. Click here for more details.
- package/CHANGELOG.md +58 -0
- package/package.json +3 -3
- package/src/config/__tests__/auth.test.ts +200 -0
- package/src/config/auth.ts +97 -2
- package/src/config/modelProviders/ai360.ts +11 -0
- package/src/config/modelProviders/anthropic.ts +27 -18
- package/src/config/modelProviders/azure.ts +12 -3
- package/src/config/modelProviders/baichuan.ts +3 -1
- package/src/config/modelProviders/bedrock.ts +20 -18
- package/src/config/modelProviders/deepseek.ts +3 -1
- package/src/config/modelProviders/fireworksai.ts +33 -5
- package/src/config/modelProviders/google.ts +16 -13
- package/src/config/modelProviders/groq.ts +19 -8
- package/src/config/modelProviders/minimax.ts +8 -6
- package/src/config/modelProviders/mistral.ts +19 -3
- package/src/config/modelProviders/moonshot.ts +11 -1
- package/src/config/modelProviders/novita.ts +24 -0
- package/src/config/modelProviders/ollama.ts +58 -1
- package/src/config/modelProviders/openai.ts +52 -18
- package/src/config/modelProviders/openrouter.ts +21 -1
- package/src/config/modelProviders/perplexity.ts +19 -3
- package/src/config/modelProviders/qwen.ts +11 -8
- package/src/config/modelProviders/siliconcloud.ts +34 -1
- package/src/config/modelProviders/spark.ts +16 -7
- package/src/config/modelProviders/stepfun.ts +13 -1
- package/src/config/modelProviders/taichu.ts +7 -2
- package/src/config/modelProviders/togetherai.ts +38 -2
- package/src/config/modelProviders/upstage.ts +11 -4
- package/src/config/modelProviders/zeroone.ts +5 -1
- package/src/config/modelProviders/zhipu.ts +20 -18
- package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +13 -6
- package/src/libs/agent-runtime/qwen/index.test.ts +20 -4
- package/src/libs/agent-runtime/qwen/index.ts +1 -1
- package/src/libs/next-auth/auth.config.ts +3 -1
- package/src/libs/next-auth/sso-providers/auth0.ts +5 -3
- package/src/libs/next-auth/sso-providers/authelia.ts +6 -6
- package/src/libs/next-auth/sso-providers/authentik.ts +5 -3
- package/src/libs/next-auth/sso-providers/azure-ad.ts +5 -3
- package/src/libs/next-auth/sso-providers/cloudflare-zero-trust.ts +4 -3
- package/src/libs/next-auth/sso-providers/generic-oidc.ts +3 -3
- package/src/libs/next-auth/sso-providers/github.ts +4 -2
- package/src/libs/next-auth/sso-providers/logto.ts +3 -3
- package/src/libs/next-auth/sso-providers/zitadel.ts +5 -3
- package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +1 -0
- package/src/server/routers/edge/config/__snapshots__/index.test.ts.snap +24 -4
- package/src/server/routers/edge/config/index.test.ts +3 -11
- package/src/store/user/slices/modelList/__snapshots__/action.test.ts.snap +12 -0
- package/src/store/user/slices/modelList/action.test.ts +3 -7
- package/src/types/llm.ts +1 -0
- package/src/utils/__snapshots__/parseModels.test.ts.snap +32 -0
- package/src/utils/parseModels.test.ts +1 -28
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,64 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.16.10](https://github.com/lobehub/lobe-chat/compare/v1.16.9...v1.16.10)
|
6
|
+
|
7
|
+
<sup>Released on **2024-09-12**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Support Environment Variable Inference For NextAuth.
|
12
|
+
|
13
|
+
#### 🐛 Bug Fixes
|
14
|
+
|
15
|
+
- **misc**: Qwen model param error.
|
16
|
+
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
21
|
+
|
22
|
+
#### Code refactoring
|
23
|
+
|
24
|
+
- **misc**: Support Environment Variable Inference For NextAuth, closes [#3701](https://github.com/lobehub/lobe-chat/issues/3701) ([b956755](https://github.com/lobehub/lobe-chat/commit/b956755))
|
25
|
+
|
26
|
+
#### What's fixed
|
27
|
+
|
28
|
+
- **misc**: Qwen model param error, closes [#3902](https://github.com/lobehub/lobe-chat/issues/3902) ([c9f00e5](https://github.com/lobehub/lobe-chat/commit/c9f00e5))
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
<div align="right">
|
33
|
+
|
34
|
+
[](#readme-top)
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
38
|
+
### [Version 1.16.9](https://github.com/lobehub/lobe-chat/compare/v1.16.8...v1.16.9)
|
39
|
+
|
40
|
+
<sup>Released on **2024-09-12**</sup>
|
41
|
+
|
42
|
+
#### 💄 Styles
|
43
|
+
|
44
|
+
- **misc**: Add model and provider desc and url.
|
45
|
+
|
46
|
+
<br/>
|
47
|
+
|
48
|
+
<details>
|
49
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
50
|
+
|
51
|
+
#### Styles
|
52
|
+
|
53
|
+
- **misc**: Add model and provider desc and url, closes [#3920](https://github.com/lobehub/lobe-chat/issues/3920) ([ea9ff00](https://github.com/lobehub/lobe-chat/commit/ea9ff00))
|
54
|
+
|
55
|
+
</details>
|
56
|
+
|
57
|
+
<div align="right">
|
58
|
+
|
59
|
+
[](#readme-top)
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
5
63
|
### [Version 1.16.8](https://github.com/lobehub/lobe-chat/compare/v1.16.7...v1.16.8)
|
6
64
|
|
7
65
|
<sup>Released on **2024-09-12**</sup>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.16.
|
3
|
+
"version": "1.16.10",
|
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",
|
@@ -102,7 +102,7 @@
|
|
102
102
|
"@ant-design/icons": "^5.4.0",
|
103
103
|
"@ant-design/pro-components": "^2.7.10",
|
104
104
|
"@anthropic-ai/sdk": "^0.27.0",
|
105
|
-
"@auth/core": "0.
|
105
|
+
"@auth/core": "^0.34.2",
|
106
106
|
"@aws-sdk/client-bedrock-runtime": "^3.637.0",
|
107
107
|
"@aws-sdk/client-s3": "^3.637.0",
|
108
108
|
"@aws-sdk/s3-request-presigner": "^3.637.0",
|
@@ -169,7 +169,7 @@
|
|
169
169
|
"modern-screenshot": "^4.4.39",
|
170
170
|
"nanoid": "^5.0.7",
|
171
171
|
"next": "14.2.8",
|
172
|
-
"next-auth": "
|
172
|
+
"next-auth": "beta",
|
173
173
|
"next-sitemap": "^4.2.3",
|
174
174
|
"numeral": "^2.0.6",
|
175
175
|
"nuqs": "^1.17.8",
|
@@ -0,0 +1,200 @@
|
|
1
|
+
// @vitest-environment node
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
3
|
+
|
4
|
+
import { getAuthConfig } from '../auth';
|
5
|
+
|
6
|
+
// Stub the global process object to safely mock environment variables
|
7
|
+
vi.stubGlobal('process', {
|
8
|
+
...process, // Preserve the original process object
|
9
|
+
env: { ...process.env }, // Clone the environment variables object for modification
|
10
|
+
});
|
11
|
+
|
12
|
+
const spyConsoleWarn = vi.spyOn(console, 'warn');
|
13
|
+
|
14
|
+
describe('getAuthConfig', () => {
|
15
|
+
beforeEach(() => {
|
16
|
+
// Clear all environment variables before each test
|
17
|
+
// @ts-expect-error
|
18
|
+
process.env = {};
|
19
|
+
});
|
20
|
+
|
21
|
+
// TODO(NextAuth ENVs Migration): Remove once nextauth envs migration time end
|
22
|
+
describe('should warn about deprecated environment variables', () => {
|
23
|
+
it('should warn about Auth0 deprecated environment variables', () => {
|
24
|
+
// Set all deprecated environment variables
|
25
|
+
process.env.AUTH0_CLIENT_ID = 'auth0_client_id';
|
26
|
+
process.env.AUTH0_CLIENT_SECRET = 'auth0_client_secret';
|
27
|
+
process.env.AUTH0_ISSUER = 'auth0_issuer';
|
28
|
+
// Call the function
|
29
|
+
getAuthConfig();
|
30
|
+
|
31
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
32
|
+
// Example: A warning meassage should incloud: `<Old Env> .* <New Env>`
|
33
|
+
// And the regex should match the warning message: `AUTH0_CLIENT_ID.*AUTH_AUTH0_ID`
|
34
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
35
|
+
expect.stringMatching(/AUTH0_CLIENT_ID.*AUTH_AUTH0_ID/),
|
36
|
+
);
|
37
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
38
|
+
expect.stringMatching(/AUTH0_CLIENT_SECRET.*AUTH_AUTH0_SECRET/),
|
39
|
+
);
|
40
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
41
|
+
expect.stringMatching(/AUTH0_ISSUER.*AUTH_AUTH0_ISSUER/),
|
42
|
+
);
|
43
|
+
});
|
44
|
+
it('should warn about Authentik deprecated environment variables', () => {
|
45
|
+
// Set all deprecated environment variables
|
46
|
+
process.env.AUTHENTIK_CLIENT_ID = 'authentik_client_id';
|
47
|
+
process.env.AUTHENTIK_CLIENT_SECRET = 'authentik_client_secret';
|
48
|
+
process.env.AUTHENTIK_ISSUER = 'authentik_issuer';
|
49
|
+
|
50
|
+
// Call the function
|
51
|
+
getAuthConfig();
|
52
|
+
|
53
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
54
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
55
|
+
expect.stringMatching(/AUTHENTIK_CLIENT_ID.*AUTH_AUTHENTIK_ID/),
|
56
|
+
);
|
57
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
58
|
+
expect.stringMatching(/AUTHENTIK_CLIENT_SECRET.*AUTH_AUTHENTIK_SECRET/),
|
59
|
+
);
|
60
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
61
|
+
expect.stringMatching(/AUTHENTIK_ISSUER.*AUTH_AUTHENTIK_ISSUER/),
|
62
|
+
);
|
63
|
+
});
|
64
|
+
it('should warn about Authelia deprecated environment variables', () => {
|
65
|
+
// Set all deprecated environment variables
|
66
|
+
process.env.AUTHELIA_CLIENT_ID = 'authelia_client_id';
|
67
|
+
process.env.AUTHELIA_CLIENT_SECRET = 'authelia_client_secret';
|
68
|
+
process.env.AUTHELIA_ISSUER = 'authelia_issuer';
|
69
|
+
|
70
|
+
// Call the function
|
71
|
+
getAuthConfig();
|
72
|
+
|
73
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
74
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
75
|
+
expect.stringMatching(/AUTHELIA_CLIENT_ID.*AUTH_AUTHELIA_ID/),
|
76
|
+
);
|
77
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
78
|
+
expect.stringMatching(/AUTHELIA_CLIENT_SECRET.*AUTH_AUTHELIA_SECRET/),
|
79
|
+
);
|
80
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
81
|
+
expect.stringMatching(/AUTHELIA_ISSUER.*AUTH_AUTHELIA_ISSUER/),
|
82
|
+
);
|
83
|
+
});
|
84
|
+
it('should warn about AzureAD deprecated environment variables', () => {
|
85
|
+
// Set all deprecated environment variables
|
86
|
+
process.env.AZURE_AD_CLIENT_ID = 'azure_ad_client_id';
|
87
|
+
process.env.AZURE_AD_CLIENT_SECRET = 'azure_ad_client_secret';
|
88
|
+
process.env.AZURE_AD_TENANT_ID = 'azure_ad_tenant_id';
|
89
|
+
|
90
|
+
// Call the function
|
91
|
+
getAuthConfig();
|
92
|
+
|
93
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
94
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
95
|
+
expect.stringMatching(/AZURE_AD_CLIENT_ID.*AUTH_AZURE_AD_ID/),
|
96
|
+
);
|
97
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
98
|
+
expect.stringMatching(/AZURE_AD_CLIENT_SECRET.*AUTH_AZURE_AD_SECRET/),
|
99
|
+
);
|
100
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
101
|
+
expect.stringMatching(/AZURE_AD_TENANT_ID.*AUTH_AZURE_AD_TENANT_ID/),
|
102
|
+
);
|
103
|
+
});
|
104
|
+
it('should warn about Cloudflare Zero Trust deprecated environment variables', () => {
|
105
|
+
// Set all deprecated environment variables
|
106
|
+
process.env.CLOUDFLARE_ZERO_TRUST_CLIENT_ID = 'cloudflare_zero_trust_client_id';
|
107
|
+
process.env.CLOUDFLARE_ZERO_TRUST_CLIENT_SECRET = 'cloudflare_zero_trust_client_secret';
|
108
|
+
process.env.CLOUDFLARE_ZERO_TRUST_ISSUER = 'cloudflare_zero_trust_issuer';
|
109
|
+
|
110
|
+
// Call the function
|
111
|
+
getAuthConfig();
|
112
|
+
|
113
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
114
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
115
|
+
expect.stringMatching(/CLOUDFLARE_ZERO_TRUST_CLIENT_ID.*AUTH_CLOUDFLARE_ZERO_TRUST_ID/),
|
116
|
+
);
|
117
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
118
|
+
expect.stringMatching(
|
119
|
+
/CLOUDFLARE_ZERO_TRUST_CLIENT_SECRET.*AUTH_CLOUDFLARE_ZERO_TRUST_SECRET/,
|
120
|
+
),
|
121
|
+
);
|
122
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
123
|
+
expect.stringMatching(/CLOUDFLARE_ZERO_TRUST_ISSUER.*AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER/),
|
124
|
+
);
|
125
|
+
});
|
126
|
+
it('should warn about Generic OIDC deprecated environment variables', () => {
|
127
|
+
// Set all deprecated environment variables
|
128
|
+
process.env.GENERIC_OIDC_CLIENT_ID = 'generic_oidc_client_id';
|
129
|
+
process.env.GENERIC_OIDC_CLIENT_SECRET = 'generic_oidc_client_secret';
|
130
|
+
process.env.GENERIC_OIDC_ISSUER = 'generic_oidc_issuer';
|
131
|
+
// Call the function
|
132
|
+
getAuthConfig();
|
133
|
+
|
134
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
135
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
136
|
+
expect.stringMatching(/GENERIC_OIDC_CLIENT_ID.*AUTH_GENERIC_OIDC_ID/),
|
137
|
+
);
|
138
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
139
|
+
expect.stringMatching(/GENERIC_OIDC_CLIENT_SECRET.*AUTH_GENERIC_OIDC_SECRET/),
|
140
|
+
);
|
141
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
142
|
+
expect.stringMatching(/GENERIC_OIDC_ISSUER.*AUTH_GENERIC_OIDC_ISSUER/),
|
143
|
+
);
|
144
|
+
});
|
145
|
+
it('should warn about GitHub deprecated environment variables', () => {
|
146
|
+
// Set all deprecated environment variables
|
147
|
+
process.env.GITHUB_CLIENT_ID = 'github_client_id';
|
148
|
+
process.env.GITHUB_CLIENT_SECRET = 'github_client_secret';
|
149
|
+
// Call the function
|
150
|
+
getAuthConfig();
|
151
|
+
|
152
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
153
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
154
|
+
expect.stringMatching(/GITHUB_CLIENT_ID.*AUTH_GITHUB_ID/),
|
155
|
+
);
|
156
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
157
|
+
expect.stringMatching(/GITHUB_CLIENT_SECRET.*AUTH_GITHUB_SECRET/),
|
158
|
+
);
|
159
|
+
});
|
160
|
+
it('should warn about Logto deprecated environment variables', () => {
|
161
|
+
// Set all deprecated environment variables
|
162
|
+
process.env.LOGTO_CLIENT_ID = 'logto_client_id';
|
163
|
+
process.env.LOGTO_CLIENT_SECRET = 'logto_client_secret';
|
164
|
+
process.env.LOGTO_ISSUER = 'logto_issuer';
|
165
|
+
// Call the function
|
166
|
+
getAuthConfig();
|
167
|
+
|
168
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
169
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
170
|
+
expect.stringMatching(/LOGTO_CLIENT_ID.*AUTH_LOGTO_ID/),
|
171
|
+
);
|
172
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
173
|
+
expect.stringMatching(/LOGTO_CLIENT_SECRET.*AUTH_LOGTO_SECRET/),
|
174
|
+
);
|
175
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
176
|
+
expect.stringMatching(/LOGTO_ISSUER.*AUTH_LOGTO_ISSUER/),
|
177
|
+
);
|
178
|
+
});
|
179
|
+
it('should warn about Zitadel deprecated environment variables', () => {
|
180
|
+
// Set all deprecated environment variables
|
181
|
+
process.env.ZITADEL_CLIENT_ID = 'zitadel_client_id';
|
182
|
+
process.env.ZITADEL_CLIENT_SECRET = 'zitadel_client_secret';
|
183
|
+
process.env.ZITADEL_ISSUER = 'zitadel_issuer';
|
184
|
+
// Call the function
|
185
|
+
getAuthConfig();
|
186
|
+
|
187
|
+
// Check that the spyConsoleWarn function was called for each deprecated environment variable
|
188
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
189
|
+
expect.stringMatching(/ZITADEL_CLIENT_ID.*AUTH_ZITADEL_ID/),
|
190
|
+
);
|
191
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
192
|
+
expect.stringMatching(/ZITADEL_CLIENT_SECRET.*AUTH_ZITADEL_SECRET/),
|
193
|
+
);
|
194
|
+
expect(spyConsoleWarn).toHaveBeenCalledWith(
|
195
|
+
expect.stringMatching(/ZITADEL_ISSUER.*AUTH_ZITADEL_ISSUER/),
|
196
|
+
);
|
197
|
+
});
|
198
|
+
});
|
199
|
+
// Remove end
|
200
|
+
});
|
package/src/config/auth.ts
CHANGED
@@ -42,7 +42,102 @@ declare global {
|
|
42
42
|
}
|
43
43
|
}
|
44
44
|
|
45
|
+
// TODO(NextAuth ENVs Migration): Remove once nextauth envs migration time end
|
46
|
+
const removeTipsTemplate = (willBeRemoved: string, replaceOne: string) =>
|
47
|
+
`${willBeRemoved} will be removed in the future. Please set ${replaceOne} instead.`;
|
48
|
+
// End
|
49
|
+
|
45
50
|
export const getAuthConfig = () => {
|
51
|
+
// TODO(NextAuth ENVs Migration): Remove once nextauth envs migration time end
|
52
|
+
if (process.env.AUTH0_CLIENT_ID) {
|
53
|
+
console.warn(removeTipsTemplate('AUTH0_CLIENT_ID', 'AUTH_AUTH0_ID'));
|
54
|
+
}
|
55
|
+
if (process.env.AUTH0_CLIENT_SECRET) {
|
56
|
+
console.warn(removeTipsTemplate('AUTH0_CLIENT_SECRET', 'AUTH_AUTH0_SECRET'));
|
57
|
+
}
|
58
|
+
if (process.env.AUTH0_ISSUER) {
|
59
|
+
console.warn(removeTipsTemplate('AUTH0_ISSUER', 'AUTH_AUTH0_ISSUER'));
|
60
|
+
}
|
61
|
+
if (process.env.AUTHENTIK_CLIENT_ID) {
|
62
|
+
console.warn(removeTipsTemplate('AUTHENTIK_CLIENT_ID', 'AUTH_AUTHENTIK_ID'));
|
63
|
+
}
|
64
|
+
if (process.env.AUTHENTIK_CLIENT_SECRET) {
|
65
|
+
console.warn(removeTipsTemplate('AUTHENTIK_CLIENT_SECRET', 'AUTH_AUTHENTIK_SECRET'));
|
66
|
+
}
|
67
|
+
if (process.env.AUTHENTIK_ISSUER) {
|
68
|
+
console.warn(removeTipsTemplate('AUTHENTIK_ISSUER', 'AUTH_AUTHENTIK_ISSUER'));
|
69
|
+
}
|
70
|
+
if (process.env.AUTHELIA_CLIENT_ID) {
|
71
|
+
console.warn(removeTipsTemplate('AUTHELIA_CLIENT_ID', 'AUTH_AUTHELIA_ID'));
|
72
|
+
}
|
73
|
+
if (process.env.AUTHELIA_CLIENT_SECRET) {
|
74
|
+
console.warn(removeTipsTemplate('AUTHELIA_CLIENT_SECRET', 'AUTH_AUTHELIA_SECRET'));
|
75
|
+
}
|
76
|
+
if (process.env.AUTHELIA_ISSUER) {
|
77
|
+
console.warn(removeTipsTemplate('AUTHELIA_ISSUER', 'AUTH_AUTHELIA_ISSUER'));
|
78
|
+
}
|
79
|
+
if (process.env.AZURE_AD_CLIENT_ID) {
|
80
|
+
console.warn(removeTipsTemplate('AZURE_AD_CLIENT_ID', 'AUTH_AZURE_AD_ID'));
|
81
|
+
}
|
82
|
+
if (process.env.AZURE_AD_CLIENT_SECRET) {
|
83
|
+
console.warn(removeTipsTemplate('AZURE_AD_CLIENT_SECRET', 'AUTH_AZURE_AD_SECRET'));
|
84
|
+
}
|
85
|
+
if (process.env.AZURE_AD_TENANT_ID) {
|
86
|
+
console.warn(removeTipsTemplate('AZURE_AD_TENANT_ID', 'AUTH_AZURE_AD_TENANT_ID'));
|
87
|
+
}
|
88
|
+
if (process.env.CLOUDFLARE_ZERO_TRUST_CLIENT_ID) {
|
89
|
+
console.warn(
|
90
|
+
removeTipsTemplate('CLOUDFLARE_ZERO_TRUST_CLIENT_ID', 'AUTH_CLOUDFLARE_ZERO_TRUST_ID'),
|
91
|
+
);
|
92
|
+
}
|
93
|
+
if (process.env.CLOUDFLARE_ZERO_TRUST_CLIENT_SECRET) {
|
94
|
+
console.warn(
|
95
|
+
removeTipsTemplate(
|
96
|
+
'CLOUDFLARE_ZERO_TRUST_CLIENT_SECRET',
|
97
|
+
'AUTH_CLOUDFLARE_ZERO_TRUST_SECRET',
|
98
|
+
),
|
99
|
+
);
|
100
|
+
}
|
101
|
+
if (process.env.CLOUDFLARE_ZERO_TRUST_ISSUER) {
|
102
|
+
console.warn(
|
103
|
+
removeTipsTemplate('CLOUDFLARE_ZERO_TRUST_ISSUER', 'AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER'),
|
104
|
+
);
|
105
|
+
}
|
106
|
+
if (process.env.GENERIC_OIDC_CLIENT_ID) {
|
107
|
+
console.warn(removeTipsTemplate('GENERIC_OIDC_CLIENT_ID', 'AUTH_GENERIC_OIDC_ID'));
|
108
|
+
}
|
109
|
+
if (process.env.GENERIC_OIDC_CLIENT_SECRET) {
|
110
|
+
console.warn(removeTipsTemplate('GENERIC_OIDC_CLIENT_SECRET', 'AUTH_GENERIC_OIDC_SECRET'));
|
111
|
+
}
|
112
|
+
if (process.env.GENERIC_OIDC_ISSUER) {
|
113
|
+
console.warn(removeTipsTemplate('GENERIC_OIDC_ISSUER', 'AUTH_GENERIC_OIDC_ISSUER'));
|
114
|
+
}
|
115
|
+
if (process.env.GITHUB_CLIENT_ID) {
|
116
|
+
console.warn(removeTipsTemplate('GITHUB_CLIENT_ID', 'AUTH_GITHUB_ID'));
|
117
|
+
}
|
118
|
+
if (process.env.GITHUB_CLIENT_SECRET) {
|
119
|
+
console.warn(removeTipsTemplate('GITHUB_CLIENT_SECRET', 'AUTH_GITHUB_SECRET'));
|
120
|
+
}
|
121
|
+
if (process.env.LOGTO_CLIENT_ID) {
|
122
|
+
console.warn(removeTipsTemplate('LOGTO_CLIENT_ID', 'AUTH_LOGTO_ID'));
|
123
|
+
}
|
124
|
+
if (process.env.LOGTO_CLIENT_SECRET) {
|
125
|
+
console.warn(removeTipsTemplate('LOGTO_CLIENT_SECRET', 'AUTH_LOGTO_SECRET'));
|
126
|
+
}
|
127
|
+
if (process.env.LOGTO_ISSUER) {
|
128
|
+
console.warn(removeTipsTemplate('LOGTO_ISSUER', 'AUTH_LOGTO_ISSUER'));
|
129
|
+
}
|
130
|
+
if (process.env.ZITADEL_CLIENT_ID) {
|
131
|
+
console.warn(removeTipsTemplate('ZITADEL_CLIENT_ID', 'AUTH_ZITADEL_ID'));
|
132
|
+
}
|
133
|
+
if (process.env.ZITADEL_CLIENT_SECRET) {
|
134
|
+
console.warn(removeTipsTemplate('ZITADEL_CLIENT_SECRET', 'AUTH_ZITADEL_SECRET'));
|
135
|
+
}
|
136
|
+
if (process.env.ZITADEL_ISSUER) {
|
137
|
+
console.warn(removeTipsTemplate('ZITADEL_ISSUER', 'AUTH_ZITADEL_ISSUER'));
|
138
|
+
}
|
139
|
+
// End
|
140
|
+
|
46
141
|
return createEnv({
|
47
142
|
client: {
|
48
143
|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: z.string().optional(),
|
@@ -95,7 +190,7 @@ export const getAuthConfig = () => {
|
|
95
190
|
GENERIC_OIDC_CLIENT_ID: z.string().optional(),
|
96
191
|
GENERIC_OIDC_CLIENT_SECRET: z.string().optional(),
|
97
192
|
GENERIC_OIDC_ISSUER: z.string().optional(),
|
98
|
-
|
193
|
+
|
99
194
|
// ZITADEL
|
100
195
|
ZITADEL_CLIENT_ID: z.string().optional(),
|
101
196
|
ZITADEL_CLIENT_SECRET: z.string().optional(),
|
@@ -152,7 +247,7 @@ export const getAuthConfig = () => {
|
|
152
247
|
GENERIC_OIDC_CLIENT_ID: process.env.GENERIC_OIDC_CLIENT_ID,
|
153
248
|
GENERIC_OIDC_CLIENT_SECRET: process.env.GENERIC_OIDC_CLIENT_SECRET,
|
154
249
|
GENERIC_OIDC_ISSUER: process.env.GENERIC_OIDC_ISSUER,
|
155
|
-
|
250
|
+
|
156
251
|
// ZITADEL
|
157
252
|
ZITADEL_CLIENT_ID: process.env.ZITADEL_CLIENT_ID,
|
158
253
|
ZITADEL_CLIENT_SECRET: process.env.ZITADEL_CLIENT_SECRET,
|
@@ -1,8 +1,11 @@
|
|
1
1
|
import { ModelProviderCard } from '@/types/llm';
|
2
2
|
|
3
|
+
// ref: https://ai.360.cn/platform/docs/overview
|
3
4
|
const Ai360: ModelProviderCard = {
|
4
5
|
chatModels: [
|
5
6
|
{
|
7
|
+
description:
|
8
|
+
'360GPT2 Pro 是 360 公司推出的高级自然语言处理模型,具备卓越的文本生成和理解能力,尤其在生成与创作领域表现出色,能够处理复杂的语言转换和角色演绎任务。',
|
6
9
|
displayName: '360GPT2 Pro',
|
7
10
|
enabled: true,
|
8
11
|
functionCall: false,
|
@@ -16,6 +19,8 @@ const Ai360: ModelProviderCard = {
|
|
16
19
|
tokens: 8192,
|
17
20
|
},
|
18
21
|
{
|
22
|
+
description:
|
23
|
+
'360GPT Pro 作为 360 AI 模型系列的重要成员,以高效的文本处理能力满足多样化的自然语言应用场景,支持长文本理解和多轮对话等功能。',
|
19
24
|
displayName: '360GPT Pro',
|
20
25
|
id: '360gpt-pro',
|
21
26
|
maxOutput: 7000,
|
@@ -27,6 +32,8 @@ const Ai360: ModelProviderCard = {
|
|
27
32
|
tokens: 8192,
|
28
33
|
},
|
29
34
|
{
|
35
|
+
description:
|
36
|
+
'360GPT Turbo 提供强大的计算和对话能力,具备出色的语义理解和生成效率,是企业和开发者理想的智能助理解决方案。',
|
30
37
|
displayName: '360GPT Turbo',
|
31
38
|
enabled: true,
|
32
39
|
id: '360gpt-turbo',
|
@@ -39,6 +46,8 @@ const Ai360: ModelProviderCard = {
|
|
39
46
|
tokens: 8192,
|
40
47
|
},
|
41
48
|
{
|
49
|
+
description:
|
50
|
+
'360GPT Turbo Responsibility 8K 强调语义安全和责任导向,专为对内容安全有高度要求的应用场景设计,确保用户体验的准确性与稳健性。',
|
42
51
|
displayName: '360GPT Turbo Responsibility 8K',
|
43
52
|
enabled: true,
|
44
53
|
id: '360gpt-turbo-responsibility-8k',
|
@@ -52,6 +61,8 @@ const Ai360: ModelProviderCard = {
|
|
52
61
|
},
|
53
62
|
],
|
54
63
|
checkModel: '360gpt-turbo',
|
64
|
+
description:
|
65
|
+
'360 AI 是 360 公司推出的 AI 模型和服务平台,提供多种先进的自然语言处理模型,包括 360GPT2 Pro、360GPT Pro、360GPT Turbo 和 360GPT Turbo Responsibility 8K。这些模型结合了大规模参数和多模态能力,广泛应用于文本生成、语义理解、对话系统与代码生成等领域。通过灵活的定价策略,360 AI 满足多样化用户需求,支持开发者集成,推动智能化应用的革新和发展。',
|
55
66
|
disableBrowserRequest: true,
|
56
67
|
id: 'ai360',
|
57
68
|
modelList: { showModelFetcher: true },
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { ModelProviderCard } from '@/types/llm';
|
2
2
|
|
3
|
+
// ref: https://docs.anthropic.com/en/docs/about-claude/models#model-names
|
3
4
|
const Anthropic: ModelProviderCard = {
|
4
5
|
chatModels: [
|
5
6
|
{
|
6
7
|
description:
|
7
|
-
'Claude 3.5 Sonnet
|
8
|
+
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
|
8
9
|
displayName: 'Claude 3.5 Sonnet',
|
9
10
|
enabled: true,
|
10
11
|
functionCall: true,
|
@@ -22,30 +23,31 @@ const Anthropic: ModelProviderCard = {
|
|
22
23
|
},
|
23
24
|
{
|
24
25
|
description:
|
25
|
-
'
|
26
|
-
displayName: 'Claude 3
|
26
|
+
'Claude 3 Haiku 是 Anthropic 的最快且最紧凑的模型,旨在实现近乎即时的响应。它具有快速且准确的定向性能。',
|
27
|
+
displayName: 'Claude 3 Haiku',
|
28
|
+
enabled: true,
|
27
29
|
functionCall: true,
|
28
|
-
id: 'claude-3-
|
30
|
+
id: 'claude-3-haiku-20240307',
|
29
31
|
maxOutput: 4096,
|
30
32
|
pricing: {
|
31
|
-
input:
|
32
|
-
output:
|
33
|
+
input: 0.25,
|
34
|
+
output: 1.25,
|
33
35
|
},
|
34
|
-
releasedAt: '2024-
|
36
|
+
releasedAt: '2024-03-07',
|
35
37
|
tokens: 200_000,
|
36
38
|
vision: true,
|
37
39
|
},
|
38
40
|
{
|
39
41
|
description:
|
40
|
-
'
|
41
|
-
displayName: 'Claude 3
|
42
|
+
'Claude 3 Sonnet 在智能和速度方面为企业工作负载提供了理想的平衡。它以更低的价格提供最大效用,可靠且适合大规模部署。',
|
43
|
+
displayName: 'Claude 3 Sonnet',
|
42
44
|
enabled: true,
|
43
45
|
functionCall: true,
|
44
|
-
id: 'claude-3-
|
46
|
+
id: 'claude-3-sonnet-20240229',
|
45
47
|
maxOutput: 4096,
|
46
48
|
pricing: {
|
47
|
-
input:
|
48
|
-
output:
|
49
|
+
input: 3,
|
50
|
+
output: 15,
|
49
51
|
},
|
50
52
|
releasedAt: '2024-02-29',
|
51
53
|
tokens: 200_000,
|
@@ -53,21 +55,23 @@ const Anthropic: ModelProviderCard = {
|
|
53
55
|
},
|
54
56
|
{
|
55
57
|
description:
|
56
|
-
'
|
57
|
-
displayName: 'Claude 3
|
58
|
+
'Claude 3 Opus 是 Anthropic 用于处理高度复杂任务的最强大模型。它在性能、智能、流畅性和理解力方面表现卓越。',
|
59
|
+
displayName: 'Claude 3 Opus',
|
58
60
|
enabled: true,
|
59
61
|
functionCall: true,
|
60
|
-
id: 'claude-3-
|
62
|
+
id: 'claude-3-opus-20240229',
|
61
63
|
maxOutput: 4096,
|
62
64
|
pricing: {
|
63
|
-
input:
|
64
|
-
output:
|
65
|
+
input: 15,
|
66
|
+
output: 75,
|
65
67
|
},
|
66
|
-
releasedAt: '2024-
|
68
|
+
releasedAt: '2024-02-29',
|
67
69
|
tokens: 200_000,
|
68
70
|
vision: true,
|
69
71
|
},
|
70
72
|
{
|
73
|
+
description:
|
74
|
+
'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
|
71
75
|
displayName: 'Claude 2.1',
|
72
76
|
id: 'claude-2.1',
|
73
77
|
maxOutput: 4096,
|
@@ -79,6 +83,8 @@ const Anthropic: ModelProviderCard = {
|
|
79
83
|
tokens: 200_000,
|
80
84
|
},
|
81
85
|
{
|
86
|
+
description:
|
87
|
+
'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
|
82
88
|
displayName: 'Claude 2.0',
|
83
89
|
id: 'claude-2.0',
|
84
90
|
maxOutput: 4096,
|
@@ -90,6 +96,7 @@ const Anthropic: ModelProviderCard = {
|
|
90
96
|
tokens: 100_000,
|
91
97
|
},
|
92
98
|
{
|
99
|
+
description: 'Anthropic 的模型用于低延迟、高吞吐量的文本生成,支持生成数百页的文本。',
|
93
100
|
displayName: 'Claude Instant 1.2',
|
94
101
|
id: 'claude-instant-1.2',
|
95
102
|
maxOutput: 4096,
|
@@ -102,6 +109,8 @@ const Anthropic: ModelProviderCard = {
|
|
102
109
|
},
|
103
110
|
],
|
104
111
|
checkModel: 'claude-3-haiku-20240307',
|
112
|
+
description:
|
113
|
+
'Anthropic 是一家专注于人工智能研究和开发的公司,提供了一系列先进的语言模型,如 Claude 3.5 Sonnet、Claude 3 Sonnet、Claude 3 Opus 和 Claude 3 Haiku。这些模型在智能、速度和成本之间取得了理想的平衡,适用于从企业级工作负载到快速响应的各种应用场景。Claude 3.5 Sonnet 作为其最新模型,在多项评估中表现优异,同时保持了较高的性价比。',
|
105
114
|
id: 'anthropic',
|
106
115
|
modelsUrl: 'https://docs.anthropic.com/en/docs/about-claude/models#model-names',
|
107
116
|
name: 'Anthropic',
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { ModelProviderCard } from '@/types/llm';
|
2
2
|
|
3
|
-
// ref https://learn.microsoft.com/
|
3
|
+
// ref: https://learn.microsoft.com/azure/ai-services/openai/concepts/models
|
4
4
|
const Azure: ModelProviderCard = {
|
5
5
|
chatModels: [
|
6
6
|
{
|
7
7
|
deploymentName: 'gpt-35-turbo',
|
8
|
-
description:
|
8
|
+
description:
|
9
|
+
'GPT 3.5 Turbo,OpenAI提供的高效模型,适用于聊天和文本生成任务,支持并行函数调用。',
|
9
10
|
displayName: 'GPT 3.5 Turbo',
|
10
11
|
enabled: true,
|
11
12
|
functionCall: true,
|
@@ -15,6 +16,7 @@ const Azure: ModelProviderCard = {
|
|
15
16
|
},
|
16
17
|
{
|
17
18
|
deploymentName: 'gpt-35-turbo-16k',
|
19
|
+
description: 'GPT 3.5 Turbo 16k,高容量文本生成模型,适合复杂任务。',
|
18
20
|
displayName: 'GPT 3.5 Turbo',
|
19
21
|
functionCall: true,
|
20
22
|
id: 'gpt-35-turbo-16k',
|
@@ -22,6 +24,7 @@ const Azure: ModelProviderCard = {
|
|
22
24
|
},
|
23
25
|
{
|
24
26
|
deploymentName: 'gpt-4-turbo',
|
27
|
+
description: 'GPT 4 Turbo,多模态模型,提供杰出的语言理解和生成能力,同时支持图像输入。',
|
25
28
|
displayName: 'GPT 4 Turbo',
|
26
29
|
enabled: true,
|
27
30
|
functionCall: true,
|
@@ -31,7 +34,7 @@ const Azure: ModelProviderCard = {
|
|
31
34
|
},
|
32
35
|
{
|
33
36
|
deploymentName: 'gpt-4-vision',
|
34
|
-
description: 'GPT-4
|
37
|
+
description: 'GPT-4 视觉预览版,专为图像分析和处理任务设计。',
|
35
38
|
displayName: 'GPT 4 Turbo with Vision Preview',
|
36
39
|
id: 'gpt-4-vision-preview',
|
37
40
|
tokens: 128_000,
|
@@ -39,6 +42,7 @@ const Azure: ModelProviderCard = {
|
|
39
42
|
},
|
40
43
|
{
|
41
44
|
deploymentName: 'gpt-4o-mini',
|
45
|
+
description: 'GPT-4o Mini,小型高效模型,具备与GPT-4o相似的卓越性能。',
|
42
46
|
displayName: 'GPT 4o Mini',
|
43
47
|
enabled: true,
|
44
48
|
functionCall: true,
|
@@ -48,6 +52,7 @@ const Azure: ModelProviderCard = {
|
|
48
52
|
},
|
49
53
|
{
|
50
54
|
deploymentName: 'gpt-4o',
|
55
|
+
description: 'GPT-4o 是最新的多模态模型,结合高级文本和图像处理能力。',
|
51
56
|
displayName: 'GPT 4o',
|
52
57
|
enabled: true,
|
53
58
|
functionCall: true,
|
@@ -57,8 +62,12 @@ const Azure: ModelProviderCard = {
|
|
57
62
|
},
|
58
63
|
],
|
59
64
|
defaultShowBrowserRequest: true,
|
65
|
+
description:
|
66
|
+
'Azure 提供多种先进的AI模型,包括GPT-3.5和最新的GPT-4系列,支持多种数据类型和复杂任务,致力于安全、可靠和可持续的AI解决方案。',
|
60
67
|
id: 'azure',
|
68
|
+
modelsUrl: 'https://learn.microsoft.com/azure/ai-services/openai/concepts/models',
|
61
69
|
name: 'Azure',
|
70
|
+
url: 'https://azure.microsoft.com',
|
62
71
|
};
|
63
72
|
|
64
73
|
export default Azure;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ModelProviderCard } from '@/types/llm';
|
2
2
|
|
3
|
-
// ref https://platform.baichuan-ai.com/price
|
3
|
+
// ref: https://platform.baichuan-ai.com/price
|
4
4
|
const Baichuan: ModelProviderCard = {
|
5
5
|
chatModels: [
|
6
6
|
{
|
@@ -62,6 +62,8 @@ const Baichuan: ModelProviderCard = {
|
|
62
62
|
},
|
63
63
|
],
|
64
64
|
checkModel: 'Baichuan3-Turbo',
|
65
|
+
description:
|
66
|
+
'百川智能是一家专注于人工智能大模型研发的公司,其模型在国内知识百科、长文本处理和生成创作等中文任务上表现卓越,超越了国外主流模型。百川智能还具备行业领先的多模态能力,在多项权威评测中表现优异。其模型包括 Baichuan 4、Baichuan 3 Turbo 和 Baichuan 3 Turbo 128k 等,分别针对不同应用场景进行优化,提供高性价比的解决方案。',
|
65
67
|
id: 'baichuan',
|
66
68
|
modelList: { showModelFetcher: true },
|
67
69
|
modelsUrl: 'https://platform.baichuan-ai.com/price',
|