diff --git a/src/modules/aix/client/aix.client.direct-chatGenerate.ts b/src/modules/aix/client/aix.client.direct-chatGenerate.ts index c4da72ec1..080c3376a 100644 --- a/src/modules/aix/client/aix.client.direct-chatGenerate.ts +++ b/src/modules/aix/client/aix.client.direct-chatGenerate.ts @@ -30,7 +30,12 @@ export async function* clientSideChatGenerate( ): AsyncGenerator { // keep in sync with the `aixRouter.chatGenerateContent` server-side procedure const _d: AixDebugObject = _createClientDebugConfig(access, connectionOptions, context.name); - const chatGenerateDispatchCreator = () => createChatGenerateDispatch(access, model, chatGenerate, streaming, !!connectionOptions?.enableResumability); + const chatGenerateDispatchCreator = () => createChatGenerateDispatch(access, model, chatGenerate, streaming, !!connectionOptions?.enableResumability) + .then(dispatch => { + // [CSF-Only] Client-side transform stripping - remove any dispatch transforms that are tagged as csfUnsafe (e.g. for CORS reasons) + if (dispatch.particleTransform?.csfUnsafe) dispatch.particleTransform = undefined; + return dispatch; + }); yield* executeChatGenerateWithContinuation(chatGenerateDispatchCreator, streaming, abortSignal, _d); }