@lobehub/chat 1.107.2 → 1.107.3

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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.107.3](https://github.com/lobehub/lobe-chat/compare/v1.107.2...v1.107.3)
6
+
7
+ <sup>Released on **2025-08-03**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Aihubmix provider request headers.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Aihubmix provider request headers, closes [#8654](https://github.com/lobehub/lobe-chat/issues/8654) ([af07101](https://github.com/lobehub/lobe-chat/commit/af07101))
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
+
5
30
  ### [Version 1.107.2](https://github.com/lobehub/lobe-chat/compare/v1.107.1...v1.107.2)
6
31
 
7
32
  <sup>Released on **2025-08-02**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Aihubmix provider request headers."
6
+ ]
7
+ },
8
+ "date": "2025-08-03",
9
+ "version": "1.107.3"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.107.2",
3
+ "version": "1.107.3",
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",
@@ -121,7 +121,7 @@
121
121
  "dependencies": {
122
122
  "@ant-design/icons": "^5.6.1",
123
123
  "@ant-design/pro-components": "^2.8.10",
124
- "@anthropic-ai/sdk": "^0.56.0",
124
+ "@anthropic-ai/sdk": "^0.57.0",
125
125
  "@auth/core": "^0.38.0",
126
126
  "@aws-sdk/client-bedrock-runtime": "^3.848.0",
127
127
  "@aws-sdk/client-s3": "^3.850.0",
@@ -204,7 +204,7 @@
204
204
  "langfuse": "^3.38.4",
205
205
  "langfuse-core": "^3.38.4",
206
206
  "lodash-es": "^4.17.21",
207
- "lucide-react": "^0.525.0",
207
+ "lucide-react": "^0.536.0",
208
208
  "mammoth": "^1.9.1",
209
209
  "markdown-to-txt": "^2.0.1",
210
210
  "mdast-util-to-markdown": "^2.1.2",
@@ -124,9 +124,11 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
124
124
  GoogleProvider,
125
125
  VertexAIProvider,
126
126
  DeepSeekProvider,
127
- HuggingFaceProvider,
127
+ MoonshotProvider,
128
+ AiHubMixProvider,
128
129
  OpenRouterProvider,
129
130
  FalProvider,
131
+ HuggingFaceProvider,
130
132
  CloudflareProvider,
131
133
  GithubProvider,
132
134
  NovitaProvider,
@@ -155,7 +157,6 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
155
157
  SparkProvider,
156
158
  SenseNovaProvider,
157
159
  StepfunProvider,
158
- MoonshotProvider,
159
160
  BaichuanProvider,
160
161
  VolcengineProvider,
161
162
  MinimaxProvider,
@@ -165,7 +166,6 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
165
166
  GiteeAIProvider,
166
167
  TaichuProvider,
167
168
  Ai360Provider,
168
- AiHubMixProvider,
169
169
  Search1APIProvider,
170
170
  InfiniAIProvider,
171
171
  QiniuProvider,
@@ -88,6 +88,7 @@ interface CreateRouterRuntimeOptions<T extends Record<string, any> = any> {
88
88
  chatCompletion: () => boolean;
89
89
  responses?: () => boolean;
90
90
  };
91
+ defaultHeaders?: Record<string, any>;
91
92
  errorType?: {
92
93
  bizError: ILobeAgentRuntimeErrorType;
93
94
  invalidAPIKey: ILobeAgentRuntimeErrorType;
@@ -17,14 +17,12 @@ export interface AiHubMixModelCard {
17
17
  const baseURL = 'https://aihubmix.com';
18
18
 
19
19
  export const LobeAiHubMixAI = createRouterRuntime({
20
- constructorOptions: {
21
- defaultHeaders: {
22
- 'APP-Code': 'LobeHub',
23
- },
24
- },
25
20
  debug: {
26
21
  chatCompletion: () => process.env.DEBUG_AIHUBMIX_CHAT_COMPLETION === '1',
27
22
  },
23
+ defaultHeaders: {
24
+ 'APP-Code': 'LobeHub',
25
+ },
28
26
  id: ModelProvider.AiHubMix,
29
27
  models: async ({ client }) => {
30
28
  const functionCallKeywords = [
@@ -44,7 +44,13 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
44
44
  return process.env.DEBUG_ANTHROPIC_CHAT_COMPLETION === '1';
45
45
  }
46
46
 
47
- constructor({ apiKey, baseURL = DEFAULT_BASE_URL, id, ...res }: AnthropicAIParams = {}) {
47
+ constructor({
48
+ apiKey,
49
+ baseURL = DEFAULT_BASE_URL,
50
+ id,
51
+ defaultHeaders,
52
+ ...res
53
+ }: AnthropicAIParams = {}) {
48
54
  if (!apiKey) throw AgentRuntimeError.createError(AgentRuntimeErrorType.InvalidProviderAPIKey);
49
55
 
50
56
  const betaHeaders = process.env.ANTHROPIC_BETA_HEADERS;
@@ -52,7 +58,7 @@ export class LobeAnthropicAI implements LobeRuntimeAI {
52
58
  this.client = new Anthropic({
53
59
  apiKey,
54
60
  baseURL,
55
- ...(betaHeaders ? { defaultHeaders: { 'anthropic-beta': betaHeaders } } : {}),
61
+ defaultHeaders: { ...defaultHeaders, 'anthropic-beta': betaHeaders },
56
62
  ...res,
57
63
  });
58
64
  this.baseURL = this.client.baseURL;
@@ -4,6 +4,7 @@ import {
4
4
  GenerateContentConfig,
5
5
  Tool as GoogleFunctionCallTool,
6
6
  GoogleGenAI,
7
+ HttpOptions,
7
8
  Part,
8
9
  Type as SchemaType,
9
10
  ThinkingConfig,
@@ -78,6 +79,7 @@ interface LobeGoogleAIParams {
78
79
  apiKey?: string;
79
80
  baseURL?: string;
80
81
  client?: GoogleGenAI;
82
+ defaultHeaders?: Record<string, any>;
81
83
  id?: string;
82
84
  isVertexAi?: boolean;
83
85
  }
@@ -100,10 +102,19 @@ export class LobeGoogleAI implements LobeRuntimeAI {
100
102
  apiKey?: string;
101
103
  provider: string;
102
104
 
103
- constructor({ apiKey, baseURL, client, isVertexAi, id }: LobeGoogleAIParams = {}) {
105
+ constructor({
106
+ apiKey,
107
+ baseURL,
108
+ client,
109
+ isVertexAi,
110
+ id,
111
+ defaultHeaders,
112
+ }: LobeGoogleAIParams = {}) {
104
113
  if (!apiKey) throw AgentRuntimeError.createError(AgentRuntimeErrorType.InvalidProviderAPIKey);
105
114
 
106
- const httpOptions = baseURL ? { baseUrl: baseURL } : undefined;
115
+ const httpOptions = baseURL
116
+ ? ({ baseUrl: baseURL, headers: defaultHeaders } as HttpOptions)
117
+ : undefined;
107
118
 
108
119
  this.apiKey = apiKey;
109
120
  this.client = client ? client : new GoogleGenAI({ apiKey, httpOptions });