Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions src/runloop_api_client/resources/devboxes/executions.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def stream_stderr_updates(
execution_id: str,
*,
devbox_id: str,
offset: str | NotGiven = NOT_GIVEN,
offset: str | NotGiven = '0',
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -361,11 +361,15 @@ def stream_stderr_updates(
raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}")
if not execution_id:
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
if extra_headers and extra_headers.get(RAW_RESPONSE_HEADER):

default_headers = {'Accept': 'text/event-stream'}
merged_headers = default_headers if extra_headers is None else {**default_headers, **extra_headers}

if merged_headers and merged_headers.get(RAW_RESPONSE_HEADER):
return self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand All @@ -383,7 +387,7 @@ def create_stream(last_offset: str | None) -> Stream[ExecutionUpdateChunk]:
return self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand Down Expand Up @@ -415,7 +419,7 @@ def stream_stdout_updates(
execution_id: str,
*,
devbox_id: str,
offset: str | NotGiven = NOT_GIVEN,
offset: str | NotGiven = '0',
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -441,11 +445,15 @@ def stream_stdout_updates(
raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}")
if not execution_id:
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
if extra_headers and extra_headers.get(RAW_RESPONSE_HEADER):

default_headers = {'Accept': 'text/event-stream'}
merged_headers = default_headers if extra_headers is None else {**default_headers, **extra_headers}

if merged_headers and merged_headers.get(RAW_RESPONSE_HEADER):
return self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand All @@ -463,7 +471,7 @@ def create_stream(last_offset: str | None) -> Stream[ExecutionUpdateChunk]:
return self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand Down Expand Up @@ -779,7 +787,7 @@ async def stream_stderr_updates(
execution_id: str,
*,
devbox_id: str,
offset: str | NotGiven = NOT_GIVEN,
offset: str | NotGiven = '0',
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -805,11 +813,15 @@ async def stream_stderr_updates(
raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}")
if not execution_id:
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")
if extra_headers and extra_headers.get(RAW_RESPONSE_HEADER):

default_headers = {'Accept': 'text/event-stream'}
merged_headers = default_headers if extra_headers is None else {**default_headers, **extra_headers}

if merged_headers and merged_headers.get(RAW_RESPONSE_HEADER):
return await self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand All @@ -827,7 +839,7 @@ async def create_stream(last_offset: str | None) -> AsyncStream[ExecutionUpdateC
return await self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand Down Expand Up @@ -859,7 +871,7 @@ async def stream_stdout_updates(
execution_id: str,
*,
devbox_id: str,
offset: str | NotGiven = NOT_GIVEN,
offset: str | NotGiven = '0',
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -885,12 +897,17 @@ async def stream_stdout_updates(
raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}")
if not execution_id:
raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}")

default_headers = {'Accept': 'text/event-stream'}
merged_headers = default_headers if extra_headers is None else {**default_headers, **extra_headers}


# If caller requested a raw or streaming response wrapper, return the underlying stream as-is
if extra_headers and extra_headers.get(RAW_RESPONSE_HEADER):
if merged_headers and merged_headers.get(RAW_RESPONSE_HEADER):
return await self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand All @@ -908,7 +925,7 @@ async def create_stream(last_offset: str | None) -> AsyncStream[ExecutionUpdateC
return await self._get(
f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates",
options=make_request_options(
extra_headers=extra_headers,
extra_headers=merged_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
Expand Down
Loading