Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Chat handler

handleChatTurn wraps a product produce() hook with the session.run.* lifecycle envelope, drains the producer stream through the NDJSON line protocol, and calls the persist / post-process hooks after drain.

In production, produce() is a thin wrapper over runAgentTaskStream(...) against a real backend (createOpenAICompatibleBackend / createSandboxPromptBackend).

pnpm tsx examples/chat-handler/chat-handler.ts