From fa042f7d68676db31aa98dcf01116a24b0e63c44 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Wed, 12 Nov 2025 22:53:50 -0800 Subject: [PATCH] AIX: prenorm --- src/modules/aix/client/aix.client.ts | 33 +++++++++------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/src/modules/aix/client/aix.client.ts b/src/modules/aix/client/aix.client.ts index 6ac1b9baa..1c61800f3 100644 --- a/src/modules/aix/client/aix.client.ts +++ b/src/modules/aix/client/aix.client.ts @@ -1,8 +1,8 @@ import { findServiceAccessOrThrow } from '~/modules/llms/vendors/vendor.helpers'; -import type { DMessage, DMessageGenerator } from '~/common/stores/chat/chat.message'; import type { MaybePromise } from '~/common/types/useful.types'; import { DLLM, DLLMId, getLLMPricing, LLM_IF_HOTFIX_NoTemperature, LLM_IF_OAI_Responses, LLM_IF_Outputs_Audio, LLM_IF_Outputs_Image, LLM_IF_Outputs_NoText } from '~/common/stores/llms/llms.types'; +import { DMessage, DMessageGenerator, messageSetGeneratorAIX_AutoLabel } from '~/common/stores/chat/chat.message'; import { DMetricsChatGenerate_Lg, metricsChatGenerateLgToMd, metricsComputeChatGenerateCostsMd } from '~/common/stores/metrics/metrics.chatgenerate'; import { DModelParameterValues, getAllModelParameterValues } from '~/common/stores/llms/llms.parameters'; import { apiStream } from '~/common/util/trpc.client'; @@ -176,10 +176,8 @@ export async function aixChatGenerateContent_DMessage_FromConversation( let lastDMessage: AixChatGenerateContent_DMessageGuts = { fragments: [], - generator: { - mgt: 'named', - name: llmId as any, - }, + // NOTE: short-lived, immediately updated in the first callback. Note that we don't have the vendorId yet, otherwise we'd initialize this as 'aix' here + generator: { mgt: 'named', name: llmId }, pendingIncomplete: true, }; @@ -297,16 +295,10 @@ export async function aixChatGenerateText_Simple( // Variable to store the final text const state: AixChatGenerateText_Simple = { text: null, - generator: { - mgt: 'aix', - name: llmId, - aix: { - vId: llm.vId, - mId: llm.id, - }, - }, + generator: { mgt: 'named', name: 'replace-me-ll' }, isDone: false, }; + messageSetGeneratorAIX_AutoLabel(state, llm.vId, llm.id); // NO streaming initial notification - only notified past the first real characters // await onTextStreamUpdate?.(dText.text, false); @@ -470,18 +462,13 @@ export async function aixChatGenerateContent_DMessage_orThrow