org.llm4s.sttp
Members list
Type members
Classlikes
An org.llm4s.http.Llm4sHttpClient over an sttp 4 synchronous backend, so the provider clients send their requests through the HTTP stack a service already has: its connection pool, proxy and TLS settings, logging and tracing middleware, or a stub backend in tests. Pass it with LlmClientOptions.withHttpClient.
An org.llm4s.http.Llm4sHttpClient over an sttp 4 synchronous backend, so the provider clients send their requests through the HTTP stack a service already has: its connection pool, proxy and TLS settings, logging and tracing middleware, or a stub backend in tests. Pass it with LlmClientOptions.withHttpClient.
It behaves as Llm4sHttpClient.create() does: a non-2xx status is a Right response, response headers are keyed in lower case, postStream hands back the open body (asInputStreamAlwaysUnsafe) for the caller to close, and a transport failure is the same Left - a TimeoutError for a timeout, a NetworkError for a refused connection or an I/O failure, a ValidationError for an invalid URL or an unreadable multipart file, a CancelledError for an interrupt. Each request's timeout is its sttp readTimeout.
The caller owns backend: closing this client does not close it.
Value parameters
- backend
-
any sttp 4 synchronous backend, such as
DefaultSyncBackend()wrapped in your middleware, or aSyncBackendStub
Attributes
- Source
- SttpLlm4sHttpClient.scala
- Supertypes
