Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / / splitTextAndContentParts

Function: splitTextAndContentParts()

ts
function splitTextAndContentParts(envelope): {
  nonText: readonly MessageContent[];
  text: string;
  textParts: readonly TextContent[];
};

Defined in: packages/tools/src/result/envelope.ts:69

Split an envelope into its text-shaped payload (subject to the truncation pipeline + inbound sanitization scan) and its non-text content parts (passed through untouched).

Parameters

ParameterType
envelopeResultEnvelope

Returns

ts
{
  nonText: readonly MessageContent[];
  text: string;
  textParts: readonly TextContent[];
}
NameTypeDefined in
nonTextreadonly MessageContent[]packages/tools/src/result/envelope.ts:71
textstringpackages/tools/src/result/envelope.ts:70
textPartsreadonly TextContent[]packages/tools/src/result/envelope.ts:72

Stable