Skip to content

Commit

Permalink
Fragments: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Feb 25, 2025
1 parent d7bc03f commit bdb24f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/stores/chat/chat.fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export type DVoidModelAuxPart = {
aText: string,
// [Anthropic] attributes, if present, they imply "Extended Thinking" object(s)
textSignature?: string,
redactedData?: string[],
redactedData?: readonly string[],
};

type DVoidPlaceholderPart = { pt: 'ph', pText: string, pType?: 'chat-gen-follow-up', /* 2025-02-23: added for non-pure-text placeholders */ };
Expand Down
4 changes: 2 additions & 2 deletions src/modules/aix/client/aix.client.chatGenerateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Is } from '~/common/util/pwaUtils';
import { LLMImageResizeMode, resizeBase64ImageIfNeeded } from '~/common/util/imageUtils';

// NOTE: pay particular attention to the "import type", as this is importing from the server-side Zod definitions
import type { AixAPIChatGenerate_Request, AixMessages_ModelMessage, AixMessages_ToolMessage, AixMessages_UserMessage, AixParts_InlineImagePart, AixParts_MetaCacheControl, AixParts_MetaInReferenceToPart } from '../server/api/aix.wiretypes';
import type { AixAPIChatGenerate_Request, AixMessages_ModelMessage, AixMessages_ToolMessage, AixMessages_UserMessage, AixParts_InlineImagePart, AixParts_MetaCacheControl, AixParts_MetaInReferenceToPart, AixParts_ModelAuxPart } from '../server/api/aix.wiretypes';

// TODO: remove console messages to zero, or replace with throws or something

Expand Down Expand Up @@ -198,7 +198,7 @@ export async function aixCGR_ChatSequence_FromDMessagesOrThrow(
// which may be instrumental for the model to execute tools-result follow-up actions/text.
const isAntModelAux = aFragment.part.textSignature || aFragment.part.redactedData?.length;
if (isAntModelAux)
modelMessage.parts.push(aFragment.part);
modelMessage.parts.push(aFragment.part as AixParts_ModelAuxPart /* NOTE: this is a forced cast from readonly string[] to string[], but not a big deal here*/);
break;

case 'doc':
Expand Down

0 comments on commit bdb24f6

Please sign in to comment.