injectFakeAgentSession

The controls of the fake session behind the agent provideFakeAgent provided: push, stream, setError, submits and the rest. It is a signal because a thread switch gives the agent another fake session. Call it in an injection context.

import { injectFakeAgentSession } from '@threadplane/angular/chat/testing';

Declaration · overload 1

export declare function injectFakeAgentSession<TTools extends {
    [K in keyof TTools]: ToolContract;
} = Record<string, ToolContract>, TState = unknown>(ref?: AgentRef<AgentSession<TTools, TState>>): Signal<FakeAgentSession<TTools, TState>>;

Type parameters

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

Parameters

ref · optional
AgentRef<AgentSession<TTools, TState>>

Returns

Signal<FakeAgentSession<TTools, TState>>