Skip to content
9 min read · 1,746 words

Function: buildOllamaHistory()

ts
function buildOllamaHistory(input: {
  bucketOrder: ChatCompletionsBucketOrder;
  filterThoughts: (thoughts: Iterable<Thought>, mode: "all" | "all-self" | "latest-self", selfIdentity: string, replayCompatibility: readonly string[]) => Thought[];
  memories: Iterable<Memory>;
  messages: Iterable<Message>;
  renderChatCompletionsSystemPrompt: (input: {
     bucketOrder: ChatCompletionsBucketOrder;
     memories: Iterable<Memory>;
     renderCtx?: unknown;
     renderFirstPartyRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, renderRetrievableHandleBody?: (input: {
        artifact: unknown;
        byteLength: number;
        callId: string;
        encoding?: string;
        estimatedTokens?: number;
        lineCount: number;
     }) => string) => Promise<string>;
     renderMemories: (items: Iterable<{
        attrs: MemoryAttrs;
        memory: Memory;
     }>) => string;
     renderRetrievableHandleBody?: (input: {
        artifact: unknown;
        byteLength: number;
        callId: string;
        encoding?: string;
        estimatedTokens?: number;
        lineCount: number;
     }) => string;
     renderRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, deps: {
        renderFirstPartyRetrievables: (items: Iterable<{
           attrs: RetrievableAttrs;
           retrievable: Retrievable;
         }>, renderRetrievableHandleBody?: (input: {
           artifact: unknown;
           byteLength: number;
           callId: string;
           encoding?: string;
           estimatedTokens?: number;
           lineCount: number;
        }) => string) => Promise<string>;
        renderRetrievableHandleBody?: (input: {
           artifact: unknown;
           byteLength: number;
           callId: string;
           encoding?: string;
           estimatedTokens?: number;
           lineCount: number;
        }) => string;
        renderRetrievableSafetyDirective: () => string;
        renderThirdPartyPrivateRetrievables: (items: Iterable<{
           attrs: RetrievableAttrs;
           retrievable: Retrievable;
         }>, deps: {
           renderRetrievableHandleBody?: (input: {
              artifact: unknown;
              byteLength: number;
              callId: string;
              encoding?: ... | ...;
              estimatedTokens?: ... | ...;
              lineCount: number;
           }) => string;
           renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
        }) => Promise<string>;
        renderThirdPartyPublicRetrievables: (items: Iterable<{
           attrs: RetrievableAttrs;
           retrievable: Retrievable;
         }>, deps: {
           renderRetrievableHandleBody?: (input: {
              artifact: unknown;
              byteLength: number;
              callId: string;
              encoding?: ... | ...;
              estimatedTokens?: ... | ...;
              lineCount: number;
           }) => string;
           renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
        }) => Promise<string>;
        renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     }) => Promise<string>;
     renderRetrievableSafetyDirective: () => string;
     renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string;
     renderThirdPartyPrivateRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, deps: {
        renderRetrievableHandleBody?: (input: {
           artifact: unknown;
           byteLength: number;
           callId: string;
           encoding?: string;
           estimatedTokens?: number;
           lineCount: number;
        }) => string;
        renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     }) => Promise<string>;
     renderThirdPartyPublicRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, deps: {
        renderRetrievableHandleBody?: (input: {
           artifact: unknown;
           byteLength: number;
           callId: string;
           encoding?: string;
           estimatedTokens?: number;
           lineCount: number;
        }) => string;
        renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     }) => Promise<string>;
     renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     retrievables: Iterable<Retrievable>;
     standingInstructions: Iterable<Tokenizable>;
     systemPrompt: Tokenizable;
  }) => Promise<string>;
  renderedToolCallResults: Map<ToolCall, string>;
  renderFirstPartyRetrievables: (items: Iterable<{
     attrs: RetrievableAttrs;
     retrievable: Retrievable;
   }>, renderRetrievableHandleBody?: (input: {
     artifact: unknown;
     byteLength: number;
     callId: string;
     encoding?: string;
     estimatedTokens?: number;
     lineCount: number;
  }) => string) => Promise<string>;
  renderMemories: (items: Iterable<{
     attrs: MemoryAttrs;
     memory: Memory;
  }>) => string;
  renderOllamaTimelineMessage: (input: {
     message: Message;
     selfIdentity: string;
     unsupportedMediaPolicy: UnsupportedMediaPolicy;
     warn?: (msg: string) => void;
  }) => Promise<OllamaMessage>;
  renderOllamaToolCallResult: (input: {
     renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
     renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     results:   | Tokenizable
        | SpooledArtifact
        | Media
        | Media[]
        | SpooledArtifact[];
     tool:   | Tool<SpooledArtifact>
        | ArtifactTool
        | undefined;
     toolCall: ToolCall;
     unsupportedMediaPolicy: UnsupportedMediaPolicy;
     warn?: (msg: string) => void;
  }) => Promise<string>;
  renderRetrievableHandleBody?: (input: {
     artifact: unknown;
     byteLength: number;
     callId: string;
     encoding?: string;
     estimatedTokens?: number;
     lineCount: number;
  }) => string;
  renderRetrievables: (items: Iterable<{
     attrs: RetrievableAttrs;
     retrievable: Retrievable;
   }>, deps: {
     renderFirstPartyRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, renderRetrievableHandleBody?: (input: {
        artifact: unknown;
        byteLength: number;
        callId: string;
        encoding?: string;
        estimatedTokens?: number;
        lineCount: number;
     }) => string) => Promise<string>;
     renderRetrievableHandleBody?: (input: {
        artifact: unknown;
        byteLength: number;
        callId: string;
        encoding?: string;
        estimatedTokens?: number;
        lineCount: number;
     }) => string;
     renderRetrievableSafetyDirective: () => string;
     renderThirdPartyPrivateRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, deps: {
        renderRetrievableHandleBody?: (input: {
           artifact: unknown;
           byteLength: number;
           callId: string;
           encoding?: string;
           estimatedTokens?: number;
           lineCount: number;
        }) => string;
        renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     }) => Promise<string>;
     renderThirdPartyPublicRetrievables: (items: Iterable<{
        attrs: RetrievableAttrs;
        retrievable: Retrievable;
      }>, deps: {
        renderRetrievableHandleBody?: (input: {
           artifact: unknown;
           byteLength: number;
           callId: string;
           encoding?: string;
           estimatedTokens?: number;
           lineCount: number;
        }) => string;
        renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
     }) => Promise<string>;
     renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
  }) => Promise<string>;
  renderRetrievableSafetyDirective: () => string;
  renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string;
  renderThirdPartyPrivateRetrievables: (items: Iterable<{
     attrs: RetrievableAttrs;
     retrievable: Retrievable;
   }>, deps: {
     renderRetrievableHandleBody?: (input: {
        artifact: unknown;
        byteLength: number;
        callId: string;
        encoding?: string;
        estimatedTokens?: number;
        lineCount: number;
     }) => string;
     renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
  }) => Promise<string>;
  renderThirdPartyPublicRetrievables: (items: Iterable<{
     attrs: RetrievableAttrs;
     retrievable: Retrievable;
   }>, deps: {
     renderRetrievableHandleBody?: (input: {
        artifact: unknown;
        byteLength: number;
        callId: string;
        encoding?: string;
        estimatedTokens?: number;
        lineCount: number;
     }) => string;
     renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
  }) => Promise<string>;
  renderThought: (content: string, attrs: ThoughtAttrs, payload?: unknown) => string;
  renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
  renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string;
  replayCompatibility: readonly string[];
  retrievables: Iterable<Retrievable>;
  selfIdentity: string;
  standingInstructions: Iterable<Tokenizable>;
  systemPrompt: Tokenizable;
  thoughts: Iterable<Thought>;
  thoughtSurfacing: "all" | "all-self" | "latest-self";
  toolCalls: Iterable<ToolCall>;
  tools: ToolRegistry;
  unsupportedMediaPolicy: UnsupportedMediaPolicy;
  warn?: (msg: string) => void;
}): Promise<{
  messages: OllamaMessage[];
  reasoningPayloads: {
     id: string;
     payload: unknown;
     replayCompatibility: string;
  }[];
}>;

Defined in: src/batteries/llm/ollama/helpers.ts:537

Assembles the complete native Ollama message history for a dispatch — system prompt and content buckets, the interleaved timeline of messages/thoughts/tool calls, and the collected opaque reasoning payloads — by delegating to the injected sub-renderers.

Parameters

ParameterTypeDescription
input{ bucketOrder: ChatCompletionsBucketOrder; filterThoughts: (thoughts: Iterable<Thought>, mode: "all" | "all-self" | "latest-self", selfIdentity: string, replayCompatibility: readonly string[]) => Thought[]; memories: Iterable<Memory>; messages: Iterable<Message>; renderChatCompletionsSystemPrompt: (input: { bucketOrder: ChatCompletionsBucketOrder; memories: Iterable<Memory>; renderCtx?: unknown; renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderMemories: (items: Iterable<{ attrs: MemoryAttrs; memory: Memory; }>) => string; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievableSafetyDirective: () => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: ... | ...; estimatedTokens?: ... | ...; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: ... | ...; estimatedTokens?: ... | ...; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderRetrievableSafetyDirective: () => string; renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; retrievables: Iterable<Retrievable>; standingInstructions: Iterable<Tokenizable>; systemPrompt: Tokenizable; }) => Promise<string>; renderedToolCallResults: Map<ToolCall, string>; renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderMemories: (items: Iterable<{ attrs: MemoryAttrs; memory: Memory; }>) => string; renderOllamaTimelineMessage: (input: { message: Message; selfIdentity: string; unsupportedMediaPolicy: UnsupportedMediaPolicy; warn?: (msg: string) => void; }) => Promise<OllamaMessage>; renderOllamaToolCallResult: (input: { renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; results: | Tokenizable | SpooledArtifact | Media | Media[] | SpooledArtifact[]; tool: | Tool<SpooledArtifact> | ArtifactTool | undefined; toolCall: ToolCall; unsupportedMediaPolicy: UnsupportedMediaPolicy; warn?: (msg: string) => void; }) => Promise<string>; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievableSafetyDirective: () => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderRetrievableSafetyDirective: () => string; renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThought: (content: string, attrs: ThoughtAttrs, payload?: unknown) => string; renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; replayCompatibility: readonly string[]; retrievables: Iterable<Retrievable>; selfIdentity: string; standingInstructions: Iterable<Tokenizable>; systemPrompt: Tokenizable; thoughts: Iterable<Thought>; thoughtSurfacing: "all" | "all-self" | "latest-self"; toolCalls: Iterable<ToolCall>; tools: ToolRegistry; unsupportedMediaPolicy: UnsupportedMediaPolicy; warn?: (msg: string) => void; }-
input.bucketOrderChatCompletionsBucketOrder-
input.filterThoughts(thoughts: Iterable<Thought>, mode: "all" | "all-self" | "latest-self", selfIdentity: string, replayCompatibility: readonly string[]) => Thought[]-
input.memoriesIterable<Memory>-
input.messagesIterable<Message>-
input.renderChatCompletionsSystemPrompt(input: { bucketOrder: ChatCompletionsBucketOrder; memories: Iterable<Memory>; renderCtx?: unknown; renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderMemories: (items: Iterable<{ attrs: MemoryAttrs; memory: Memory; }>) => string; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievableSafetyDirective: () => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: ... | ...; estimatedTokens?: ... | ...; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: ... | ...; estimatedTokens?: ... | ...; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderRetrievableSafetyDirective: () => string; renderStandingInstructions: (items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; retrievables: Iterable<Retrievable>; standingInstructions: Iterable<Tokenizable>; systemPrompt: Tokenizable; }) => Promise<string>-
input.renderedToolCallResultsMap<ToolCall, string>Pre-rendered results keyed by the same live ToolCall instances iterated below.
input.renderFirstPartyRetrievables(items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>-
input.renderMemories(items: Iterable<{ attrs: MemoryAttrs; memory: Memory; }>) => string-
input.renderOllamaTimelineMessage(input: { message: Message; selfIdentity: string; unsupportedMediaPolicy: UnsupportedMediaPolicy; warn?: (msg: string) => void; }) => Promise<OllamaMessage>-
input.renderOllamaToolCallResult(input: { renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; results: | Tokenizable | SpooledArtifact | Media | Media[] | SpooledArtifact[]; tool: | Tool<SpooledArtifact> | ArtifactTool | undefined; toolCall: ToolCall; unsupportedMediaPolicy: UnsupportedMediaPolicy; warn?: (msg: string) => void; }) => Promise<string>-
input.renderRetrievableHandleBody?(input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string-
input.renderRetrievables(items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderFirstPartyRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string) => Promise<string>; renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderRetrievableSafetyDirective: () => string; renderThirdPartyPrivateRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderThirdPartyPublicRetrievables: (items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>-
input.renderRetrievableSafetyDirective() => string-
input.renderStandingInstructions(items: Iterable<Tokenizable>, attrs?: StandingInstructionAttrs) => string-
input.renderThirdPartyPrivateRetrievables(items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>-
input.renderThirdPartyPublicRetrievables(items: Iterable<{ attrs: RetrievableAttrs; retrievable: Retrievable; }>, deps: { renderRetrievableHandleBody?: (input: { artifact: unknown; byteLength: number; callId: string; encoding?: string; estimatedTokens?: number; lineCount: number; }) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; }) => Promise<string>-
input.renderThought(content: string, attrs: ThoughtAttrs, payload?: unknown) => string-
input.renderTrustedContent(content: string, attrs: TrustedContentAttrs) => string-
input.renderUntrustedContent(content: string, attrs: UntrustedContentAttrs) => string-
input.replayCompatibilityreadonly string[]-
input.retrievablesIterable<Retrievable>-
input.selfIdentitystring-
input.standingInstructionsIterable<Tokenizable>-
input.systemPromptTokenizable-
input.thoughtsIterable<Thought>-
input.thoughtSurfacing"all" | "all-self" | "latest-self"-
input.toolCallsIterable<ToolCall>-
input.toolsToolRegistry-
input.unsupportedMediaPolicyUnsupportedMediaPolicy-
input.warn?(msg: string) => void-

Returns

Promise<{ messages: OllamaMessage[]; reasoningPayloads: { id: string; payload: unknown; replayCompatibility: string; }[]; }>