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(
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

  • InvalidArgument if request.method is not a valid HTTP method.
  • Io if the request cannot be sent or the stream cannot be opened.
  • Timeout if a limit elapses first.

Source:<builtin>/baml/ns_http/http.bamlbytes 11398–11759