mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
AIX: CSF Dispatch: remove unsafe transforms that the client does not support
This commit is contained in:
@@ -30,7 +30,12 @@ export async function* clientSideChatGenerate(
|
||||
): AsyncGenerator<AixWire_Particles.ChatGenerateOp, void> {
|
||||
// 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user