Skip to content

Commit 215c573

Browse files
chore(internal): codegen related update
1 parent e943905 commit 215c573

File tree

5 files changed

+72
-67
lines changed

5 files changed

+72
-67
lines changed

src/contextual/_client.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import httpx
1010

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

3735
__all__ = [
3836
"Timeout",
3937
"Transport",
4038
"ProxiesTypes",
4139
"RequestOptions",
40+
"resources",
4241
"ContextualAI",
4342
"AsyncContextualAI",
4443
"Client",
@@ -47,8 +46,8 @@
4746

4847

4948
class ContextualAI(SyncAPIClient):
50-
datastores: datastores.DatastoresResource
51-
applications: applications.ApplicationsResource
49+
datastores: resources.DatastoresResource
50+
applications: resources.ApplicationsResource
5251
with_raw_response: ContextualAIWithRawResponse
5352
with_streaming_response: ContextualAIWithStreamedResponse
5453

@@ -106,8 +105,8 @@ def __init__(
106105
_strict_response_validation=_strict_response_validation,
107106
)
108107

109-
self.datastores = datastores.DatastoresResource(self)
110-
self.applications = applications.ApplicationsResource(self)
108+
self.datastores = resources.DatastoresResource(self)
109+
self.applications = resources.ApplicationsResource(self)
111110
self.with_raw_response = ContextualAIWithRawResponse(self)
112111
self.with_streaming_response = ContextualAIWithStreamedResponse(self)
113112

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

218217

219218
class AsyncContextualAI(AsyncAPIClient):
220-
datastores: datastores.AsyncDatastoresResource
221-
applications: applications.AsyncApplicationsResource
219+
datastores: resources.AsyncDatastoresResource
220+
applications: resources.AsyncApplicationsResource
222221
with_raw_response: AsyncContextualAIWithRawResponse
223222
with_streaming_response: AsyncContextualAIWithStreamedResponse
224223

@@ -276,8 +275,8 @@ def __init__(
276275
_strict_response_validation=_strict_response_validation,
277276
)
278277

279-
self.datastores = datastores.AsyncDatastoresResource(self)
280-
self.applications = applications.AsyncApplicationsResource(self)
278+
self.datastores = resources.AsyncDatastoresResource(self)
279+
self.applications = resources.AsyncApplicationsResource(self)
281280
self.with_raw_response = AsyncContextualAIWithRawResponse(self)
282281
self.with_streaming_response = AsyncContextualAIWithStreamedResponse(self)
283282

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

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

394393

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

400399

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

406405

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

412411

413412
Client = ContextualAI

src/contextual/resources/applications/applications.py

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
import httpx
88

9+
from .tune import (
10+
TuneResource,
11+
AsyncTuneResource,
12+
TuneResourceWithRawResponse,
13+
AsyncTuneResourceWithRawResponse,
14+
TuneResourceWithStreamingResponse,
15+
AsyncTuneResourceWithStreamingResponse,
16+
)
917
from .query import (
1018
QueryResource,
1119
AsyncQueryResource,
@@ -20,6 +28,22 @@
2028
maybe_transform,
2129
async_maybe_transform,
2230
)
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+
)
2347
from .metadata import (
2448
MetadataResource,
2549
AsyncMetadataResource,
@@ -29,14 +53,7 @@
2953
AsyncMetadataResourceWithStreamingResponse,
3054
)
3155
from ..._compat import cached_property
32-
from .tune.tune import (
33-
TuneResource,
34-
AsyncTuneResource,
35-
TuneResourceWithRawResponse,
36-
AsyncTuneResourceWithRawResponse,
37-
TuneResourceWithStreamingResponse,
38-
AsyncTuneResourceWithStreamingResponse,
39-
)
56+
from .tune.tune import TuneResource, AsyncTuneResource
4057
from ..._resource import SyncAPIResource, AsyncAPIResource
4158
from ..._response import (
4259
to_raw_response_wrapper,
@@ -45,22 +62,8 @@
4562
async_to_streamed_response_wrapper,
4663
)
4764
from ..._base_client import make_request_options
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-
)
65+
from .datasets.datasets import DatasetsResource, AsyncDatasetsResource
66+
from .evaluate.evaluate import EvaluateResource, AsyncEvaluateResource
6467
from ...types.application_list import ApplicationList
6568
from ...types.create_application_output import CreateApplicationOutput
6669

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,22 @@
77

88
import httpx
99

10-
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
11-
from ...._utils import (
12-
extract_files,
13-
maybe_transform,
14-
deepcopy_minimal,
15-
async_maybe_transform,
16-
)
17-
from .jobs.jobs import (
10+
from .jobs import (
1811
JobsResource,
1912
AsyncJobsResource,
2013
JobsResourceWithRawResponse,
2114
AsyncJobsResourceWithRawResponse,
2215
JobsResourceWithStreamingResponse,
2316
AsyncJobsResourceWithStreamingResponse,
2417
)
18+
from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
19+
from ...._utils import (
20+
extract_files,
21+
maybe_transform,
22+
deepcopy_minimal,
23+
async_maybe_transform,
24+
)
25+
from .jobs.jobs import JobsResource, AsyncJobsResource
2526
from ...._compat import cached_property
2627
from ...._resource import SyncAPIResource, AsyncAPIResource
2728
from ...._response import (

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
import httpx
88

9+
from .jobs import (
10+
JobsResource,
11+
AsyncJobsResource,
12+
JobsResourceWithRawResponse,
13+
AsyncJobsResourceWithRawResponse,
14+
JobsResourceWithStreamingResponse,
15+
AsyncJobsResourceWithStreamingResponse,
16+
)
917
from .models import (
1018
ModelsResource,
1119
AsyncModelsResource,
@@ -21,14 +29,7 @@
2129
deepcopy_minimal,
2230
async_maybe_transform,
2331
)
24-
from .jobs.jobs import (
25-
JobsResource,
26-
AsyncJobsResource,
27-
JobsResourceWithRawResponse,
28-
AsyncJobsResourceWithRawResponse,
29-
JobsResourceWithStreamingResponse,
30-
AsyncJobsResourceWithStreamingResponse,
31-
)
32+
from .jobs.jobs import JobsResource, AsyncJobsResource
3233
from ...._compat import cached_property
3334
from ...._resource import SyncAPIResource, AsyncAPIResource
3435
from ...._response import (

src/contextual/resources/datastores/datastores.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
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+
)
2230
from ..._resource import SyncAPIResource, AsyncAPIResource
2331
from ..._response import (
2432
to_raw_response_wrapper,
@@ -28,14 +36,7 @@
2836
)
2937
from ..._base_client import make_request_options
3038
from ...types.datastore import Datastore
31-
from .documents.documents import (
32-
DocumentsResource,
33-
AsyncDocumentsResource,
34-
DocumentsResourceWithRawResponse,
35-
AsyncDocumentsResourceWithRawResponse,
36-
DocumentsResourceWithStreamingResponse,
37-
AsyncDocumentsResourceWithStreamingResponse,
38-
)
39+
from .documents.documents import DocumentsResource, AsyncDocumentsResource
3940
from ...types.create_datastore_output import CreateDatastoreOutput
4041

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

0 commit comments

Comments
 (0)