diff --git a/src/common/stores/llms/llms.parameters.ts b/src/common/stores/llms/llms.parameters.ts index c51ecf9c9..e97e41ae8 100644 --- a/src/common/stores/llms/llms.parameters.ts +++ b/src/common/stores/llms/llms.parameters.ts @@ -158,6 +158,14 @@ export const DModelParameterRegistry = { initialValue: false, } as const, + llmVndOaiImageGeneration: { + label: 'Image Generation', + type: 'boolean' as const, + description: 'Enable image generation capabilities', + // No initialValue - defaults to undefined/false (off) + // No requiredFallback - this is optional + } as const, + // Perplexity-specific parameters // llmVndPerplexityReasoningEffort - we reuse the OpenAI reasoning effort parameter diff --git a/src/modules/aix/client/aix.client.ts b/src/modules/aix/client/aix.client.ts index 267fa3693..ee00d7819 100644 --- a/src/modules/aix/client/aix.client.ts +++ b/src/modules/aix/client/aix.client.ts @@ -50,7 +50,7 @@ export function aixCreateModelFromLLMOptions( llmRef, llmTemperature, llmResponseTokens, llmTopP, llmForceNoStream, llmVndAntThinkingBudget, llmVndGeminiShowThoughts, llmVndGeminiThinkingBudget, - llmVndOaiReasoningEffort, llmVndOaiReasoningEffort4, llmVndOaiRestoreMarkdown, llmVndOaiVerbosity, llmVndOaiWebSearchContext, llmVndOaiWebSearchGeolocation, + llmVndOaiReasoningEffort, llmVndOaiReasoningEffort4, llmVndOaiRestoreMarkdown, llmVndOaiVerbosity, llmVndOaiWebSearchContext, llmVndOaiWebSearchGeolocation, llmVndOaiImageGeneration, llmVndPerplexityDateFilter, llmVndPerplexitySearchMode, llmVndXaiSearchMode, llmVndXaiSearchSources, llmVndXaiSearchDateFilter, } = { @@ -108,6 +108,7 @@ export function aixCreateModelFromLLMOptions( ...(llmVndOaiRestoreMarkdown ? { vndOaiRestoreMarkdown: llmVndOaiRestoreMarkdown } : {}), ...(llmVndOaiVerbosity ? { vndOaiVerbosity: llmVndOaiVerbosity } : {}), ...(llmVndOaiWebSearchContext ? { vndOaiWebSearchContext: llmVndOaiWebSearchContext } : {}), + ...(llmVndOaiImageGeneration ? { vndOaiImageGeneration: true } : {}), ...(llmVndPerplexityDateFilter ? { vndPerplexityDateFilter: llmVndPerplexityDateFilter } : {}), ...(llmVndPerplexitySearchMode ? { vndPerplexitySearchMode: llmVndPerplexitySearchMode } : {}), ...(userGeolocation ? { userGeolocation } : {}), diff --git a/src/modules/aix/server/api/aix.wiretypes.ts b/src/modules/aix/server/api/aix.wiretypes.ts index 99038473d..cf030e75d 100644 --- a/src/modules/aix/server/api/aix.wiretypes.ts +++ b/src/modules/aix/server/api/aix.wiretypes.ts @@ -413,6 +413,7 @@ export namespace AixWire_API { vndOaiRestoreMarkdown: z.boolean().optional(), vndOaiVerbosity: z.enum(['low', 'medium', 'high']).optional(), vndOaiWebSearchContext: z.enum(['low', 'medium', 'high']).optional(), + vndOaiImageGeneration: z.boolean().optional(), vndPerplexityDateFilter: z.enum(['unfiltered', '1m', '3m', '6m', '1y']).optional(), vndPerplexitySearchMode: z.enum(['default', 'academic']).optional(), vndXaiSearchMode: z.enum(['auto', 'on', 'off']).optional(), diff --git a/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.responsesCreate.ts b/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.responsesCreate.ts index 28ae631ac..72a565f8e 100644 --- a/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.responsesCreate.ts +++ b/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.responsesCreate.ts @@ -146,8 +146,8 @@ export function aixToOpenAIResponses(openAIDialect: OpenAIDialects, model: AixAP } } - // Tool: Image Generation: for testing (enable for all compatible models) - const requestImageGenerationTool = false // TODO: make this configurable + // Tool: Image Generation: configurable per model + const requestImageGenerationTool = !!model.vndOaiImageGeneration; if (requestImageGenerationTool) { if (isDialectAzure) { // Azure OpenAI may not support image generation tool yet diff --git a/src/modules/llms/models-modal/LLMParametersEditor.tsx b/src/modules/llms/models-modal/LLMParametersEditor.tsx index f79b176c8..5e971164f 100644 --- a/src/modules/llms/models-modal/LLMParametersEditor.tsx +++ b/src/modules/llms/models-modal/LLMParametersEditor.tsx @@ -109,6 +109,7 @@ export function LLMParametersEditor(props: { llmVndOaiRestoreMarkdown, llmVndOaiWebSearchContext, llmVndOaiWebSearchGeolocation, + llmVndOaiImageGeneration, llmVndOaiVerbosity, llmVndPerplexityDateFilter, llmVndPerplexitySearchMode, @@ -391,6 +392,19 @@ export function LLMParametersEditor(props: { /> )} + {showParam('llmVndOaiImageGeneration') && ( + { + if (!checked) onRemoveParameter('llmVndOaiImageGeneration'); + else onChangeParameter({ llmVndOaiImageGeneration: true }); + }} + /> + )} + {showParam('llmForceNoStream') && (