@lobehub/chat 1.118.2 → 1.118.4

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.118.4](https://github.com/lobehub/lobe-chat/compare/v1.118.3...v1.118.4)
6
+
7
+ <sup>Released on **2025-08-29**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Fix chat session part switch theme issue.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Fix chat session part switch theme issue, closes [#8987](https://github.com/lobehub/lobe-chat/issues/8987) ([b7111be](https://github.com/lobehub/lobe-chat/commit/b7111be))
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.118.3](https://github.com/lobehub/lobe-chat/compare/v1.118.2...v1.118.3)
31
+
32
+ <sup>Released on **2025-08-29**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Correct totalOutputTokens calculation for XAI provider.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Correct totalOutputTokens calculation for XAI provider, closes [#8984](https://github.com/lobehub/lobe-chat/issues/8984) ([09ce90a](https://github.com/lobehub/lobe-chat/commit/09ce90a))
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.118.2](https://github.com/lobehub/lobe-chat/compare/v1.118.1...v1.118.2)
6
56
 
7
57
  <sup>Released on **2025-08-29**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Fix chat session part switch theme issue."
6
+ ]
7
+ },
8
+ "date": "2025-08-29",
9
+ "version": "1.118.4"
10
+ },
11
+ {
12
+ "children": {
13
+ "fixes": [
14
+ "Correct totalOutputTokens calculation for XAI provider."
15
+ ]
16
+ },
17
+ "date": "2025-08-29",
18
+ "version": "1.118.3"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.118.2",
3
+ "version": "1.118.4",
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",
@@ -137,8 +137,8 @@ export class LobeOllamaAI implements LobeRuntimeAI {
137
137
  enabled: knownModel?.enabled || false,
138
138
  functionCall: knownModel?.abilities?.functionCall || false,
139
139
  id: model.name,
140
- reasoning: knownModel?.abilities?.functionCall || false,
141
- vision: knownModel?.abilities?.functionCall || false,
140
+ reasoning: knownModel?.abilities?.reasoning || false,
141
+ vision: knownModel?.abilities?.vision || false,
142
142
  };
143
143
  })
144
144
  .filter(Boolean) as ChatModelCard[];
@@ -271,7 +271,7 @@ describe('convertUsage', () => {
271
271
  // Assert
272
272
  expect(xaiResult).toMatchObject({
273
273
  totalInputTokens: 6103,
274
- totalOutputTokens: 66,
274
+ totalOutputTokens: 447, // 66 + 381,xai的reasoning_tokens和completion_tokens价格一样
275
275
  outputTextTokens: 66, // 不减去 reasoning_tokens
276
276
  outputReasoningTokens: 381,
277
277
  totalTokens: 6550,
@@ -27,6 +27,8 @@ export const convertUsage = (
27
27
  provider === 'xai'
28
28
  ? totalOutputTokens - outputAudioTokens
29
29
  : totalOutputTokens - outputReasoning - outputAudioTokens - outputImageTokens;
30
+ const totalOutputTokensNormalized =
31
+ provider === 'xai' ? totalOutputTokens + outputReasoning : totalOutputTokens;
30
32
 
31
33
  const totalTokens = inputCitationTokens + usage.total_tokens;
32
34
 
@@ -43,7 +45,7 @@ export const convertUsage = (
43
45
  outputTextTokens: outputTextTokens,
44
46
  rejectedPredictionTokens: usage.completion_tokens_details?.rejected_prediction_tokens,
45
47
  totalInputTokens,
46
- totalOutputTokens: totalOutputTokens,
48
+ totalOutputTokens: totalOutputTokensNormalized,
47
49
  totalTokens,
48
50
  } satisfies ModelTokensUsage;
49
51
 
@@ -52,6 +52,7 @@ const AiModelAbilitiesSchema = z.object({
52
52
  // files: z.boolean().optional(),
53
53
  functionCall: z.boolean().optional(),
54
54
  reasoning: z.boolean().optional(),
55
+ search: z.boolean().optional(),
55
56
  vision: z.boolean().optional(),
56
57
  });
57
58
 
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { DraggablePanel, DraggablePanelContainer, type DraggablePanelProps } from '@lobehub/ui';
4
- import { createStyles, useResponsive } from 'antd-style';
4
+ import { createStyles, useResponsive, useThemeMode } from 'antd-style';
5
5
  import isEqual from 'fast-deep-equal';
6
6
  import { PropsWithChildren, memo, useEffect, useMemo, useState } from 'react';
7
7
 
@@ -69,6 +69,8 @@ const SessionPanel = memo<PropsWithChildren>(({ children }) => {
69
69
  if (!md) updatePreference({ showSessionPanel: false });
70
70
  }, [md, cacheExpand]);
71
71
 
72
+ const { appearance } = useThemeMode();
73
+
72
74
  const SessionPanel = useMemo(() => {
73
75
  return (
74
76
  <DraggablePanel
@@ -90,7 +92,7 @@ const SessionPanel = memo<PropsWithChildren>(({ children }) => {
90
92
  </DraggablePanelContainer>
91
93
  </DraggablePanel>
92
94
  );
93
- }, [sessionsWidth, md, isPinned, sessionExpandable, tmpWidth]);
95
+ }, [sessionsWidth, md, isPinned, sessionExpandable, tmpWidth, appearance]);
94
96
 
95
97
  return SessionPanel;
96
98
  });