TurnContentPart
@forge/monorepo / backend/src / TurnContentPart
Type Alias: TurnContentPart
TurnContentPart = {
kind:"text";text:string; } | {image:string|URL;kind:"image";mediaType?:string; } | {data:string|URL;filename?:string;kind:"file";mediaType:string; }
Defined in: backend/src/models/streaming.ts:30
One piece of a turn's content — #185.
image and file exist because the platform has always accepted them: ImagePart and FilePart are in the
message contract, InputModality covers image, audio, video and pdf, and resolveModel filters on
requiredModalities. What was missing was the last hop — the bridge to the provider took a string, so an
attachment was stored, authorized, rendered and billed for, and then not mentioned to the model.
A URL or a data payload rather than a platform file id, deliberately: this layer is the SDK boundary and knows
nothing about the file store. The caller resolves a FilePart into bytes or a URL through the mediated read
path, which is what keeps the modality bridge from becoming a way around file authorization.