Skip to content

[Feature] WebSockets implementation of ChatTransport #20446

Description

@mindplay-dk

Description

I am looking for this, basically:

#9559

It is probably outdated by now - sadly, it was just left there and no one ever even commented.

I'm building an agent that needs to do potentially many client-side tool calls, and the default SSE transport is going to suck for this - it's going to "stop the world" on every tool call, and add unreasonable HTTP overhead (and much slower requests) for a single end user chat request.

I looked everywhere and can't find a package that does this, which is frustrating - I could take that draft and try to update it and complete it (not sure how finished it is) but it's more than I'm willing to own. I could let my agent hammer something out, and it would probably work, but I'm not an expert at either AI SDK or WebSockets, so I wouldn't trust it in a work setting.

Vercel's own docs for ChatTransport actually state:

This is particularly useful for alternative communication protocols like WebSockets

It really would be. 😊

Any chance you could take a look at the work that's already been done here? 🙏

Reproduction

No response

AI SDK Version

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions