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
TRecord<string, FunctionToolDefinition>DStateDeclaration | undefinedDefault:undefined
Parameters
options· requiredDeclaredSessionOptions<D>tools· requiredT & 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
DStateDeclaration | undefinedDefault:undefined
Parameters
options· requiredDeclaredSessionOptions<D>
Returns
Session<InferState<D>>