Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/tools / / toResultEnvelope

Function: toResultEnvelope()

ts
function toResultEnvelope<TOutput>(opts): ResultEnvelope<TOutput>;

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

Convert a raw execute(...) return value into a canonical ResultEnvelope. Streaming-hint tools that returned void use the chunks parameter to materialise the assembled body.

Type Parameters

Type Parameter
TOutput

Parameters

ParameterType
opts{ chunks?: readonly ContentChunk[]; raw: | void | TOutput | ToolReturn&lt;TOutput&gt;; }
opts.chunks?readonly ContentChunk[]
opts.raw| void | TOutput | ToolReturn&lt;TOutput&gt;

Returns

ResultEnvelope&lt;TOutput&gt;

Stable