Skip to content

feat(api): api update #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 61
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2d76871c6215358c176295dc168fa7f571f81df1f8df37ecbd1e4e06e7220d67.yml
configured_endpoints: 66
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5d84d2732400f196ddbe4b4e7c0e98b3f02bab9ce2ed750e69d399d898e496d1.yml
32 changes: 32 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,38 @@ Methods:
- <code title="post /v1/devboxes/{id}/upload_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">upload_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_upload_file_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_upload_file_response.py">object</a></code>
- <code title="post /v1/devboxes/{id}/write_file_contents">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">write_file_contents</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_write_file_contents_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>

## Browsers

Types:

```python
from runloop_api_client.types.devboxes import BrowserView
```

Methods:

- <code title="post /v1/devboxes/browsers">client.devboxes.browsers.<a href="./src/runloop_api_client/resources/devboxes/browsers.py">create</a>() -> <a href="./src/runloop_api_client/types/devboxes/browser_view.py">BrowserView</a></code>

## Computers

Types:

```python
from runloop_api_client.types.devboxes import (
ComputerView,
ComputerKeyboardInteractionResponse,
ComputerMouseInteractionResponse,
ComputerScreenInteractionResponse,
)
```

Methods:

- <code title="post /v1/devboxes/computers">client.devboxes.computers.<a href="./src/runloop_api_client/resources/devboxes/computers.py">create</a>(\*\*<a href="src/runloop_api_client/types/devboxes/computer_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/computer_view.py">ComputerView</a></code>
- <code title="post /v1/devboxes/computers/{id}/keyboard_interaction">client.devboxes.computers.<a href="./src/runloop_api_client/resources/devboxes/computers.py">keyboard_interaction</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py">ComputerKeyboardInteractionResponse</a></code>
- <code title="post /v1/devboxes/computers/{id}/mouse_interaction">client.devboxes.computers.<a href="./src/runloop_api_client/resources/devboxes/computers.py">mouse_interaction</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/computer_mouse_interaction_response.py">ComputerMouseInteractionResponse</a></code>
- <code title="post /v1/devboxes/computers/{id}/screen_interaction">client.devboxes.computers.<a href="./src/runloop_api_client/resources/devboxes/computers.py">screen_interaction</a>(id, \*\*<a href="src/runloop_api_client/types/devboxes/computer_screen_interaction_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devboxes/computer_screen_interaction_response.py">ComputerScreenInteractionResponse</a></code>

## Lsp

Types:
Expand Down
10 changes: 10 additions & 0 deletions src/runloop_api_client/resources/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
public: bool | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -161,6 +162,9 @@ def list(
Args:
limit: The limit of items to return. Default is 20.

public: List public benchmarks, e.g. SWE-bench. Defaults to false, i.e. only
user-defined benchmarks are listed.

starting_after: Load the next page of data starting after the item with the given ID.

extra_headers: Send extra headers
Expand All @@ -181,6 +185,7 @@ def list(
query=maybe_transform(
{
"limit": limit,
"public": public,
"starting_after": starting_after,
},
benchmark_list_params.BenchmarkListParams,
Expand Down Expand Up @@ -351,6 +356,7 @@ async def list(
self,
*,
limit: int | NotGiven = NOT_GIVEN,
public: bool | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# 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.
Expand All @@ -365,6 +371,9 @@ async def list(
Args:
limit: The limit of items to return. Default is 20.

public: List public benchmarks, e.g. SWE-bench. Defaults to false, i.e. only
user-defined benchmarks are listed.

starting_after: Load the next page of data starting after the item with the given ID.

extra_headers: Send extra headers
Expand All @@ -385,6 +394,7 @@ async def list(
query=await async_maybe_transform(
{
"limit": limit,
"public": public,
"starting_after": starting_after,
},
benchmark_list_params.BenchmarkListParams,
Expand Down
8 changes: 8 additions & 0 deletions src/runloop_api_client/resources/benchmarks/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def retrieve(
def list(
self,
*,
benchmark_id: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -94,6 +95,8 @@ def list(
List all BenchmarkRuns matching filter.

Args:
benchmark_id: The Benchmark ID to filter by.

limit: The limit of items to return. Default is 20.

starting_after: Load the next page of data starting after the item with the given ID.
Expand All @@ -115,6 +118,7 @@ def list(
timeout=timeout,
query=maybe_transform(
{
"benchmark_id": benchmark_id,
"limit": limit,
"starting_after": starting_after,
},
Expand Down Expand Up @@ -221,6 +225,7 @@ async def retrieve(
async def list(
self,
*,
benchmark_id: str | NotGiven = NOT_GIVEN,
limit: int | NotGiven = NOT_GIVEN,
starting_after: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -234,6 +239,8 @@ async def list(
List all BenchmarkRuns matching filter.

Args:
benchmark_id: The Benchmark ID to filter by.

limit: The limit of items to return. Default is 20.

starting_after: Load the next page of data starting after the item with the given ID.
Expand All @@ -255,6 +262,7 @@ async def list(
timeout=timeout,
query=await async_maybe_transform(
{
"benchmark_id": benchmark_id,
"limit": limit,
"starting_after": starting_after,
},
Expand Down
28 changes: 28 additions & 0 deletions src/runloop_api_client/resources/devboxes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
LogsResourceWithStreamingResponse,
AsyncLogsResourceWithStreamingResponse,
)
from .browsers import (
BrowsersResource,
AsyncBrowsersResource,
BrowsersResourceWithRawResponse,
AsyncBrowsersResourceWithRawResponse,
BrowsersResourceWithStreamingResponse,
AsyncBrowsersResourceWithStreamingResponse,
)
from .devboxes import (
DevboxesResource,
AsyncDevboxesResource,
Expand All @@ -24,6 +32,14 @@
DevboxesResourceWithStreamingResponse,
AsyncDevboxesResourceWithStreamingResponse,
)
from .computers import (
ComputersResource,
AsyncComputersResource,
ComputersResourceWithRawResponse,
AsyncComputersResourceWithRawResponse,
ComputersResourceWithStreamingResponse,
AsyncComputersResourceWithStreamingResponse,
)
from .executions import (
ExecutionsResource,
AsyncExecutionsResource,
Expand All @@ -34,6 +50,18 @@
)

__all__ = [
"BrowsersResource",
"AsyncBrowsersResource",
"BrowsersResourceWithRawResponse",
"AsyncBrowsersResourceWithRawResponse",
"BrowsersResourceWithStreamingResponse",
"AsyncBrowsersResourceWithStreamingResponse",
"ComputersResource",
"AsyncComputersResource",
"ComputersResourceWithRawResponse",
"AsyncComputersResourceWithRawResponse",
"ComputersResourceWithStreamingResponse",
"AsyncComputersResourceWithStreamingResponse",
"LspResource",
"AsyncLspResource",
"LspResourceWithRawResponse",
Expand Down
155 changes: 155 additions & 0 deletions src/runloop_api_client/resources/devboxes/browsers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import httpx

from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
to_raw_response_wrapper,
to_streamed_response_wrapper,
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.devboxes.browser_view import BrowserView

__all__ = ["BrowsersResource", "AsyncBrowsersResource"]


class BrowsersResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> BrowsersResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers
"""
return BrowsersResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> BrowsersResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response
"""
return BrowsersResourceWithStreamingResponse(self)

def create(
self,
*,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> BrowserView:
"""Create a Devbox that has a managed Browser and begin the boot process.

As part
of booting the Devbox, the browser will automatically be started with connection
utilities activated.
"""
return self._post(
"/v1/devboxes/browsers",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=BrowserView,
)


class AsyncBrowsersResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncBrowsersResourceWithRawResponse:
"""
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers
"""
return AsyncBrowsersResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncBrowsersResourceWithStreamingResponse:
"""
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response
"""
return AsyncBrowsersResourceWithStreamingResponse(self)

async def create(
self,
*,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> BrowserView:
"""Create a Devbox that has a managed Browser and begin the boot process.

As part
of booting the Devbox, the browser will automatically be started with connection
utilities activated.
"""
return await self._post(
"/v1/devboxes/browsers",
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=BrowserView,
)


class BrowsersResourceWithRawResponse:
def __init__(self, browsers: BrowsersResource) -> None:
self._browsers = browsers

self.create = to_raw_response_wrapper(
browsers.create,
)


class AsyncBrowsersResourceWithRawResponse:
def __init__(self, browsers: AsyncBrowsersResource) -> None:
self._browsers = browsers

self.create = async_to_raw_response_wrapper(
browsers.create,
)


class BrowsersResourceWithStreamingResponse:
def __init__(self, browsers: BrowsersResource) -> None:
self._browsers = browsers

self.create = to_streamed_response_wrapper(
browsers.create,
)


class AsyncBrowsersResourceWithStreamingResponse:
def __init__(self, browsers: AsyncBrowsersResource) -> None:
self._browsers = browsers

self.create = async_to_streamed_response_wrapper(
browsers.create,
)
Loading