Skip to content

Stream build logs

build.logs(strbuild_id) -> StreamChunk
GET/v5/builds/{build_id}/logs

Stream a build’s logs as Server-Sent Events.

The response has content-type text/event-stream; each event carries one log line as an AgentexCloudBuildLogLine object, delivered as lines become available from the cloud build provider. The stream ends when the provider stops producing output. Responds with a not-found error if no such build exists for the caller’s account.

ParametersExpand Collapse
build_id: str
ReturnsExpand Collapse
class StreamChunk: …

A single log line from the build process.

line: str

The log line content

class StreamChunk: …

A single log line from the build process.

line: str

The log line content

Stream build logs

import os
from scale_gp_beta import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
for build in client.build.logs(
    "build_id",
):
  print(build)
{
  "line": "line"
}
Returns Examples
{
  "line": "line"
}