@lobehub/lobehub 2.0.0-next.120 → 2.0.0-next.122

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 2.0.0-next.122](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.121...v2.0.0-next.122)
6
+
7
+ <sup>Released on **2025-11-26**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Slove the publish to market the agent config error.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Slove the publish to market the agent config error, closes [#10440](https://github.com/lobehub/lobe-chat/issues/10440) ([fda8119](https://github.com/lobehub/lobe-chat/commit/fda8119))
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 2.0.0-next.121](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.120...v2.0.0-next.121)
31
+
32
+ <sup>Released on **2025-11-26**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Add image aspect ratio and resolution settings for Nano Banana Pro.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Add image aspect ratio and resolution settings for Nano Banana Pro, closes [#10430](https://github.com/lobehub/lobe-chat/issues/10430) ([a197b4b](https://github.com/lobehub/lobe-chat/commit/a197b4b))
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 2.0.0-next.120](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.119...v2.0.0-next.120)
6
56
 
7
57
  <sup>Released on **2025-11-26**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Slove the publish to market the agent config error."
6
+ ]
7
+ },
8
+ "date": "2025-11-26",
9
+ "version": "2.0.0-next.122"
10
+ },
11
+ {
12
+ "children": {
13
+ "improvements": [
14
+ "Add image aspect ratio and resolution settings for Nano Banana Pro."
15
+ ]
16
+ },
17
+ "date": "2025-11-26",
18
+ "version": "2.0.0-next.121"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "fixes": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.120",
3
+ "version": "2.0.0-next.122",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent 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",
@@ -197,6 +197,7 @@ const googleChatModels: AIChatModelCard[] = [
197
197
  },
198
198
  releasedAt: '2025-11-20',
199
199
  settings: {
200
+ extendParams: ['imageAspectRatio', 'imageResolution'],
200
201
  searchImpl: 'params',
201
202
  searchProvider: 'google',
202
203
  },
@@ -446,6 +447,9 @@ const googleChatModels: AIChatModelCard[] = [
446
447
  ],
447
448
  },
448
449
  releasedAt: '2025-08-26',
450
+ settings: {
451
+ extendParams: ['imageAspectRatio'],
452
+ },
449
453
  type: 'chat',
450
454
  },
451
455
  {
@@ -469,6 +473,9 @@ const googleChatModels: AIChatModelCard[] = [
469
473
  ],
470
474
  },
471
475
  releasedAt: '2025-08-26',
476
+ settings: {
477
+ extendParams: ['imageAspectRatio'],
478
+ },
472
479
  type: 'chat',
473
480
  },
474
481
  {
@@ -243,6 +243,8 @@ export type ExtendParamsType =
243
243
  | 'thinking'
244
244
  | 'thinkingBudget'
245
245
  | 'thinkingLevel'
246
+ | 'imageAspectRatio'
247
+ | 'imageResolution'
246
248
  | 'urlContext';
247
249
 
248
250
  export interface AiModelSettings {
@@ -201,7 +201,7 @@ export class LobeGoogleAI implements LobeRuntimeAI {
201
201
  async chat(rawPayload: ChatStreamPayload, options?: ChatMethodOptions) {
202
202
  try {
203
203
  const payload = this.buildPayload(rawPayload);
204
- const { model, thinkingBudget, thinkingLevel } = payload;
204
+ const { model, thinkingBudget, thinkingLevel, imageAspectRatio, imageResolution } = payload;
205
205
 
206
206
  // https://ai.google.dev/gemini-api/docs/thinking#set-budget
207
207
  const resolvedThinkingBudget = resolveModelThinkingBudget(model, thinkingBudget);
@@ -242,6 +242,13 @@ export class LobeGoogleAI implements LobeRuntimeAI {
242
242
 
243
243
  const config: GenerateContentConfig = {
244
244
  abortSignal: originalSignal,
245
+ imageConfig:
246
+ modelsWithModalities.has(model) && imageAspectRatio
247
+ ? {
248
+ aspectRatio: imageAspectRatio,
249
+ imageSize: imageResolution,
250
+ }
251
+ : undefined,
245
252
  maxOutputTokens: payload.max_tokens,
246
253
  responseModalities: modelsWithModalities.has(model) ? ['Text', 'Image'] : undefined,
247
254
  // avoid wide sensitive words
@@ -74,6 +74,14 @@ export interface ChatStreamPayload {
74
74
  * @default 0
75
75
  */
76
76
  frequency_penalty?: number;
77
+ /**
78
+ * @title Image aspect ratio for image generation
79
+ */
80
+ imageAspectRatio?: string;
81
+ /**
82
+ * @title Image resolution for image generation (e.g., '1K', '2K', '4K')
83
+ */
84
+ imageResolution?: '1K' | '2K' | '4K';
77
85
  /**
78
86
  * @title 生成文本的最大长度
79
87
  */
@@ -40,6 +40,14 @@ export interface LobeAgentChatConfig {
40
40
  thinking?: 'disabled' | 'auto' | 'enabled';
41
41
  thinkingLevel?: 'low' | 'high';
42
42
  thinkingBudget?: number;
43
+ /**
44
+ * Image aspect ratio for image generation models
45
+ */
46
+ imageAspectRatio?: string;
47
+ /**
48
+ * Image resolution for image generation models
49
+ */
50
+ imageResolution?: '1K' | '2K' | '4K';
43
51
  /**
44
52
  * Disable context caching
45
53
  */
@@ -80,6 +88,8 @@ export const AgentChatConfigSchema = z.object({
80
88
  gpt5ReasoningEffort: z.enum(['minimal', 'low', 'medium', 'high']).optional(),
81
89
  gpt5_1ReasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(),
82
90
  historyCount: z.number().optional(),
91
+ imageAspectRatio: z.string().optional(),
92
+ imageResolution: z.enum(['1K', '2K', '4K']).optional(),
83
93
  reasoningBudgetToken: z.number().optional(),
84
94
  reasoningEffort: z.enum(['low', 'medium', 'high']).optional(),
85
95
  searchFCModel: z
@@ -170,11 +170,13 @@ const MarketPublishModal = memo<MarketPublishModalProps>(
170
170
  provider,
171
171
  },
172
172
  plugins:
173
- plugins?.map((plugin) => ({
174
- enabled: true,
175
- identifier: plugin,
176
- settings: {},
177
- })) || [],
173
+ plugins?.map((plugin) => {
174
+ if (typeof plugin === 'string') {
175
+ return plugin;
176
+ } else {
177
+ return null
178
+ }
179
+ }) || [],
178
180
  systemRole: systemRole,
179
181
  },
180
182
  description: meta?.description || '',
@@ -13,6 +13,8 @@ import { aiModelSelectors, useAiInfraStore } from '@/store/aiInfra';
13
13
  import ContextCachingSwitch from './ContextCachingSwitch';
14
14
  import GPT5ReasoningEffortSlider from './GPT5ReasoningEffortSlider';
15
15
  import GPT51ReasoningEffortSlider from './GPT51ReasoningEffortSlider';
16
+ import ImageAspectRatioSelect from './ImageAspectRatioSelect';
17
+ import ImageResolutionSlider from './ImageResolutionSlider';
16
18
  import ReasoningEffortSlider from './ReasoningEffortSlider';
17
19
  import ReasoningTokenSlider from './ReasoningTokenSlider';
18
20
  import TextVerbositySlider from './TextVerbositySlider';
@@ -188,6 +190,28 @@ const ControlsForm = memo(() => {
188
190
  paddingBottom: 0,
189
191
  },
190
192
  },
193
+ {
194
+ children: <ImageAspectRatioSelect />,
195
+ label: t('extendParams.imageAspectRatio.title'),
196
+ layout: 'horizontal',
197
+ minWidth: undefined,
198
+ name: 'imageAspectRatio',
199
+ style: {
200
+ paddingBottom: 0,
201
+ },
202
+ tag: 'aspectRatio',
203
+ },
204
+ {
205
+ children: <ImageResolutionSlider />,
206
+ label: t('extendParams.imageResolution.title'),
207
+ layout: 'horizontal',
208
+ minWidth: undefined,
209
+ name: 'imageResolution',
210
+ style: {
211
+ paddingBottom: 0,
212
+ },
213
+ tag: 'imageSize',
214
+ },
191
215
  ].filter(Boolean) as FormItemProps[];
192
216
 
193
217
  return (
@@ -0,0 +1,54 @@
1
+ import { Select } from 'antd';
2
+ import { memo, useCallback, useMemo } from 'react';
3
+
4
+ import { useAgentStore } from '@/store/agent';
5
+ import { agentChatConfigSelectors } from '@/store/agent/selectors';
6
+
7
+ const NANO_BANANA_ASPECT_RATIOS = [
8
+ '1:1', // 1024x1024 / 2048x2048 / 4096x4096
9
+ '2:3', // 848x1264 / 1696x2528 / 3392x5056
10
+ '3:2', // 1264x848 / 2528x1696 / 5056x3392
11
+ '3:4', // 896x1200 / 1792x2400 / 3584x4800
12
+ '4:3', // 1200x896 / 2400x1792 / 4800x3584
13
+ '4:5', // 928x1152 / 1856x2304 / 3712x4608
14
+ '5:4', // 1152x928 / 2304x1856 / 4608x3712
15
+ '9:16', // 768x1376 / 1536x2752 / 3072x5504
16
+ '16:9', // 1376x768 / 2752x1536 / 5504x3072
17
+ '21:9', // 1584x672 / 3168x1344 / 6336x2688
18
+ ];
19
+
20
+ const ImageAspectRatioSelect = memo(() => {
21
+ const [config, updateAgentChatConfig] = useAgentStore((s) => [
22
+ agentChatConfigSelectors.currentChatConfig(s),
23
+ s.updateAgentChatConfig,
24
+ ]);
25
+
26
+ const imageAspectRatio = config.imageAspectRatio || '1:1';
27
+
28
+ const options = useMemo(
29
+ () =>
30
+ NANO_BANANA_ASPECT_RATIOS.map((ratio) => ({
31
+ label: ratio,
32
+ value: ratio,
33
+ })),
34
+ [],
35
+ );
36
+
37
+ const updateAspectRatio = useCallback(
38
+ (value: string) => {
39
+ updateAgentChatConfig({ imageAspectRatio: value });
40
+ },
41
+ [updateAgentChatConfig],
42
+ );
43
+
44
+ return (
45
+ <Select
46
+ onChange={updateAspectRatio}
47
+ options={options}
48
+ style={{ height: 32, marginRight: 10, width: 75 }}
49
+ value={imageAspectRatio}
50
+ />
51
+ );
52
+ });
53
+
54
+ export default ImageAspectRatioSelect;
@@ -0,0 +1,59 @@
1
+ import { Slider } from 'antd';
2
+ import { memo, useCallback } from 'react';
3
+ import { Flexbox } from 'react-layout-kit';
4
+
5
+ import { useAgentStore } from '@/store/agent';
6
+ import { agentChatConfigSelectors } from '@/store/agent/selectors';
7
+
8
+ const IMAGE_RESOLUTIONS = ['1K', '2K', '4K'] as const;
9
+ type ImageResolution = (typeof IMAGE_RESOLUTIONS)[number];
10
+
11
+ const ImageResolutionSlider = memo(() => {
12
+ const [config, updateAgentChatConfig] = useAgentStore((s) => [
13
+ agentChatConfigSelectors.currentChatConfig(s),
14
+ s.updateAgentChatConfig,
15
+ ]);
16
+
17
+ const imageResolution = (config.imageResolution as ImageResolution) || '1K';
18
+
19
+ const marks = {
20
+ 0: '1K',
21
+ 1: '2K',
22
+ 2: '4K',
23
+ };
24
+
25
+ const indexValue = IMAGE_RESOLUTIONS.indexOf(imageResolution);
26
+ const currentValue = indexValue === -1 ? 0 : indexValue;
27
+
28
+ const updateResolution = useCallback(
29
+ (value: number) => {
30
+ const resolution = IMAGE_RESOLUTIONS[value];
31
+ updateAgentChatConfig({ imageResolution: resolution });
32
+ },
33
+ [updateAgentChatConfig],
34
+ );
35
+
36
+ return (
37
+ <Flexbox
38
+ align={'center'}
39
+ gap={12}
40
+ horizontal
41
+ paddingInline={'0 20px'}
42
+ style={{ minWidth: 150, width: '100%' }}
43
+ >
44
+ <Flexbox flex={1}>
45
+ <Slider
46
+ marks={marks}
47
+ max={2}
48
+ min={0}
49
+ onChange={updateResolution}
50
+ step={1}
51
+ tooltip={{ open: false }}
52
+ value={currentValue}
53
+ />
54
+ </Flexbox>
55
+ </Flexbox>
56
+ );
57
+ });
58
+
59
+ export default ImageResolutionSlider;
@@ -54,6 +54,12 @@ export default {
54
54
  desc: '基于 Claude Thinking 机制限制(<1>了解更多</1>),开启后将自动禁用历史消息数限制',
55
55
  title: '开启深度思考',
56
56
  },
57
+ imageAspectRatio: {
58
+ title: '图片宽高比',
59
+ },
60
+ imageResolution: {
61
+ title: '图片分辨率',
62
+ },
57
63
  reasoningBudgetToken: {
58
64
  title: '思考消耗 Token',
59
65
  },
@@ -203,6 +203,14 @@ class ChatService {
203
203
  if (modelExtendParams!.includes('urlContext') && chatConfig.urlContext) {
204
204
  extendParams.urlContext = chatConfig.urlContext;
205
205
  }
206
+
207
+ if (modelExtendParams!.includes('imageAspectRatio') && chatConfig.imageAspectRatio) {
208
+ extendParams.imageAspectRatio = chatConfig.imageAspectRatio;
209
+ }
210
+
211
+ if (modelExtendParams!.includes('imageResolution') && chatConfig.imageResolution) {
212
+ extendParams.imageResolution = chatConfig.imageResolution;
213
+ }
206
214
  }
207
215
 
208
216
  return this.getChatCompletion(