Skip to content

Commit b872928

Browse files
feat: Mason/agent auth api
1 parent 9a1e7bf commit b872928

24 files changed

+1640
-4
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 66
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-2af1b468584cb44aa9babbbfb82bff4055614fbb5c815084a6b7dacc1cf1a822.yml
3-
openapi_spec_hash: 891affa2849341ea01d62011125f7edc
4-
config_hash: 9421eb86b7f3f4b274f123279da3858e
1+
configured_endpoints: 71
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-bb3f37e55117a56e7a4208bd646d3a68adeb651ced8531e13fbfc1fc9dcb05a4.yml
3+
openapi_spec_hash: 7303ce8ce3130e16a6a5c2bb49e43e9b
4+
config_hash: be146470fb2d4583b6533859f0fa48f5

api.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,38 @@ Methods:
243243
- <code title="get /extensions/{id_or_name}">client.extensions.<a href="./src/kernel/resources/extensions.py">download</a>(id_or_name) -> BinaryAPIResponse</code>
244244
- <code title="get /extensions/from_chrome_store">client.extensions.<a href="./src/kernel/resources/extensions.py">download_from_chrome_store</a>(\*\*<a href="src/kernel/types/extension_download_from_chrome_store_params.py">params</a>) -> BinaryAPIResponse</code>
245245
- <code title="post /extensions">client.extensions.<a href="./src/kernel/resources/extensions.py">upload</a>(\*\*<a href="src/kernel/types/extension_upload_params.py">params</a>) -> <a href="./src/kernel/types/extension_upload_response.py">ExtensionUploadResponse</a></code>
246+
247+
# Agents
248+
249+
## Auth
250+
251+
Types:
252+
253+
```python
254+
from kernel.types.agents import (
255+
AgentAuthDiscoverResponse,
256+
AgentAuthRunResponse,
257+
AgentAuthStartResponse,
258+
AgentAuthSubmitResponse,
259+
DiscoveredField,
260+
)
261+
```
262+
263+
Methods:
264+
265+
- <code title="post /agents/auth/start">client.agents.auth.<a href="./src/kernel/resources/agents/auth/auth.py">start</a>(\*\*<a href="src/kernel/types/agents/auth_start_params.py">params</a>) -> <a href="./src/kernel/types/agents/agent_auth_start_response.py">AgentAuthStartResponse</a></code>
266+
267+
### Runs
268+
269+
Types:
270+
271+
```python
272+
from kernel.types.agents.auth import RunExchangeResponse
273+
```
274+
275+
Methods:
276+
277+
- <code title="get /agents/auth/runs/{run_id}">client.agents.auth.runs.<a href="./src/kernel/resources/agents/auth/runs.py">retrieve</a>(run_id) -> <a href="./src/kernel/types/agents/agent_auth_run_response.py">AgentAuthRunResponse</a></code>
278+
- <code title="post /agents/auth/runs/{run_id}/discover">client.agents.auth.runs.<a href="./src/kernel/resources/agents/auth/runs.py">discover</a>(run_id) -> <a href="./src/kernel/types/agents/agent_auth_discover_response.py">AgentAuthDiscoverResponse</a></code>
279+
- <code title="post /agents/auth/runs/{run_id}/exchange">client.agents.auth.runs.<a href="./src/kernel/resources/agents/auth/runs.py">exchange</a>(run_id, \*\*<a href="src/kernel/types/agents/auth/run_exchange_params.py">params</a>) -> <a href="./src/kernel/types/agents/auth/run_exchange_response.py">RunExchangeResponse</a></code>
280+
- <code title="post /agents/auth/runs/{run_id}/submit">client.agents.auth.runs.<a href="./src/kernel/resources/agents/auth/runs.py">submit</a>(run_id, \*\*<a href="src/kernel/types/agents/auth/run_submit_params.py">params</a>) -> <a href="./src/kernel/types/agents/agent_auth_submit_response.py">AgentAuthSubmitResponse</a></code>

src/kernel/_client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
SyncAPIClient,
3030
AsyncAPIClient,
3131
)
32+
from .resources.agents import agents
3233
from .resources.browsers import browsers
3334

3435
__all__ = [
@@ -57,6 +58,7 @@ class Kernel(SyncAPIClient):
5758
profiles: profiles.ProfilesResource
5859
proxies: proxies.ProxiesResource
5960
extensions: extensions.ExtensionsResource
61+
agents: agents.AgentsResource
6062
with_raw_response: KernelWithRawResponse
6163
with_streaming_response: KernelWithStreamedResponse
6264

@@ -145,6 +147,7 @@ def __init__(
145147
self.profiles = profiles.ProfilesResource(self)
146148
self.proxies = proxies.ProxiesResource(self)
147149
self.extensions = extensions.ExtensionsResource(self)
150+
self.agents = agents.AgentsResource(self)
148151
self.with_raw_response = KernelWithRawResponse(self)
149152
self.with_streaming_response = KernelWithStreamedResponse(self)
150153

@@ -263,6 +266,7 @@ class AsyncKernel(AsyncAPIClient):
263266
profiles: profiles.AsyncProfilesResource
264267
proxies: proxies.AsyncProxiesResource
265268
extensions: extensions.AsyncExtensionsResource
269+
agents: agents.AsyncAgentsResource
266270
with_raw_response: AsyncKernelWithRawResponse
267271
with_streaming_response: AsyncKernelWithStreamedResponse
268272

@@ -351,6 +355,7 @@ def __init__(
351355
self.profiles = profiles.AsyncProfilesResource(self)
352356
self.proxies = proxies.AsyncProxiesResource(self)
353357
self.extensions = extensions.AsyncExtensionsResource(self)
358+
self.agents = agents.AsyncAgentsResource(self)
354359
self.with_raw_response = AsyncKernelWithRawResponse(self)
355360
self.with_streaming_response = AsyncKernelWithStreamedResponse(self)
356361

@@ -470,6 +475,7 @@ def __init__(self, client: Kernel) -> None:
470475
self.profiles = profiles.ProfilesResourceWithRawResponse(client.profiles)
471476
self.proxies = proxies.ProxiesResourceWithRawResponse(client.proxies)
472477
self.extensions = extensions.ExtensionsResourceWithRawResponse(client.extensions)
478+
self.agents = agents.AgentsResourceWithRawResponse(client.agents)
473479

474480

475481
class AsyncKernelWithRawResponse:
@@ -481,6 +487,7 @@ def __init__(self, client: AsyncKernel) -> None:
481487
self.profiles = profiles.AsyncProfilesResourceWithRawResponse(client.profiles)
482488
self.proxies = proxies.AsyncProxiesResourceWithRawResponse(client.proxies)
483489
self.extensions = extensions.AsyncExtensionsResourceWithRawResponse(client.extensions)
490+
self.agents = agents.AsyncAgentsResourceWithRawResponse(client.agents)
484491

485492

486493
class KernelWithStreamedResponse:
@@ -492,6 +499,7 @@ def __init__(self, client: Kernel) -> None:
492499
self.profiles = profiles.ProfilesResourceWithStreamingResponse(client.profiles)
493500
self.proxies = proxies.ProxiesResourceWithStreamingResponse(client.proxies)
494501
self.extensions = extensions.ExtensionsResourceWithStreamingResponse(client.extensions)
502+
self.agents = agents.AgentsResourceWithStreamingResponse(client.agents)
495503

496504

497505
class AsyncKernelWithStreamedResponse:
@@ -503,6 +511,7 @@ def __init__(self, client: AsyncKernel) -> None:
503511
self.profiles = profiles.AsyncProfilesResourceWithStreamingResponse(client.profiles)
504512
self.proxies = proxies.AsyncProxiesResourceWithStreamingResponse(client.proxies)
505513
self.extensions = extensions.AsyncExtensionsResourceWithStreamingResponse(client.extensions)
514+
self.agents = agents.AsyncAgentsResourceWithStreamingResponse(client.agents)
506515

507516

508517
Client = Kernel

src/kernel/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
AppsResourceWithStreamingResponse,
99
AsyncAppsResourceWithStreamingResponse,
1010
)
11+
from .agents import (
12+
AgentsResource,
13+
AsyncAgentsResource,
14+
AgentsResourceWithRawResponse,
15+
AsyncAgentsResourceWithRawResponse,
16+
AgentsResourceWithStreamingResponse,
17+
AsyncAgentsResourceWithStreamingResponse,
18+
)
1119
from .proxies import (
1220
ProxiesResource,
1321
AsyncProxiesResource,
@@ -100,4 +108,10 @@
100108
"AsyncExtensionsResourceWithRawResponse",
101109
"ExtensionsResourceWithStreamingResponse",
102110
"AsyncExtensionsResourceWithStreamingResponse",
111+
"AgentsResource",
112+
"AsyncAgentsResource",
113+
"AgentsResourceWithRawResponse",
114+
"AsyncAgentsResourceWithRawResponse",
115+
"AgentsResourceWithStreamingResponse",
116+
"AsyncAgentsResourceWithStreamingResponse",
103117
]
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 .auth import (
4+
AuthResource,
5+
AsyncAuthResource,
6+
AuthResourceWithRawResponse,
7+
AsyncAuthResourceWithRawResponse,
8+
AuthResourceWithStreamingResponse,
9+
AsyncAuthResourceWithStreamingResponse,
10+
)
11+
from .agents import (
12+
AgentsResource,
13+
AsyncAgentsResource,
14+
AgentsResourceWithRawResponse,
15+
AsyncAgentsResourceWithRawResponse,
16+
AgentsResourceWithStreamingResponse,
17+
AsyncAgentsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"AuthResource",
22+
"AsyncAuthResource",
23+
"AuthResourceWithRawResponse",
24+
"AsyncAuthResourceWithRawResponse",
25+
"AuthResourceWithStreamingResponse",
26+
"AsyncAuthResourceWithStreamingResponse",
27+
"AgentsResource",
28+
"AsyncAgentsResource",
29+
"AgentsResourceWithRawResponse",
30+
"AsyncAgentsResourceWithRawResponse",
31+
"AgentsResourceWithStreamingResponse",
32+
"AsyncAgentsResourceWithStreamingResponse",
33+
]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from ..._compat import cached_property
6+
from .auth.auth import (
7+
AuthResource,
8+
AsyncAuthResource,
9+
AuthResourceWithRawResponse,
10+
AsyncAuthResourceWithRawResponse,
11+
AuthResourceWithStreamingResponse,
12+
AsyncAuthResourceWithStreamingResponse,
13+
)
14+
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
16+
__all__ = ["AgentsResource", "AsyncAgentsResource"]
17+
18+
19+
class AgentsResource(SyncAPIResource):
20+
@cached_property
21+
def auth(self) -> AuthResource:
22+
return AuthResource(self._client)
23+
24+
@cached_property
25+
def with_raw_response(self) -> AgentsResourceWithRawResponse:
26+
"""
27+
This property can be used as a prefix for any HTTP method call to return
28+
the raw response object instead of the parsed content.
29+
30+
For more information, see https://www.github.com/onkernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
31+
"""
32+
return AgentsResourceWithRawResponse(self)
33+
34+
@cached_property
35+
def with_streaming_response(self) -> AgentsResourceWithStreamingResponse:
36+
"""
37+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38+
39+
For more information, see https://www.github.com/onkernel/kernel-python-sdk#with_streaming_response
40+
"""
41+
return AgentsResourceWithStreamingResponse(self)
42+
43+
44+
class AsyncAgentsResource(AsyncAPIResource):
45+
@cached_property
46+
def auth(self) -> AsyncAuthResource:
47+
return AsyncAuthResource(self._client)
48+
49+
@cached_property
50+
def with_raw_response(self) -> AsyncAgentsResourceWithRawResponse:
51+
"""
52+
This property can be used as a prefix for any HTTP method call to return
53+
the raw response object instead of the parsed content.
54+
55+
For more information, see https://www.github.com/onkernel/kernel-python-sdk#accessing-raw-response-data-eg-headers
56+
"""
57+
return AsyncAgentsResourceWithRawResponse(self)
58+
59+
@cached_property
60+
def with_streaming_response(self) -> AsyncAgentsResourceWithStreamingResponse:
61+
"""
62+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63+
64+
For more information, see https://www.github.com/onkernel/kernel-python-sdk#with_streaming_response
65+
"""
66+
return AsyncAgentsResourceWithStreamingResponse(self)
67+
68+
69+
class AgentsResourceWithRawResponse:
70+
def __init__(self, agents: AgentsResource) -> None:
71+
self._agents = agents
72+
73+
@cached_property
74+
def auth(self) -> AuthResourceWithRawResponse:
75+
return AuthResourceWithRawResponse(self._agents.auth)
76+
77+
78+
class AsyncAgentsResourceWithRawResponse:
79+
def __init__(self, agents: AsyncAgentsResource) -> None:
80+
self._agents = agents
81+
82+
@cached_property
83+
def auth(self) -> AsyncAuthResourceWithRawResponse:
84+
return AsyncAuthResourceWithRawResponse(self._agents.auth)
85+
86+
87+
class AgentsResourceWithStreamingResponse:
88+
def __init__(self, agents: AgentsResource) -> None:
89+
self._agents = agents
90+
91+
@cached_property
92+
def auth(self) -> AuthResourceWithStreamingResponse:
93+
return AuthResourceWithStreamingResponse(self._agents.auth)
94+
95+
96+
class AsyncAgentsResourceWithStreamingResponse:
97+
def __init__(self, agents: AsyncAgentsResource) -> None:
98+
self._agents = agents
99+
100+
@cached_property
101+
def auth(self) -> AsyncAuthResourceWithStreamingResponse:
102+
return AsyncAuthResourceWithStreamingResponse(self._agents.auth)
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 .auth import (
4+
AuthResource,
5+
AsyncAuthResource,
6+
AuthResourceWithRawResponse,
7+
AsyncAuthResourceWithRawResponse,
8+
AuthResourceWithStreamingResponse,
9+
AsyncAuthResourceWithStreamingResponse,
10+
)
11+
from .runs import (
12+
RunsResource,
13+
AsyncRunsResource,
14+
RunsResourceWithRawResponse,
15+
AsyncRunsResourceWithRawResponse,
16+
RunsResourceWithStreamingResponse,
17+
AsyncRunsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"RunsResource",
22+
"AsyncRunsResource",
23+
"RunsResourceWithRawResponse",
24+
"AsyncRunsResourceWithRawResponse",
25+
"RunsResourceWithStreamingResponse",
26+
"AsyncRunsResourceWithStreamingResponse",
27+
"AuthResource",
28+
"AsyncAuthResource",
29+
"AuthResourceWithRawResponse",
30+
"AsyncAuthResourceWithRawResponse",
31+
"AuthResourceWithStreamingResponse",
32+
"AsyncAuthResourceWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)