baml.http.send_sse
Sends an HTTP request and returns a Server-Sent Events stream for streaming responses.
Reference version
Signature
function baml.http.send_sse(
request: baml.http.Request,
timeout: baml.time.Duration | null = …
Sends an HTTP request and returns a Server-Sent Events stream for streaming responses.
The limits are the ones send applies: request.timeout (overridden by the
timeout argument) covers opening the stream and reading all of it, and
request.connect_timeout covers connecting. SseStream.next() throws
Timeout once the end-to-end limit elapses. Browser/Wasm does not enforce
these limits.
Throws
InvalidArgumentifrequest.methodis not a valid HTTP method.Ioif the request cannot be sent or the stream cannot be opened.Timeoutif a limit elapses first.
Source:<builtin>/baml/ns_http/http.bamlbytes 11398–11759