Skip to content

Commit e943905

Browse files
chore(internal): codegen related update
1 parent 8954c97 commit e943905

File tree

5 files changed

+67
-72
lines changed

5 files changed

+67
-72
lines changed

src/contextual/_client.py

+19-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import httpx
1010

11-
from . import resources, _exceptions
11+
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
1414
NOT_GIVEN,
@@ -31,13 +31,14 @@
3131
SyncAPIClient,
3232
AsyncAPIClient,
3333
)
34+
from .resources.datastores import datastores
35+
from .resources.applications import applications
3436

3537
__all__ = [
3638
"Timeout",
3739
"Transport",
3840
"ProxiesTypes",
3941
"RequestOptions",
40-
"resources",
4142
"ContextualAI",
4243
"AsyncContextualAI",
4344
"Client",
@@ -46,8 +47,8 @@
4647

4748

4849
class ContextualAI(SyncAPIClient):
49-
datastores: resources.DatastoresResource
50-
applications: resources.ApplicationsResource
50+
datastores: datastores.DatastoresResource
51+
applications: applications.ApplicationsResource
5152
with_raw_response: ContextualAIWithRawResponse
5253
with_streaming_response: ContextualAIWithStreamedResponse
5354

@@ -105,8 +106,8 @@ def __init__(
105106
_strict_response_validation=_strict_response_validation,
106107
)
107108

108-
self.datastores = resources.DatastoresResource(self)
109-
self.applications = resources.ApplicationsResource(self)
109+
self.datastores = datastores.DatastoresResource(self)
110+
self.applications = applications.ApplicationsResource(self)
110111
self.with_raw_response = ContextualAIWithRawResponse(self)
111112
self.with_streaming_response = ContextualAIWithStreamedResponse(self)
112113

@@ -216,8 +217,8 @@ def _make_status_error(
216217

217218

218219
class AsyncContextualAI(AsyncAPIClient):
219-
datastores: resources.AsyncDatastoresResource
220-
applications: resources.AsyncApplicationsResource
220+
datastores: datastores.AsyncDatastoresResource
221+
applications: applications.AsyncApplicationsResource
221222
with_raw_response: AsyncContextualAIWithRawResponse
222223
with_streaming_response: AsyncContextualAIWithStreamedResponse
223224

@@ -275,8 +276,8 @@ def __init__(
275276
_strict_response_validation=_strict_response_validation,
276277
)
277278

278-
self.datastores = resources.AsyncDatastoresResource(self)
279-
self.applications = resources.AsyncApplicationsResource(self)
279+
self.datastores = datastores.AsyncDatastoresResource(self)
280+
self.applications = applications.AsyncApplicationsResource(self)
280281
self.with_raw_response = AsyncContextualAIWithRawResponse(self)
281282
self.with_streaming_response = AsyncContextualAIWithStreamedResponse(self)
282283

@@ -387,26 +388,26 @@ def _make_status_error(
387388

388389
class ContextualAIWithRawResponse:
389390
def __init__(self, client: ContextualAI) -> None:
390-
self.datastores = resources.DatastoresResourceWithRawResponse(client.datastores)
391-
self.applications = resources.ApplicationsResourceWithRawResponse(client.applications)
391+
self.datastores = datastores.DatastoresResourceWithRawResponse(client.datastores)
392+
self.applications = applications.ApplicationsResourceWithRawResponse(client.applications)
392393

393394

394395
class AsyncContextualAIWithRawResponse:
395396
def __init__(self, client: AsyncContextualAI) -> None:
396-
self.datastores = resources.AsyncDatastoresResourceWithRawResponse(client.datastores)
397-
self.applications = resources.AsyncApplicationsResourceWithRawResponse(client.applications)
397+
self.datastores = datastores.AsyncDatastoresResourceWithRawResponse(client.datastores)
398+
self.applications = applications.AsyncApplicationsResourceWithRawResponse(client.applications)
398399

399400

400401
class ContextualAIWithStreamedResponse:
401402
def __init__(self, client: ContextualAI) -> None:
402-
self.datastores = resources.DatastoresResourceWithStreamingResponse(client.datastores)
403-
self.applications = resources.ApplicationsResourceWithStreamingResponse(client.applications)
403+
self.datastores = datastores.DatastoresResourceWithStreamingResponse(client.datastores)
404+
self.applications = applications.ApplicationsResourceWithStreamingResponse(client.applications)
404405

405406

406407
class AsyncContextualAIWithStreamedResponse:
407408
def __init__(self, client: AsyncContextualAI) -> None:
408-
self.datastores = resources.AsyncDatastoresResourceWithStreamingResponse(client.datastores)
409-
self.applications = resources.AsyncApplicationsResourceWithStreamingResponse(client.applications)
409+
self.datastores = datastores.AsyncDatastoresResourceWithStreamingResponse(client.datastores)
410+
self.applications = applications.AsyncApplicationsResourceWithStreamingResponse(client.applications)
410411

411412

412413
Client = ContextualAI

src/contextual/resources/applications/applications.py

+24-27
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
import httpx
88

9-
from .tune import (
10-
TuneResource,
11-
AsyncTuneResource,
12-
TuneResourceWithRawResponse,
13-
AsyncTuneResourceWithRawResponse,
14-
TuneResourceWithStreamingResponse,
15-
AsyncTuneResourceWithStreamingResponse,
16-
)
179
from .query import (
1810
QueryResource,
1911
AsyncQueryResource,
@@ -28,22 +20,6 @@
2820
maybe_transform,
2921
async_maybe_transform,
3022
)
31-
from .datasets import (
32-
DatasetsResource,
33-
AsyncDatasetsResource,
34-
DatasetsResourceWithRawResponse,
35-
AsyncDatasetsResourceWithRawResponse,
36-
DatasetsResourceWithStreamingResponse,
37-
AsyncDatasetsResourceWithStreamingResponse,
38-
)
39-
from .evaluate import (
40-
EvaluateResource,
41-
AsyncEvaluateResource,
42-
EvaluateResourceWithRawResponse,
43-
AsyncEvaluateResourceWithRawResponse,
44-
EvaluateResourceWithStreamingResponse,
45-
AsyncEvaluateResourceWithStreamingResponse,
46-
)
4723
from .metadata import (
4824
MetadataResource,
4925
AsyncMetadataResource,
@@ -53,7 +29,14 @@
5329
AsyncMetadataResourceWithStreamingResponse,
5430
)
5531
from ..._compat import cached_property
56-
from .tune.tune import TuneResource, AsyncTuneResource
32+
from .tune.tune import (
33+
TuneResource,
34+
AsyncTuneResource,
35+
TuneResourceWithRawResponse,
36+
AsyncTuneResourceWithRawResponse,
37+
TuneResourceWithStreamingResponse,
38+
AsyncTuneResourceWithStreamingResponse,
39+
)
5740
from ..._resource import SyncAPIResource, AsyncAPIResource
5841
from ..._response import (
5942
to_raw_response_wrapper,
@@ -62,8 +45,22 @@
6245
async_to_streamed_response_wrapper,
6346
)
6447
from ..._base_client import make_request_options
65-
from .datasets.datasets import DatasetsResource, AsyncDatasetsResource
66-
from .evaluate.evaluate import EvaluateResource, AsyncEvaluateResource
48+
from .datasets.datasets import (
49+
DatasetsResource,
50+
AsyncDatasetsResource,
51+
DatasetsResourceWithRawResponse,
52+
AsyncDatasetsResourceWithRawResponse,
53+
DatasetsResourceWithStreamingResponse,
54+
AsyncDatasetsResourceWithStreamingResponse,
55+
)
56+
from .evaluate.evaluate import (
57+
EvaluateResource,
58+
AsyncEvaluateResource,
59+
EvaluateResourceWithRawResponse,
60+
AsyncEvaluateResourceWithRawResponse,
61+
EvaluateResourceWithStreamingResponse,
62+
AsyncEvaluateResourceWithStreamingResponse,
63+
)
6764
from ...types.application_list import ApplicationList
6865
from ...types.create_application_output import CreateApplicationOutput
6966

src/contextual/resources/applications/evaluate/evaluate.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,21 @@
77

88
import httpx
99

10-
from .jobs import (
11-
JobsResource,
12-
AsyncJobsResource,
13-
JobsResourceWithRawResponse,
14-
AsyncJobsResourceWithRawResponse,
15-
JobsResourceWithStreamingResponse,
16-
AsyncJobsResourceWithStreamingResponse,
17-
)
1810
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
1911
from ...._utils import (
2012
extract_files,
2113
maybe_transform,
2214
deepcopy_minimal,
2315
async_maybe_transform,
2416
)
25-
from .jobs.jobs import JobsResource, AsyncJobsResource
17+
from .jobs.jobs import (
18+
JobsResource,
19+
AsyncJobsResource,
20+
JobsResourceWithRawResponse,
21+
AsyncJobsResourceWithRawResponse,
22+
JobsResourceWithStreamingResponse,
23+
AsyncJobsResourceWithStreamingResponse,
24+
)
2625
from ...._compat import cached_property
2726
from ...._resource import SyncAPIResource, AsyncAPIResource
2827
from ...._response import (

src/contextual/resources/applications/tune/tune.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66

77
import httpx
88

9-
from .jobs import (
10-
JobsResource,
11-
AsyncJobsResource,
12-
JobsResourceWithRawResponse,
13-
AsyncJobsResourceWithRawResponse,
14-
JobsResourceWithStreamingResponse,
15-
AsyncJobsResourceWithStreamingResponse,
16-
)
179
from .models import (
1810
ModelsResource,
1911
AsyncModelsResource,
@@ -29,7 +21,14 @@
2921
deepcopy_minimal,
3022
async_maybe_transform,
3123
)
32-
from .jobs.jobs import JobsResource, AsyncJobsResource
24+
from .jobs.jobs import (
25+
JobsResource,
26+
AsyncJobsResource,
27+
JobsResourceWithRawResponse,
28+
AsyncJobsResourceWithRawResponse,
29+
JobsResourceWithStreamingResponse,
30+
AsyncJobsResourceWithStreamingResponse,
31+
)
3332
from ...._compat import cached_property
3433
from ...._resource import SyncAPIResource, AsyncAPIResource
3534
from ...._response import (

src/contextual/resources/datastores/datastores.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
AsyncMetadataResourceWithStreamingResponse,
2020
)
2121
from ..._compat import cached_property
22-
from .documents import (
23-
DocumentsResource,
24-
AsyncDocumentsResource,
25-
DocumentsResourceWithRawResponse,
26-
AsyncDocumentsResourceWithRawResponse,
27-
DocumentsResourceWithStreamingResponse,
28-
AsyncDocumentsResourceWithStreamingResponse,
29-
)
3022
from ..._resource import SyncAPIResource, AsyncAPIResource
3123
from ..._response import (
3224
to_raw_response_wrapper,
@@ -36,7 +28,14 @@
3628
)
3729
from ..._base_client import make_request_options
3830
from ...types.datastore import Datastore
39-
from .documents.documents import DocumentsResource, AsyncDocumentsResource
31+
from .documents.documents import (
32+
DocumentsResource,
33+
AsyncDocumentsResource,
34+
DocumentsResourceWithRawResponse,
35+
AsyncDocumentsResourceWithRawResponse,
36+
DocumentsResourceWithStreamingResponse,
37+
AsyncDocumentsResourceWithStreamingResponse,
38+
)
4039
from ...types.create_datastore_output import CreateDatastoreOutput
4140

4241
__all__ = ["DatastoresResource", "AsyncDatastoresResource"]

0 commit comments

Comments
 (0)