StreamingHttpResponse

org.llm4s.http.StreamingHttpResponse
See theStreamingHttpResponse companion object
@Stable
final case class StreamingHttpResponse

HTTP response wrapper for streaming (InputStream-based) response bodies.

Use this instead of HttpResponse when the response body must be consumed incrementally (e.g. server-sent events, JSON lines).

Value parameters

body

Response body as an InputStream — caller is responsible for closing it, on error statuses too

headers

Response headers as a multi-valued map (lowercase keys) Build one with StreamingHttpResponse.apply and change it with the with* setters; the constructor and copy are private, so a new field never breaks callers.

statusCode

HTTP status code

Attributes

Companion
object
Source
Llm4sHttpClient.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def header(name: String): Option[String]

First value of header name, matched case-insensitively.

First value of header name, matched case-insensitively.

Attributes

Source
Llm4sHttpClient.scala

Sets the response body stream; the caller closes it.

Sets the response body stream; the caller closes it.

Attributes

Source
Llm4sHttpClient.scala

Sets the response headers (a multi-valued map with lowercase keys).

Sets the response headers (a multi-valued map with lowercase keys).

Attributes

Source
Llm4sHttpClient.scala

This response with a body whose reads give up: a read that has waited idle for more bytes fails with a java.net.SocketTimeoutException, and the body is closed. Time the caller spends between reads is not counted. An idle time of zero or less fails the first read that has to wait.

This response with a body whose reads give up: a read that has waited idle for more bytes fails with a java.net.SocketTimeoutException, and the body is closed. Time the caller spends between reads is not counted. An idle time of zero or less fails the first read that has to wait.

For an Llm4sHttpClient whose transport has no read timeout of its own. It relies on closing the body from another thread unblocking a read of it, as it does for a socket and for the JDK HTTP client.

Attributes

Source
Llm4sHttpClient.scala

Sets the HTTP status code.

Sets the HTTP status code.

Attributes

Source
Llm4sHttpClient.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product