mirror of
https://github.com/TanStack/ai.git
synced 2026-11-18 19:34:58 +00:00
1.4 KiB
1.4 KiB
| id | title |
|---|---|
| defineChatMiddleware | defineChatMiddleware |
Function: defineChatMiddleware()
function defineChatMiddleware<TContext, TRequires, TProvides, TInterruptDefinitions>(middleware): DefinedChatMiddleware<TContext, TRequires, TProvides, TInterruptDefinitions>;
Defined in: packages/ai/src/activities/chat/middleware/define.ts:27
Identity helper for authoring middleware with precise capability inference.
Returns the middleware unchanged at runtime; only sharpens its type so the
chat() array coverage check and createChatMiddleware builder can read the
exact requires/provides.
Type Parameters
TContext
TContext = unknown
TRequires
TRequires extends readonly CapabilityHandle[] = readonly []
TProvides
TProvides extends readonly CapabilityHandle[] = readonly []
TInterruptDefinitions
TInterruptDefinitions extends AnyInterruptDefinition = never
Parameters
middleware
ChatMiddleware<TContext, TInterruptDefinitions> & object
Returns
DefinedChatMiddleware<TContext, TRequires, TProvides, TInterruptDefinitions>