Skip to content

customStream configuration #10455

@ShashwatPS

Description

@ShashwatPS

Description

consumeStream({
        stream: serverStream,
        onError: async (error) => {
          // Manually calling abort here
        },
      });

Using customStream to manually consume the stream and check for errors. Does customStream automatically call the onFinish handler, or do I need to invoke it manually inside the onError callback ?

Also, is it possible to call an abort function inside customStream ? When the stream errors out, shouldn’t it automatically stop making the manual call useless ?

AI SDK Version

ai: ^6.0.0-beta.98

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions