Skip to content

TextStreamResponse

Namespace: Vercel.AI.Util

public sealed class TextStreamResponse

HTTP response whose body is a UTF-8 text stream.

Inheritance: object

View source

TextStreamResponse(int, string?, HeaderCollection, ReadableStream<byte[]>)

Section titled “TextStreamResponse(int, string?, HeaderCollection, ReadableStream<byte[]>)”
public TextStreamResponse(int status, string? statusText, HeaderCollection headers, ReadableStream<byte[]> body)

Creates the response.

Parameters

Name Type Description
status int
statusText string
headers HeaderCollection
body ReadableStream&lt;byte\[\]&gt;

View source

public ReadableStream<byte[]> Body { get; }

UTF-8 encoded body chunks.

Value: ReadableStream&lt;byte\[\]&gt;

View source

public HeaderCollection Headers { get; }

Response headers, including the default content type when the caller did not set one.

Value: HeaderCollection

View source

public int Status { get; }

HTTP status. Defaults to 200.

Value: int

View source

public string? StatusText { get; }

HTTP status text.

Value: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product