Skip to main content

Function: localChatTransport()

localChatTransport(options): ChatSessionTransport

Defined in: react/src/transports/local-chat-transport.ts:27

A transport that runs each turn in this process (a browser chat whose model calls go through a proxy) and streams it to useChat through core's UI message projection, the same one a chat route answers with. clear() clears the chat's history.

Turns share the chat's history, so they run one at a time: a turn starts once the one before it has stopped writing, and clear() waits for it too. A stopped turn's stream ends at once, but its run may write a little longer.

Parameters​

options​

LocalChatTransportOptions

Returns​

ChatSessionTransport