How long a provider's HTTP calls may take, as configured in the timeouts block of a named provider section:
llm4s.providers.my-openai {
provider = "openai"
model = "gpt-4o"
timeouts { request = 3m, stream = 15m }
}
Each value is optional. An absent value means ''this provider's own default'', which differs by client (for example 2 minutes for a Gemini or Ollama request and 10 minutes for its stream), so a client reads a timeout with requestOr or streamOr and supplies its own default. A section without a timeouts block behaves exactly as it did before the block existed.
requestbounds a call that returns one response: a completion, an embedding.streambounds a streamed completion, from the request to the end of the stream. It is separate because a long generation legitimately outlives a request that returns at once.
A value must be positive and finite: java.net.http.HttpRequest.timeout rejects anything else, and Duration.Inf is not a FiniteDuration. Loading a section checks it (validated); a value set with withRequest or withStream on a hand-built config is not checked until a client uses it.
The constructor is private: build one with the companion apply or ProviderTimeouts.default and adjust it with the with* setters, so adding a field later never breaks a caller.
Value parameters
- request
-
the timeout of a call that returns one response, or
Nonefor the client's default - stream
-
the timeout of a streamed completion, or
Nonefor the client's default
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any