Skip to content
1 min read · 93 words

Function: joinPromptParts()

ts
function joinPromptParts(
  parts: readonly PromptPart[],
  resolve: (ref: NodeRef) => EncodableValue,
): string;

Defined in: src/batteries/orchestration/reason.ts:36

Join prompt parts in order, substituting each reference's resolved value. A reference that resolves to undefined renders as the explicit absent marker '[unresolved: <nodeId>]', naming the node whose output was missing.

Parameters

| Parameter | Type | Description | | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ---------- | | parts | readonly PromptPart[] | The prompt parts to join | | resolve | (ref: NodeRef) => EncodableValue | Function that resolves a NodeRef to an EncodableValue | undefined |

Returns

string

The joined prompt string