@threadplane/ag-uiFunctionv0.3.7

createSession

Creates the session that owns one AG-UI thread. It is a core AgentSession: its snapshot is the core snapshot with the protocol evidence behind it.

import { createSession } from '@threadplane/ag-ui';

Declaration · overload 1

export declare function createSession<T extends Record<string, FunctionToolDefinition>, D extends StateDeclaration | undefined = undefined>(options: DeclaredSessionOptions<D>, tools: T & CheckedTools<T>): ClientToolSession<ToolContracts<T>, InferState<D>>;

Type parameters

T
Record<string, FunctionToolDefinition>
D
StateDeclaration | undefined Default: undefined

Parameters

options · required
DeclaredSessionOptions<D>
tools · required
T & CheckedTools<T>

Returns

ClientToolSession<ToolContracts<T>, InferState<D>>

Declaration · overload 2

export declare function createSession<D extends StateDeclaration | undefined = undefined>(options: DeclaredSessionOptions<D>): Session<InferState<D>>;

Type parameters

D
StateDeclaration | undefined Default: undefined

Parameters

options · required
DeclaredSessionOptions<D>

Returns

Session<InferState<D>>