FakeAgentConfig

Configuration for provideFakeAgent.

import type { FakeAgentConfig } from '@threadplane/angular/testing';

Declaration

export interface FakeAgentConfig<TTools extends {
    [K in keyof TTools]: ToolContract;
} = Record<string, ToolContract>, TState = unknown>  {
  readonly delayMs?: number;
  readonly onThreadId?: (threadId: string) => void;
  readonly reasoningTokens?: readonly string[];
  readonly session?: FakeAgentSessionInit<TTools, TState>;
  readonly threadId?: AgentConfig['threadId'];
  readonly tokens?: readonly string[];
}

Type parameters

TTools
{ [K in keyof TTools]: ToolContract; } Default: Record<string, ToolContract>
TState
Default: unknown

Members

delayMs

Milliseconds between entries. Defaults to 60; 0 streams without timers.

readonly delayMs?: number;

onThreadId

Called with the id the fake gives a new thread on its first submit.

readonly onThreadId?: (threadId: string) => void;

reasoningTokens

Reasoning text streamed before the reply.

readonly reasoningTokens?: readonly string[];

session

Initial snapshot fields and handlers for every fake session. An onSubmit here replaces the canned reply. Initial messages seed a thread the fake has not seen; a thread it has seen comes back with what it held.

readonly session?: FakeAgentSessionInit<TTools, TState>;

threadId

The thread to start on; a signal makes the agent follow it.

readonly threadId?: AgentConfig['threadId'];

tokens

The assistant reply, streamed one entry at a time.

readonly tokens?: readonly string[];