Skip to content

Commit d7bd8a2

Browse files
feat: Enhance agent authentication with optional login page URL and auth ch…
1 parent 2ba9e57 commit d7bd8a2

26 files changed

+1904
-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: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-3a68acd8c46e121c66be5b4c30bb4e962967840ca0f31070905baa39635fbc2d.yml
3-
openapi_spec_hash: 9453963fbb01de3e0afb462b16cdf115
4-
config_hash: 6dbe88d2ba9df1ec46cedbfdb7d00000
1+
configured_endpoints: 80
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8a37652fa586b8932466d16285359a89988505f850787f8257d0c4c7053da173.yml
3+
openapi_spec_hash: 042765a113f6d08109e8146b302323ec
4+
config_hash: 113f1e5bc3567628a5d51c70bc00969d

api.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,40 @@ Methods:
280280
- <code title="post /browser_pools/{id_or_name}/acquire">client.browser_pools.<a href="./src/kernel/resources/browser_pools.py">acquire</a>(id_or_name, \*\*<a href="src/kernel/types/browser_pool_acquire_params.py">params</a>) -> <a href="./src/kernel/types/browser_pool_acquire_response.py">BrowserPoolAcquireResponse</a></code>
281281
- <code title="post /browser_pools/{id_or_name}/flush">client.browser_pools.<a href="./src/kernel/resources/browser_pools.py">flush</a>(id_or_name) -> None</code>
282282
- <code title="post /browser_pools/{id_or_name}/release">client.browser_pools.<a href="./src/kernel/resources/browser_pools.py">release</a>(id_or_name, \*\*<a href="src/kernel/types/browser_pool_release_params.py">params</a>) -> None</code>
283+
284+
# Agents
285+
286+
## Auth
287+
288+
Types:
289+
290+
```python
291+
from kernel.types.agents import (
292+
AgentAuthDiscoverResponse,
293+
AgentAuthInvocationResponse,
294+
AgentAuthStartResponse,
295+
AgentAuthSubmitResponse,
296+
AuthAgent,
297+
DiscoveredField,
298+
)
299+
```
300+
301+
Methods:
302+
303+
- <code title="get /agents/auth/{id}">client.agents.auth.<a href="./src/kernel/resources/agents/auth/auth.py">retrieve</a>(id) -> <a href="./src/kernel/types/agents/auth_agent.py">AuthAgent</a></code>
304+
- <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>
305+
306+
### Invocations
307+
308+
Types:
309+
310+
```python
311+
from kernel.types.agents.auth import InvocationExchangeResponse
312+
```
313+
314+
Methods:
315+
316+
- <code title="get /agents/auth/invocations/{invocation_id}">client.agents.auth.invocations.<a href="./src/kernel/resources/agents/auth/invocations.py">retrieve</a>(invocation_id) -> <a href="./src/kernel/types/agents/agent_auth_invocation_response.py">AgentAuthInvocationResponse</a></code>
317+
- <code title="post /agents/auth/invocations/{invocation_id}/discover">client.agents.auth.invocations.<a href="./src/kernel/resources/agents/auth/invocations.py">discover</a>(invocation_id, \*\*<a href="src/kernel/types/agents/auth/invocation_discover_params.py">params</a>) -> <a href="./src/kernel/types/agents/agent_auth_discover_response.py">AgentAuthDiscoverResponse</a></code>
318+
- <code title="post /agents/auth/invocations/{invocation_id}/exchange">client.agents.auth.invocations.<a href="./src/kernel/resources/agents/auth/invocations.py">exchange</a>(invocation_id, \*\*<a href="src/kernel/types/agents/auth/invocation_exchange_params.py">params</a>) -> <a href="./src/kernel/types/agents/auth/invocation_exchange_response.py">InvocationExchangeResponse</a></code>
319+
- <code title="post /agents/auth/invocations/{invocation_id}/submit">client.agents.auth.invocations.<a href="./src/kernel/resources/agents/auth/invocations.py">submit</a>(invocation_id, \*\*<a href="src/kernel/types/agents/auth/invocation_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__ = [
@@ -58,6 +59,7 @@ class Kernel(SyncAPIClient):
5859
proxies: proxies.ProxiesResource
5960
extensions: extensions.ExtensionsResource
6061
browser_pools: browser_pools.BrowserPoolsResource
62+
agents: agents.AgentsResource
6163
with_raw_response: KernelWithRawResponse
6264
with_streaming_response: KernelWithStreamedResponse
6365

@@ -147,6 +149,7 @@ def __init__(
147149
self.proxies = proxies.ProxiesResource(self)
148150
self.extensions = extensions.ExtensionsResource(self)
149151
self.browser_pools = browser_pools.BrowserPoolsResource(self)
152+
self.agents = agents.AgentsResource(self)
150153
self.with_raw_response = KernelWithRawResponse(self)
151154
self.with_streaming_response = KernelWithStreamedResponse(self)
152155

@@ -266,6 +269,7 @@ class AsyncKernel(AsyncAPIClient):
266269
proxies: proxies.AsyncProxiesResource
267270
extensions: extensions.AsyncExtensionsResource
268271
browser_pools: browser_pools.AsyncBrowserPoolsResource
272+
agents: agents.AsyncAgentsResource
269273
with_raw_response: AsyncKernelWithRawResponse
270274
with_streaming_response: AsyncKernelWithStreamedResponse
271275

@@ -355,6 +359,7 @@ def __init__(
355359
self.proxies = proxies.AsyncProxiesResource(self)
356360
self.extensions = extensions.AsyncExtensionsResource(self)
357361
self.browser_pools = browser_pools.AsyncBrowserPoolsResource(self)
362+
self.agents = agents.AsyncAgentsResource(self)
358363
self.with_raw_response = AsyncKernelWithRawResponse(self)
359364
self.with_streaming_response = AsyncKernelWithStreamedResponse(self)
360365

@@ -475,6 +480,7 @@ def __init__(self, client: Kernel) -> None:
475480
self.proxies = proxies.ProxiesResourceWithRawResponse(client.proxies)
476481
self.extensions = extensions.ExtensionsResourceWithRawResponse(client.extensions)
477482
self.browser_pools = browser_pools.BrowserPoolsResourceWithRawResponse(client.browser_pools)
483+
self.agents = agents.AgentsResourceWithRawResponse(client.agents)
478484

479485

480486
class AsyncKernelWithRawResponse:
@@ -487,6 +493,7 @@ def __init__(self, client: AsyncKernel) -> None:
487493
self.proxies = proxies.AsyncProxiesResourceWithRawResponse(client.proxies)
488494
self.extensions = extensions.AsyncExtensionsResourceWithRawResponse(client.extensions)
489495
self.browser_pools = browser_pools.AsyncBrowserPoolsResourceWithRawResponse(client.browser_pools)
496+
self.agents = agents.AsyncAgentsResourceWithRawResponse(client.agents)
490497

491498

492499
class KernelWithStreamedResponse:
@@ -499,6 +506,7 @@ def __init__(self, client: Kernel) -> None:
499506
self.proxies = proxies.ProxiesResourceWithStreamingResponse(client.proxies)
500507
self.extensions = extensions.ExtensionsResourceWithStreamingResponse(client.extensions)
501508
self.browser_pools = browser_pools.BrowserPoolsResourceWithStreamingResponse(client.browser_pools)
509+
self.agents = agents.AgentsResourceWithStreamingResponse(client.agents)
502510

503511

504512
class AsyncKernelWithStreamedResponse:
@@ -511,6 +519,7 @@ def __init__(self, client: AsyncKernel) -> None:
511519
self.proxies = proxies.AsyncProxiesResourceWithStreamingResponse(client.proxies)
512520
self.extensions = extensions.AsyncExtensionsResourceWithStreamingResponse(client.extensions)
513521
self.browser_pools = browser_pools.AsyncBrowserPoolsResourceWithStreamingResponse(client.browser_pools)
522+
self.agents = agents.AsyncAgentsResourceWithStreamingResponse(client.agents)
514523

515524

516525
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,
@@ -114,4 +122,10 @@
114122
"AsyncBrowserPoolsResourceWithRawResponse",
115123
"BrowserPoolsResourceWithStreamingResponse",
116124
"AsyncBrowserPoolsResourceWithStreamingResponse",
125+
"AgentsResource",
126+
"AsyncAgentsResource",
127+
"AgentsResourceWithRawResponse",
128+
"AsyncAgentsResourceWithRawResponse",
129+
"AgentsResourceWithStreamingResponse",
130+
"AsyncAgentsResourceWithStreamingResponse",
117131
]
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 .invocations import (
12+
InvocationsResource,
13+
AsyncInvocationsResource,
14+
InvocationsResourceWithRawResponse,
15+
AsyncInvocationsResourceWithRawResponse,
16+
InvocationsResourceWithStreamingResponse,
17+
AsyncInvocationsResourceWithStreamingResponse,
18+
)
19+
20+
__all__ = [
21+
"InvocationsResource",
22+
"AsyncInvocationsResource",
23+
"InvocationsResourceWithRawResponse",
24+
"AsyncInvocationsResourceWithRawResponse",
25+
"InvocationsResourceWithStreamingResponse",
26+
"AsyncInvocationsResourceWithStreamingResponse",
27+
"AuthResource",
28+
"AsyncAuthResource",
29+
"AuthResourceWithRawResponse",
30+
"AsyncAuthResourceWithRawResponse",
31+
"AuthResourceWithStreamingResponse",
32+
"AsyncAuthResourceWithStreamingResponse",
33+
]

0 commit comments

Comments
 (0)