chalkpy 2.99.1__py3-none-any.whl → 2.99.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chalk/_version.py +1 -1
- chalk/client/__init__.py +2 -0
- chalk/client/client.py +3 -0
- chalk/client/client_grpc.py +28 -2
- chalk/client/client_impl.py +30 -3
- {chalkpy-2.99.1.dist-info → chalkpy-2.99.3.dist-info}/METADATA +1 -1
- {chalkpy-2.99.1.dist-info → chalkpy-2.99.3.dist-info}/RECORD +10 -10
- {chalkpy-2.99.1.dist-info → chalkpy-2.99.3.dist-info}/WHEEL +0 -0
- {chalkpy-2.99.1.dist-info → chalkpy-2.99.3.dist-info}/entry_points.txt +0 -0
- {chalkpy-2.99.1.dist-info → chalkpy-2.99.3.dist-info}/top_level.txt +0 -0
chalk/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.99.
|
|
1
|
+
__version__ = "2.99.3"
|
chalk/client/__init__.py
CHANGED
|
@@ -19,6 +19,7 @@ from chalk.client.models import (
|
|
|
19
19
|
FeatureResult,
|
|
20
20
|
GetIncrementalProgressResponse,
|
|
21
21
|
OfflineQueryContext,
|
|
22
|
+
OfflineQueryDeadlineOptions,
|
|
22
23
|
OnlineQuery,
|
|
23
24
|
OnlineQueryContext,
|
|
24
25
|
OnlineQueryResponse,
|
|
@@ -54,6 +55,7 @@ __all__ = [
|
|
|
54
55
|
"FeatureResult",
|
|
55
56
|
"GetIncrementalProgressResponse",
|
|
56
57
|
"OfflineQueryContext",
|
|
58
|
+
"OfflineQueryDeadlineOptions",
|
|
57
59
|
"OnlineQuery",
|
|
58
60
|
"OnlineQueryContext",
|
|
59
61
|
"OnlineQueryResponse",
|
chalk/client/client.py
CHANGED
|
@@ -1174,6 +1174,7 @@ class ChalkClient:
|
|
|
1174
1174
|
self,
|
|
1175
1175
|
name: str,
|
|
1176
1176
|
query_version: str | None = None,
|
|
1177
|
+
branch: str | None = None,
|
|
1177
1178
|
) -> List[NamedQueryMetadata]:
|
|
1178
1179
|
"""
|
|
1179
1180
|
Get the metadata associated with named queries.
|
|
@@ -1184,6 +1185,8 @@ class ChalkClient:
|
|
|
1184
1185
|
The name of the named query.
|
|
1185
1186
|
query_version
|
|
1186
1187
|
The query version of the named query. Returns all versions of the named query by default.
|
|
1188
|
+
branch
|
|
1189
|
+
The branch name to get the named query from. By default will use the mainline deployment.
|
|
1187
1190
|
|
|
1188
1191
|
Returns
|
|
1189
1192
|
-------
|
chalk/client/client_grpc.py
CHANGED
|
@@ -681,6 +681,12 @@ class ChalkGRPCClient:
|
|
|
681
681
|
if token_config is None:
|
|
682
682
|
raise ChalkAuthException()
|
|
683
683
|
|
|
684
|
+
# using for instantiation of ChalkClient(). Can remove if we exclusively start using GRPC client
|
|
685
|
+
self._client_id = token_config.clientId
|
|
686
|
+
self._client_secret = token_config.clientSecret
|
|
687
|
+
self._environment = token_config.activeEnvironment
|
|
688
|
+
self._api_server = token_config.apiServer
|
|
689
|
+
|
|
684
690
|
self._stub_refresher = StubRefresher(
|
|
685
691
|
token_config=token_config,
|
|
686
692
|
query_server=query_server,
|
|
@@ -1394,6 +1400,7 @@ class ChalkGRPCClient:
|
|
|
1394
1400
|
self,
|
|
1395
1401
|
name: str,
|
|
1396
1402
|
query_version: str | None = None,
|
|
1403
|
+
branch: str | None = None,
|
|
1397
1404
|
) -> List[NamedQueryMetadata]:
|
|
1398
1405
|
"""
|
|
1399
1406
|
Get the metadata associated with named queries.
|
|
@@ -1404,6 +1411,8 @@ class ChalkGRPCClient:
|
|
|
1404
1411
|
The name of the named query.
|
|
1405
1412
|
query_version
|
|
1406
1413
|
The query version of the named query. Returns all versions of the named query by default.
|
|
1414
|
+
branch
|
|
1415
|
+
The branch name to get the named query from. By default will use the mainline deployment.
|
|
1407
1416
|
|
|
1408
1417
|
Returns
|
|
1409
1418
|
-------
|
|
@@ -1412,12 +1421,29 @@ class ChalkGRPCClient:
|
|
|
1412
1421
|
|
|
1413
1422
|
Examples
|
|
1414
1423
|
--------
|
|
1415
|
-
>>> from chalk.client import
|
|
1416
|
-
>>>
|
|
1424
|
+
>>> from chalk.client.client_grpc import ChalkGRPCClient
|
|
1425
|
+
>>> ChalkGRPCClient().get_named_query_metadata(
|
|
1417
1426
|
... name="my_named_query",
|
|
1418
1427
|
... query_version="1.1.0",
|
|
1419
1428
|
... )
|
|
1420
1429
|
"""
|
|
1430
|
+
# TODO update underlying logic to be done server side and/or not split between GRPC and python client.
|
|
1431
|
+
if branch:
|
|
1432
|
+
from chalk.client import ChalkClient
|
|
1433
|
+
|
|
1434
|
+
client = ChalkClient(
|
|
1435
|
+
client_id=self._client_id,
|
|
1436
|
+
client_secret=self._client_secret,
|
|
1437
|
+
environment=self._environment,
|
|
1438
|
+
api_server=self._api_server,
|
|
1439
|
+
)
|
|
1440
|
+
|
|
1441
|
+
return client.get_named_query_metadata(
|
|
1442
|
+
name=name,
|
|
1443
|
+
query_version=query_version,
|
|
1444
|
+
branch=branch,
|
|
1445
|
+
)
|
|
1446
|
+
|
|
1421
1447
|
proto_resp = self._stub_refresher.call_get_named_query_metadata(
|
|
1422
1448
|
lambda x: x.GetNamedQueryByName(
|
|
1423
1449
|
request=GetNamedQueryByNameRequest(
|
chalk/client/client_impl.py
CHANGED
|
@@ -2571,6 +2571,7 @@ https://docs.chalk.ai/cli/apply
|
|
|
2571
2571
|
self,
|
|
2572
2572
|
name: str,
|
|
2573
2573
|
query_version: str | None = None,
|
|
2574
|
+
branch: str | None = None,
|
|
2574
2575
|
) -> List[NamedQueryMetadata]:
|
|
2575
2576
|
"""
|
|
2576
2577
|
Get the metadata associated with named queries.
|
|
@@ -2581,6 +2582,8 @@ https://docs.chalk.ai/cli/apply
|
|
|
2581
2582
|
The name of the named query.
|
|
2582
2583
|
query_version
|
|
2583
2584
|
The query version of the named query. Returns all versions of the named query by default.
|
|
2585
|
+
branch
|
|
2586
|
+
The branch name to get the named query from. By default will use the mainline deployment.
|
|
2584
2587
|
|
|
2585
2588
|
Returns
|
|
2586
2589
|
-------
|
|
@@ -2604,13 +2607,37 @@ https://docs.chalk.ai/cli/apply
|
|
|
2604
2607
|
api_server=self._api_server,
|
|
2605
2608
|
)
|
|
2606
2609
|
|
|
2607
|
-
|
|
2610
|
+
if not branch:
|
|
2611
|
+
branch = self.get_branch()
|
|
2612
|
+
|
|
2613
|
+
# TODO update underlying logic to be done server side and/or not split between GRPC and python client.
|
|
2614
|
+
|
|
2615
|
+
# named queries aren't easily available until full chalk apply, so grabbing through layered logic
|
|
2616
|
+
if branch:
|
|
2617
|
+
_branch_metadata_response = self._get_branch_info()
|
|
2618
|
+
latest_deployment_id = next(
|
|
2619
|
+
(
|
|
2620
|
+
branch_info.latest_deployment
|
|
2621
|
+
for branch_info in _branch_metadata_response.branches
|
|
2622
|
+
if branch_info.name == branch
|
|
2623
|
+
),
|
|
2624
|
+
None,
|
|
2625
|
+
)
|
|
2626
|
+
if not latest_deployment_id:
|
|
2627
|
+
raise FileNotFoundError(f"Could not find a deployment associated with branch: {branch}")
|
|
2628
|
+
|
|
2629
|
+
desired_named_query_list = [
|
|
2630
|
+
x
|
|
2631
|
+
for x in client_grpc.get_graph(latest_deployment_id).named_queries
|
|
2632
|
+
if x.name == name and (not query_version or x.query_version == query_version)
|
|
2633
|
+
]
|
|
2634
|
+
return [NamedQueryMetadata.from_proto(nq) for nq in desired_named_query_list]
|
|
2635
|
+
|
|
2636
|
+
return client_grpc.get_named_query_metadata(
|
|
2608
2637
|
name=name,
|
|
2609
2638
|
query_version=query_version,
|
|
2610
2639
|
)
|
|
2611
2640
|
|
|
2612
|
-
return resp
|
|
2613
|
-
|
|
2614
2641
|
def prompt_evaluation(
|
|
2615
2642
|
self,
|
|
2616
2643
|
prompts: list[Prompt | str],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
chalk/__init__.py,sha256=vKsx9-cl5kImlVWGHVRYO6bweBm79NAzGs3l36u71wM,2657
|
|
2
|
-
chalk/_version.py,sha256=
|
|
2
|
+
chalk/_version.py,sha256=5e5zIu_nDTY-AvXFwpeYAQ8-9xsDJzUSurX4_yPRN38,23
|
|
3
3
|
chalk/cli.py,sha256=ckqqfOI-A2mT23-rnZzDMmblYj-2x1VBX8ebHlIEn9A,5873
|
|
4
4
|
chalk/importer.py,sha256=m4lMn1lSYj_euDq8CS7LYTBnek9JOcjGJf9-82dJHbA,64441
|
|
5
5
|
chalk/prompts.py,sha256=2H9UomLAamdfRTNUdKs9i3VTpiossuyRhntqsAXUhhg,16117
|
|
@@ -611,12 +611,12 @@ chalk/_validation/feature_validation.py,sha256=AfEEHbDNzLpvPXb-KBE3MnpLCvtXzZVWb
|
|
|
611
611
|
chalk/_validation/validation.py,sha256=9cCMfZa9-1wxkXLme_ylmD5vIA1qExJD6aqbYvbmKn4,2169
|
|
612
612
|
chalk/byte_transmit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
613
613
|
chalk/byte_transmit/model.py,sha256=LFX8pj9X_CWXeap7fDnMl9YmXsYTgq7jBAbEWkxoYoE,13048
|
|
614
|
-
chalk/client/__init__.py,sha256=
|
|
615
|
-
chalk/client/client.py,sha256=
|
|
614
|
+
chalk/client/__init__.py,sha256=2sxazRlPQZDXetDJGvZsqxRZQ9KelIflzSwjujsfdAE,1850
|
|
615
|
+
chalk/client/client.py,sha256=3muGd7X1ZdcZuwbV5-4wEUgNes1fCWKWAdfnibJIz68,104960
|
|
616
616
|
chalk/client/client_async.py,sha256=YmuExumlDkenlGc8ROtmPjUE2m6nQUZisUDvJmwTRdk,51546
|
|
617
617
|
chalk/client/client_async_impl.py,sha256=ZphhgTB49JBWHCGXe-dI0wWWKc9zPcOczy02q_gFy50,6925
|
|
618
|
-
chalk/client/client_grpc.py,sha256=
|
|
619
|
-
chalk/client/client_impl.py,sha256=
|
|
618
|
+
chalk/client/client_grpc.py,sha256=UNhVLLY7I65tymPMjJ7A9CCHOkJOcnHgFKcPb4bmeXE,109930
|
|
619
|
+
chalk/client/client_impl.py,sha256=acWBpgU1xsMyFUHbrA0sdyL0NmKwwRRL4vdZzSqBrwU,217576
|
|
620
620
|
chalk/client/dataset.py,sha256=LneWwaAOHCjtj7gaJjsSeVNruj-QJ51hjRi62zrFNVE,77561
|
|
621
621
|
chalk/client/exc.py,sha256=kZJ80YbSeSRDmTLTh240j_eRdJFZBa7IaDsNSRoDroU,4145
|
|
622
622
|
chalk/client/models.py,sha256=ApXv28A44dNXUULKFkG5L6e48vDscZyFGenaXItxL94,67598
|
|
@@ -827,8 +827,8 @@ chalk/utils/tracing.py,sha256=NiiM-9dbuJhSCv6R1npR1uYNKWlkqTR6Ygm0Voi2NrY,13078
|
|
|
827
827
|
chalk/utils/weak_set_by_identity.py,sha256=VmikA_laYwFeOphCwXJIuyOIkrdlQe0bSzaXq7onoQw,953
|
|
828
828
|
chalk/utils/pydanticutil/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
829
829
|
chalk/utils/pydanticutil/pydantic_compat.py,sha256=O575lLYJ5GvZC4HMzR9yATxf9XwjC6NrDUXbNwZidlE,3031
|
|
830
|
-
chalkpy-2.99.
|
|
831
|
-
chalkpy-2.99.
|
|
832
|
-
chalkpy-2.99.
|
|
833
|
-
chalkpy-2.99.
|
|
834
|
-
chalkpy-2.99.
|
|
830
|
+
chalkpy-2.99.3.dist-info/METADATA,sha256=2uN7S8xkv-AQrL23F_48VyqoLm5t_IxzWfrtpxtTL8U,27754
|
|
831
|
+
chalkpy-2.99.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
832
|
+
chalkpy-2.99.3.dist-info/entry_points.txt,sha256=Vg23sd8icwq-morJrljVFr-kQnMbm95rZfZj5wsZGis,42
|
|
833
|
+
chalkpy-2.99.3.dist-info/top_level.txt,sha256=1Q6_19IGYfNxSw50W8tYKEJ2t5HKQ3W9Wiw4ia5yg2c,6
|
|
834
|
+
chalkpy-2.99.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|