Skip to content

Commit 76b3d88

Browse files
feat: Implement Search API v1 providers
Stainless-Generated-From: 88a2e9eb1b30837e304011693f8598389cfb45bb
1 parent e230ce3 commit 76b3d88

26 files changed

Lines changed: 2991 additions & 1 deletion

‎.stats.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 165
1+
configured_endpoints: 169

‎api.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,3 +735,40 @@ Methods:
735735
- <code title="delete /org/credential_providers/{id}">client.credential_providers.<a href="./src/kernel/resources/credential_providers.py">delete</a>(id) -> None</code>
736736
- <code title="get /org/credential_providers/{id}/items">client.credential_providers.<a href="./src/kernel/resources/credential_providers.py">list_items</a>(id) -> <a href="./src/kernel/types/credential_provider_list_items_response.py">CredentialProviderListItemsResponse</a></code>
737737
- <code title="post /org/credential_providers/{id}/test">client.credential_providers.<a href="./src/kernel/resources/credential_providers.py">test</a>(id) -> <a href="./src/kernel/types/credential_provider_test_result.py">CredentialProviderTestResult</a></code>
738+
739+
# Search
740+
741+
Types:
742+
743+
```python
744+
from kernel.types import Attempt, ProviderTarget, Request, Result, Search, Strategy, Usage, Warning
745+
```
746+
747+
Methods:
748+
749+
- <code title="post /search">client.search.<a href="./src/kernel/resources/search/search.py">create</a>(\*\*<a href="src/kernel/types/search_create_params.py">params</a>) -> <a href="./src/kernel/types/search/search.py">Search</a></code>
750+
- <code title="get /search/{id}">client.search.<a href="./src/kernel/resources/search/search.py">retrieve</a>(id) -> <a href="./src/kernel/types/search/search.py">Search</a></code>
751+
752+
## Contents
753+
754+
Types:
755+
756+
```python
757+
from kernel.types.search import FetchRequest, Response
758+
```
759+
760+
Methods:
761+
762+
- <code title="post /search/{id}/contents">client.search.contents.<a href="./src/kernel/resources/search/contents.py">fetch</a>(id, \*\*<a href="src/kernel/types/search/content_fetch_params.py">params</a>) -> None</code>
763+
764+
## Providers
765+
766+
Types:
767+
768+
```python
769+
from kernel.types.search import Provider, ProviderListResponse
770+
```
771+
772+
Methods:
773+
774+
- <code title="get /search/providers">client.search.providers.<a href="./src/kernel/resources/search/providers.py">list</a>(\*\*<a href="src/kernel/types/search/provider_list_params.py">params</a>) -> <a href="./src/kernel/types/search/provider_list_response.py">ProviderListResponse</a></code>

‎src/kernel/_client.py‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
from .resources import (
5858
apps,
5959
auth,
60+
search,
6061
vaults,
6162
proxies,
6263
api_keys,
@@ -85,6 +86,7 @@
8586
from .resources.deployments import DeploymentsResource, AsyncDeploymentsResource
8687
from .resources.invocations import InvocationsResource, AsyncInvocationsResource
8788
from .resources.browser_pools import BrowserPoolsResource, AsyncBrowserPoolsResource
89+
from .resources.search.search import SearchResource, AsyncSearchResource
8890
from .resources.vaults.vaults import VaultsResource, AsyncVaultsResource
8991
from .resources.browsers.browsers import BrowsersResource, AsyncBrowsersResource
9092
from .resources.projects.projects import ProjectsResource, AsyncProjectsResource
@@ -348,6 +350,13 @@ def credential_providers(self) -> CredentialProvidersResource:
348350

349351
return CredentialProvidersResource(self)
350352

353+
@cached_property
354+
def search(self) -> SearchResource:
355+
"""Search the web and retrieve content for selected results."""
356+
from .resources.search import SearchResource
357+
358+
return SearchResource(self)
359+
351360
@cached_property
352361
def with_raw_response(self) -> KernelWithRawResponse:
353362
return KernelWithRawResponse(self)
@@ -752,6 +761,13 @@ def credential_providers(self) -> AsyncCredentialProvidersResource:
752761

753762
return AsyncCredentialProvidersResource(self)
754763

764+
@cached_property
765+
def search(self) -> AsyncSearchResource:
766+
"""Search the web and retrieve content for selected results."""
767+
from .resources.search import AsyncSearchResource
768+
769+
return AsyncSearchResource(self)
770+
755771
@cached_property
756772
def with_raw_response(self) -> AsyncKernelWithRawResponse:
757773
return AsyncKernelWithRawResponse(self)
@@ -1058,6 +1074,13 @@ def credential_providers(self) -> credential_providers.CredentialProvidersResour
10581074

10591075
return CredentialProvidersResourceWithRawResponse(self._client.credential_providers)
10601076

1077+
@cached_property
1078+
def search(self) -> search.SearchResourceWithRawResponse:
1079+
"""Search the web and retrieve content for selected results."""
1080+
from .resources.search import SearchResourceWithRawResponse
1081+
1082+
return SearchResourceWithRawResponse(self._client.search)
1083+
10611084

10621085
class AsyncKernelWithRawResponse:
10631086
_client: AsyncKernel
@@ -1196,6 +1219,13 @@ def credential_providers(self) -> credential_providers.AsyncCredentialProvidersR
11961219

11971220
return AsyncCredentialProvidersResourceWithRawResponse(self._client.credential_providers)
11981221

1222+
@cached_property
1223+
def search(self) -> search.AsyncSearchResourceWithRawResponse:
1224+
"""Search the web and retrieve content for selected results."""
1225+
from .resources.search import AsyncSearchResourceWithRawResponse
1226+
1227+
return AsyncSearchResourceWithRawResponse(self._client.search)
1228+
11991229

12001230
class KernelWithStreamedResponse:
12011231
_client: Kernel
@@ -1334,6 +1364,13 @@ def credential_providers(self) -> credential_providers.CredentialProvidersResour
13341364

13351365
return CredentialProvidersResourceWithStreamingResponse(self._client.credential_providers)
13361366

1367+
@cached_property
1368+
def search(self) -> search.SearchResourceWithStreamingResponse:
1369+
"""Search the web and retrieve content for selected results."""
1370+
from .resources.search import SearchResourceWithStreamingResponse
1371+
1372+
return SearchResourceWithStreamingResponse(self._client.search)
1373+
13371374

13381375
class AsyncKernelWithStreamedResponse:
13391376
_client: AsyncKernel
@@ -1472,6 +1509,13 @@ def credential_providers(self) -> credential_providers.AsyncCredentialProvidersR
14721509

14731510
return AsyncCredentialProvidersResourceWithStreamingResponse(self._client.credential_providers)
14741511

1512+
@cached_property
1513+
def search(self) -> search.AsyncSearchResourceWithStreamingResponse:
1514+
"""Search the web and retrieve content for selected results."""
1515+
from .resources.search import AsyncSearchResourceWithStreamingResponse
1516+
1517+
return AsyncSearchResourceWithStreamingResponse(self._client.search)
1518+
14751519

14761520
Client = Kernel
14771521

‎src/kernel/resources/__init__.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
AuthResourceWithStreamingResponse,
1717
AsyncAuthResourceWithStreamingResponse,
1818
)
19+
from .search import (
20+
SearchResource,
21+
AsyncSearchResource,
22+
SearchResourceWithRawResponse,
23+
AsyncSearchResourceWithRawResponse,
24+
SearchResourceWithStreamingResponse,
25+
AsyncSearchResourceWithStreamingResponse,
26+
)
1927
from .vaults import (
2028
VaultsResource,
2129
AsyncVaultsResource,
@@ -268,4 +276,10 @@
268276
"AsyncCredentialProvidersResourceWithRawResponse",
269277
"CredentialProvidersResourceWithStreamingResponse",
270278
"AsyncCredentialProvidersResourceWithStreamingResponse",
279+
"SearchResource",
280+
"AsyncSearchResource",
281+
"SearchResourceWithRawResponse",
282+
"AsyncSearchResourceWithRawResponse",
283+
"SearchResourceWithStreamingResponse",
284+
"AsyncSearchResourceWithStreamingResponse",
271285
]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .search import (
4+
SearchResource,
5+
AsyncSearchResource,
6+
SearchResourceWithRawResponse,
7+
AsyncSearchResourceWithRawResponse,
8+
SearchResourceWithStreamingResponse,
9+
AsyncSearchResourceWithStreamingResponse,
10+
)
11+
from .contents import (
12+
ContentsResource,
13+
AsyncContentsResource,
14+
ContentsResourceWithRawResponse,
15+
AsyncContentsResourceWithRawResponse,
16+
ContentsResourceWithStreamingResponse,
17+
AsyncContentsResourceWithStreamingResponse,
18+
)
19+
from .providers import (
20+
ProvidersResource,
21+
AsyncProvidersResource,
22+
ProvidersResourceWithRawResponse,
23+
AsyncProvidersResourceWithRawResponse,
24+
ProvidersResourceWithStreamingResponse,
25+
AsyncProvidersResourceWithStreamingResponse,
26+
)
27+
28+
__all__ = [
29+
"ContentsResource",
30+
"AsyncContentsResource",
31+
"ContentsResourceWithRawResponse",
32+
"AsyncContentsResourceWithRawResponse",
33+
"ContentsResourceWithStreamingResponse",
34+
"AsyncContentsResourceWithStreamingResponse",
35+
"ProvidersResource",
36+
"AsyncProvidersResource",
37+
"ProvidersResourceWithRawResponse",
38+
"AsyncProvidersResourceWithRawResponse",
39+
"ProvidersResourceWithStreamingResponse",
40+
"AsyncProvidersResourceWithStreamingResponse",
41+
"SearchResource",
42+
"AsyncSearchResource",
43+
"SearchResourceWithRawResponse",
44+
"AsyncSearchResourceWithRawResponse",
45+
"SearchResourceWithStreamingResponse",
46+
"AsyncSearchResourceWithStreamingResponse",
47+
]

0 commit comments

Comments
 (0)