Skip to content

Commit d3135f4

Browse files
feat: Add axon rest endpoints for raw SQL access (#8287)
1 parent 2f380b6 commit d3135f4

18 files changed

Lines changed: 782 additions & 22 deletions

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 122
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9e0cbe82902910e818ebad8e8633d6e8730c288fbecc105c26fe3f1a571928c1.yml
3-
openapi_spec_hash: 558fa609a2b40ebf526e47f7e1af4491
4-
config_hash: 2dbb07d90e3e2d37fa6645af119965d5
1+
configured_endpoints: 124
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c576eb67f119a7eb5815d4a3bf413c652cd7e4c257095e3b6b51967fe72fc00e.yml
3+
openapi_spec_hash: 0a4d20adf725a121e39a3442afa34b32
4+
config_hash: a759c23a5a04ad26f8740acc7e094c01

api.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,33 @@ from runloop_api_client.types import (
105105

106106
Methods:
107107

108-
- <code title="post /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons.py">create</a>(\*\*<a href="src/runloop_api_client/types/axon_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
109-
- <code title="get /v1/axons/{id}">client.axons.<a href="./src/runloop_api_client/resources/axons.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
110-
- <code title="get /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons.py">list</a>() -> <a href="./src/runloop_api_client/types/axon_list_view.py">AxonListView</a></code>
111-
- <code title="post /v1/axons/{id}/publish">client.axons.<a href="./src/runloop_api_client/resources/axons.py">publish</a>(id, \*\*<a href="src/runloop_api_client/types/axon_publish_params.py">params</a>) -> <a href="./src/runloop_api_client/types/publish_result_view.py">PublishResultView</a></code>
112-
- <code title="get /v1/axons/{id}/subscribe/sse">client.axons.<a href="./src/runloop_api_client/resources/axons.py">subscribe_sse</a>(id) -> <a href="./src/runloop_api_client/types/axon_event_view.py">AxonEventView</a></code>
108+
- <code title="post /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">create</a>(\*\*<a href="src/runloop_api_client/types/axon_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
109+
- <code title="get /v1/axons/{id}">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
110+
- <code title="get /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">list</a>() -> <a href="./src/runloop_api_client/types/axon_list_view.py">AxonListView</a></code>
111+
- <code title="post /v1/axons/{id}/publish">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">publish</a>(id, \*\*<a href="src/runloop_api_client/types/axon_publish_params.py">params</a>) -> <a href="./src/runloop_api_client/types/publish_result_view.py">PublishResultView</a></code>
112+
- <code title="get /v1/axons/{id}/subscribe/sse">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">subscribe_sse</a>(id) -> <a href="./src/runloop_api_client/types/axon_event_view.py">AxonEventView</a></code>
113+
114+
## Sql
115+
116+
Types:
117+
118+
```python
119+
from runloop_api_client.types.axons import (
120+
SqlBatchParams,
121+
SqlBatchResultView,
122+
SqlColumnMetaView,
123+
SqlQueryResultView,
124+
SqlResultMetaView,
125+
SqlStatementParams,
126+
SqlStepErrorView,
127+
SqlStepResultView,
128+
)
129+
```
130+
131+
Methods:
132+
133+
- <code title="post /v1/axons/{id}/sql/batch">client.axons.sql.<a href="./src/runloop_api_client/resources/axons/sql.py">batch</a>(id, \*\*<a href="src/runloop_api_client/types/axons/sql_batch_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axons/sql_batch_result_view.py">SqlBatchResultView</a></code>
134+
- <code title="post /v1/axons/{id}/sql/query">client.axons.sql.<a href="./src/runloop_api_client/resources/axons/sql.py">query</a>(id, \*\*<a href="src/runloop_api_client/types/axons/sql_query_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axons/sql_query_result_view.py">SqlQueryResultView</a></code>
113135

114136
# Blueprints
115137

src/runloop_api_client/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@
4747
gateway_configs,
4848
network_policies,
4949
)
50-
from .resources.axons import AxonsResource, AsyncAxonsResource
5150
from .resources.agents import AgentsResource, AsyncAgentsResource
5251
from .resources.objects import ObjectsResource, AsyncObjectsResource
5352
from .resources.secrets import SecretsResource, AsyncSecretsResource
5453
from .resources.benchmarks import BenchmarksResource, AsyncBenchmarksResource
5554
from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource
55+
from .resources.axons.axons import AxonsResource, AsyncAxonsResource
5656
from .resources.mcp_configs import McpConfigsResource, AsyncMcpConfigsResource
5757
from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource
5858
from .resources.benchmark_jobs import BenchmarkJobsResource, AsyncBenchmarkJobsResource
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .sql import (
4+
SqlResource,
5+
AsyncSqlResource,
6+
SqlResourceWithRawResponse,
7+
AsyncSqlResourceWithRawResponse,
8+
SqlResourceWithStreamingResponse,
9+
AsyncSqlResourceWithStreamingResponse,
10+
)
11+
from .axons import (
12+
AxonsResource,
13+
AsyncAxonsResource,
14+
AxonsResourceWithRawResponse,
15+
AsyncAxonsResourceWithRawResponse,
16+
AxonsResourceWithStreamingResponse,
17+
AsyncAxonsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"SqlResource",
22+
"AsyncSqlResource",
23+
"SqlResourceWithRawResponse",
24+
"AsyncSqlResourceWithRawResponse",
25+
"SqlResourceWithStreamingResponse",
26+
"AsyncSqlResourceWithStreamingResponse",
27+
"AxonsResource",
28+
"AsyncAxonsResource",
29+
"AxonsResourceWithRawResponse",
30+
"AsyncAxonsResourceWithRawResponse",
31+
"AxonsResourceWithStreamingResponse",
32+
"AsyncAxonsResourceWithStreamingResponse",
33+
]

src/runloop_api_client/resources/axons.py renamed to src/runloop_api_client/resources/axons/axons.py

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,40 @@
77

88
import httpx
99

10-
from ..types import axon_create_params, axon_publish_params
11-
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
12-
from .._utils import path_template, maybe_transform, async_maybe_transform
13-
from .._compat import cached_property
14-
from .._resource import SyncAPIResource, AsyncAPIResource
15-
from .._response import (
10+
from .sql import (
11+
SqlResource,
12+
AsyncSqlResource,
13+
SqlResourceWithRawResponse,
14+
AsyncSqlResourceWithRawResponse,
15+
SqlResourceWithStreamingResponse,
16+
AsyncSqlResourceWithStreamingResponse,
17+
)
18+
from ...types import axon_create_params, axon_publish_params
19+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
20+
from ..._utils import path_template, maybe_transform, async_maybe_transform
21+
from ..._compat import cached_property
22+
from ..._resource import SyncAPIResource, AsyncAPIResource
23+
from ..._response import (
1624
to_raw_response_wrapper,
1725
to_streamed_response_wrapper,
1826
async_to_raw_response_wrapper,
1927
async_to_streamed_response_wrapper,
2028
)
21-
from .._streaming import Stream, AsyncStream
22-
from .._base_client import make_request_options
23-
from ..types.axon_view import AxonView
24-
from ..types.axon_list_view import AxonListView
25-
from ..types.axon_event_view import AxonEventView
26-
from ..types.publish_result_view import PublishResultView
29+
from ..._streaming import Stream, AsyncStream
30+
from ..._base_client import make_request_options
31+
from ...types.axon_view import AxonView
32+
from ...types.axon_list_view import AxonListView
33+
from ...types.axon_event_view import AxonEventView
34+
from ...types.publish_result_view import PublishResultView
2735

2836
__all__ = ["AxonsResource", "AsyncAxonsResource"]
2937

3038

3139
class AxonsResource(SyncAPIResource):
40+
@cached_property
41+
def sql(self) -> SqlResource:
42+
return SqlResource(self._client)
43+
3244
@cached_property
3345
def with_raw_response(self) -> AxonsResourceWithRawResponse:
3446
"""
@@ -241,6 +253,10 @@ def subscribe_sse(
241253

242254

243255
class AsyncAxonsResource(AsyncAPIResource):
256+
@cached_property
257+
def sql(self) -> AsyncSqlResource:
258+
return AsyncSqlResource(self._client)
259+
244260
@cached_property
245261
def with_raw_response(self) -> AsyncAxonsResourceWithRawResponse:
246262
"""
@@ -472,6 +488,10 @@ def __init__(self, axons: AxonsResource) -> None:
472488
axons.subscribe_sse,
473489
)
474490

491+
@cached_property
492+
def sql(self) -> SqlResourceWithRawResponse:
493+
return SqlResourceWithRawResponse(self._axons.sql)
494+
475495

476496
class AsyncAxonsResourceWithRawResponse:
477497
def __init__(self, axons: AsyncAxonsResource) -> None:
@@ -493,6 +513,10 @@ def __init__(self, axons: AsyncAxonsResource) -> None:
493513
axons.subscribe_sse,
494514
)
495515

516+
@cached_property
517+
def sql(self) -> AsyncSqlResourceWithRawResponse:
518+
return AsyncSqlResourceWithRawResponse(self._axons.sql)
519+
496520

497521
class AxonsResourceWithStreamingResponse:
498522
def __init__(self, axons: AxonsResource) -> None:
@@ -514,6 +538,10 @@ def __init__(self, axons: AxonsResource) -> None:
514538
axons.subscribe_sse,
515539
)
516540

541+
@cached_property
542+
def sql(self) -> SqlResourceWithStreamingResponse:
543+
return SqlResourceWithStreamingResponse(self._axons.sql)
544+
517545

518546
class AsyncAxonsResourceWithStreamingResponse:
519547
def __init__(self, axons: AsyncAxonsResource) -> None:
@@ -534,3 +562,7 @@ def __init__(self, axons: AsyncAxonsResource) -> None:
534562
self.subscribe_sse = async_to_streamed_response_wrapper(
535563
axons.subscribe_sse,
536564
)
565+
566+
@cached_property
567+
def sql(self) -> AsyncSqlResourceWithStreamingResponse:
568+
return AsyncSqlResourceWithStreamingResponse(self._axons.sql)

0 commit comments

Comments
 (0)