dyff-client 0.2.0__tar.gz → 0.2.2__tar.gz

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.
Files changed (48) hide show
  1. {dyff-client-0.2.0 → dyff-client-0.2.2}/.gitlab-ci.yml +7 -2
  2. {dyff-client-0.2.0 → dyff-client-0.2.2}/.pre-commit-config.yaml +11 -4
  3. {dyff-client-0.2.0/dyff_client.egg-info → dyff-client-0.2.2}/PKG-INFO +1 -1
  4. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/client.py +117 -55
  5. {dyff-client-0.2.0 → dyff-client-0.2.2/dyff_client.egg-info}/PKG-INFO +1 -1
  6. {dyff-client-0.2.0 → dyff-client-0.2.2}/.gitignore +0 -0
  7. {dyff-client-0.2.0 → dyff-client-0.2.2}/.licenserc.yaml +0 -0
  8. {dyff-client-0.2.0 → dyff-client-0.2.2}/.prettierignore +0 -0
  9. {dyff-client-0.2.0 → dyff-client-0.2.2}/.secrets.baseline +0 -0
  10. {dyff-client-0.2.0 → dyff-client-0.2.2}/CODE_OF_CONDUCT.md +0 -0
  11. {dyff-client-0.2.0 → dyff-client-0.2.2}/LICENSE +0 -0
  12. {dyff-client-0.2.0 → dyff-client-0.2.2}/NOTICE +0 -0
  13. {dyff-client-0.2.0 → dyff-client-0.2.2}/README.md +0 -0
  14. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/__init__.py +0 -0
  15. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/__init__.py +0 -0
  16. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/_client.py +0 -0
  17. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/_configuration.py +0 -0
  18. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/_patch.py +0 -0
  19. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/_serialization.py +0 -0
  20. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/_vendor.py +0 -0
  21. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/__init__.py +0 -0
  22. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/_client.py +0 -0
  23. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/_configuration.py +0 -0
  24. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/_patch.py +0 -0
  25. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/_vendor.py +0 -0
  26. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/__init__.py +0 -0
  27. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/_operations.py +0 -0
  28. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/aio/operations/_patch.py +0 -0
  29. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/operations/__init__.py +0 -0
  30. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/operations/_operations.py +0 -0
  31. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/operations/_patch.py +0 -0
  32. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff/client/_generated/py.typed +0 -0
  33. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff_client.egg-info/SOURCES.txt +0 -0
  34. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff_client.egg-info/dependency_links.txt +0 -0
  35. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff_client.egg-info/requires.txt +0 -0
  36. {dyff-client-0.2.0 → dyff-client-0.2.2}/dyff_client.egg-info/top_level.txt +0 -0
  37. {dyff-client-0.2.0 → dyff-client-0.2.2}/makefile +0 -0
  38. {dyff-client-0.2.0 → dyff-client-0.2.2}/package-lock.json +0 -0
  39. {dyff-client-0.2.0 → dyff-client-0.2.2}/package.json +0 -0
  40. {dyff-client-0.2.0 → dyff-client-0.2.2}/pyproject.toml +0 -0
  41. {dyff-client-0.2.0 → dyff-client-0.2.2}/scripts/inferenceservices/databricks--dolly-v2-3b--default.py +0 -0
  42. {dyff-client-0.2.0 → dyff-client-0.2.2}/scripts/inferenceservices/tiiuae--falcon-7b--default.py +0 -0
  43. {dyff-client-0.2.0 → dyff-client-0.2.2}/scripts/models/databricks--dolly-v2-3b--rox.yaml +0 -0
  44. {dyff-client-0.2.0 → dyff-client-0.2.2}/scripts/models/databricks--dolly-v2-3b.py +0 -0
  45. {dyff-client-0.2.0 → dyff-client-0.2.2}/scripts/models/tiiuae--falcon-7b--rox.yaml +0 -0
  46. {dyff-client-0.2.0 → dyff-client-0.2.2}/scripts/models/tiiuae--falcon-7b.py +0 -0
  47. {dyff-client-0.2.0 → dyff-client-0.2.2}/setup.cfg +0 -0
  48. {dyff-client-0.2.0 → dyff-client-0.2.2}/tests/test_import.py +0 -0
@@ -22,11 +22,11 @@ include:
22
22
  file:
23
23
  - detect-secrets.yml
24
24
  - project: buildgarden/pipelines/prettier
25
- ref: 0.2.0
25
+ ref: 0.3.2
26
26
  file:
27
27
  - prettier.yml
28
28
  - project: buildgarden/pipelines/python
29
- ref: 0.7.2
29
+ ref: 0.9.1
30
30
  file:
31
31
  - python-autoflake.yml
32
32
  - python-black.yml
@@ -36,6 +36,7 @@ include:
36
36
  - python-pyroma.yml
37
37
  - python-pytest.yml
38
38
  - python-twine-upload.yml
39
+ - python-docformatter.yml
39
40
  - project: buildgarden/pipelines/skywalking-eyes
40
41
  ref: 0.2.0
41
42
  file:
@@ -68,3 +69,7 @@ python-twine-upload-pypi:
68
69
  TWINE_USERNAME: __token__
69
70
  TWINE_PASSWORD: $PYPI_API_TOKEN
70
71
  TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
72
+
73
+ python-docformatter:
74
+ variables:
75
+ PYTHON_DOCFORMATTER_EXCLUDE: _generated
@@ -13,7 +13,7 @@ repos:
13
13
  - id: trailing-whitespace
14
14
 
15
15
  - repo: https://github.com/PyCQA/autoflake
16
- rev: "v2.3.0"
16
+ rev: "v2.3.1"
17
17
  hooks:
18
18
  - id: autoflake
19
19
  args:
@@ -24,7 +24,7 @@ repos:
24
24
  - "--remove-all-unused-imports"
25
25
 
26
26
  - repo: https://github.com/psf/black
27
- rev: 24.2.0
27
+ rev: 24.3.0
28
28
  hooks:
29
29
  - id: black
30
30
 
@@ -33,6 +33,13 @@ repos:
33
33
  hooks:
34
34
  - id: isort
35
35
 
36
+ - repo: https://github.com/PyCQA/docformatter
37
+ rev: v1.7.5
38
+ hooks:
39
+ - id: docformatter
40
+ additional_dependencies: [tomli]
41
+ args: ["--in-place", "--black", "--config", "./pyproject.toml"]
42
+
36
43
  - repo: https://gitlab.com/buildgarden/pipelines/skywalking-eyes
37
44
  rev: "0.2.0"
38
45
  hooks:
@@ -44,12 +51,12 @@ repos:
44
51
  - id: prettier
45
52
 
46
53
  - repo: https://gitlab.com/buildgarden/tools/badgie
47
- rev: "0.11.0"
54
+ rev: "0.11.2"
48
55
  hooks:
49
56
  - id: badgie
50
57
 
51
58
  - repo: https://gitlab.com/buildgarden/tools/cici-tools
52
- rev: "0.6.0"
59
+ rev: "0.7.0"
53
60
  hooks:
54
61
  - id: cici-update
55
62
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-client
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python client for the Dyff AI auditing platform.
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
@@ -9,6 +9,7 @@ import pathlib
9
9
  import sys
10
10
  from io import BytesIO
11
11
  from typing import Any, BinaryIO, Callable, Optional, TypeVar
12
+ from warnings import warn
12
13
 
13
14
  import httpx
14
15
  import pandas
@@ -120,10 +121,9 @@ def _require_id(x: DyffEntity | str) -> str:
120
121
 
121
122
 
122
123
  def _encode_labels(labels: Optional[dict[str, str]]) -> Optional[str]:
123
- """The Python client accepts 'annotations' and 'labels' as dicts, but
124
- they need to be json-encoded so that they can be forwarded as part of
125
- the HTTP query parameters.
126
- """
124
+ """The Python client accepts 'annotations' and 'labels' as dicts, but they need to
125
+ be json-encoded so that they can be forwarded as part of the HTTP query
126
+ parameters."""
127
127
  if labels is None:
128
128
  return None
129
129
  # validate
@@ -137,6 +137,15 @@ def _encode_labels(labels: Optional[dict[str, str]]) -> Optional[str]:
137
137
  return json.dumps(labels)
138
138
 
139
139
 
140
+ def _check_deprecated_verify_ssl_certificates(
141
+ verify_ssl_certificates: bool, insecure: bool
142
+ ):
143
+ """Check if the deprecated parameter verify_ssl_certificates is set to insecure."""
144
+ # verify_ssl_certificates deprecated
145
+ # remove after 10/2024
146
+ return not verify_ssl_certificates or insecure
147
+
148
+
140
149
  def build_audits_upload_request(
141
150
  audit_id: str, *, file: BinaryIO, **kwargs: Any
142
151
  ) -> HttpRequest:
@@ -185,6 +194,8 @@ class InferenceSessionClient:
185
194
 
186
195
  Do not instantiate this class. Create an instance using
187
196
  :meth:`inferencesessions.client() <dyff.client.client.InferencesessionsOperations>`
197
+
198
+ `verify_ssl_certifcates` is deprecated, use `insecure` instead.
188
199
  """
189
200
 
190
201
  def __init__(
@@ -197,7 +208,14 @@ class InferenceSessionClient:
197
208
  input_adapter: Optional[Adapter] = None,
198
209
  output_adapter: Optional[Adapter] = None,
199
210
  verify_ssl_certificates: bool = True,
211
+ insecure: bool = False,
200
212
  ):
213
+ # verify_ssl_certificates deprecated
214
+ # remove after 10/2024
215
+ insecure = _check_deprecated_verify_ssl_certificates(
216
+ verify_ssl_certificates, insecure
217
+ )
218
+
201
219
  self._session_id = session_id
202
220
  self._token = token
203
221
  self._dyff_api_endpoint = dyff_api_endpoint
@@ -207,15 +225,15 @@ class InferenceSessionClient:
207
225
  self._output_adapter = output_adapter
208
226
 
209
227
  self._client = httpx.Client(
210
- timeout=httpx.Timeout(5, read=None), verify=verify_ssl_certificates
228
+ timeout=httpx.Timeout(5, read=None), verify=not insecure
211
229
  )
212
230
 
213
231
  def infer(self, body: Any) -> Any:
214
232
  """Make an inference request.
215
233
 
216
- The input and output are arbitrary JSON objects. The required format
217
- depends on the endpoint and input/output adapters specified when
218
- creating the inference client.
234
+ The input and output are arbitrary JSON objects. The required format depends on
235
+ the endpoint and input/output adapters specified when creating the inference
236
+ client.
219
237
 
220
238
  :param Any body: A JSON object containing the inference input.
221
239
  :returns: A JSON object containing the inference output.
@@ -287,8 +305,8 @@ class AuditsOperations:
287
305
  labels: Optional[dict[str, str]] = None,
288
306
  name: Optional[str] = None,
289
307
  ) -> list[Audit]:
290
- """Get all Audits matching a query. The query is a set of equality
291
- constraints specified as key-value pairs.
308
+ """Get all Audits matching a query. The query is a set of equality constraints
309
+ specified as key-value pairs.
292
310
 
293
311
  :keyword id:
294
312
  :paramtype id: str
@@ -319,8 +337,8 @@ class AuditsOperations:
319
337
  ]
320
338
 
321
339
  def label(self, audit_id: str, labels: dict[str, Optional[str]]) -> None:
322
- """Label the specified Audit with key-value pairs (stored in
323
- the ``.labels`` field of the resource).
340
+ """Label the specified Audit with key-value pairs (stored in the ``.labels``
341
+ field of the resource).
324
342
 
325
343
  Providing ``None`` for the value deletes the label.
326
344
 
@@ -427,6 +445,8 @@ class DatasetsOperations:
427
445
 
428
446
  Do not instantiate this class. Access it through the
429
447
  ``.datasets`` attribute of :class:`~dyff.client.Client`.
448
+
449
+ `verify_ssl_certifcates` is deprecated, use `insecure` instead.
430
450
  """
431
451
 
432
452
  def __init__(
@@ -434,9 +454,18 @@ class DatasetsOperations:
434
454
  _raw_ops: DatasetsOperationsGenerated,
435
455
  *,
436
456
  verify_ssl_certificates: bool = True,
457
+ insecure: bool = False,
437
458
  ):
438
459
  self._raw_ops = _raw_ops
439
- self._verify_ssl_certificates = verify_ssl_certificates
460
+
461
+ # verify_ssl_certificates deprecated
462
+ # remove after 10/2024
463
+ insecure = _check_deprecated_verify_ssl_certificates(
464
+ verify_ssl_certificates, insecure
465
+ )
466
+
467
+ self._verify_ssl_certificates = not insecure
468
+ self._insecure = insecure
440
469
 
441
470
  def get(self, dataset_id: str) -> Dataset:
442
471
  """Get a Dataset by its key.
@@ -467,8 +496,8 @@ class DatasetsOperations:
467
496
  labels: Optional[dict[str, str]] = None,
468
497
  name: Optional[str] = None,
469
498
  ) -> list[Dataset]:
470
- """Get all Datasets matching a query. The query is a set of equality
471
- constraints specified as key-value pairs.
499
+ """Get all Datasets matching a query. The query is a set of equality constraints
500
+ specified as key-value pairs.
472
501
 
473
502
  :keyword id:
474
503
  :paramtype id: str
@@ -499,8 +528,8 @@ class DatasetsOperations:
499
528
  ]
500
529
 
501
530
  def label(self, dataset_id: str, labels: dict[str, Optional[str]]) -> None:
502
- """Label the specified Dataset with key-value pairs (stored in
503
- the ``.labels`` field of the resource).
531
+ """Label the specified Dataset with key-value pairs (stored in the ``.labels``
532
+ field of the resource).
504
533
 
505
534
  Providing ``None`` for the value deletes the label.
506
535
 
@@ -621,8 +650,8 @@ class DatasetsOperations:
621
650
  return self.create(request)
622
651
 
623
652
  def upload_arrow_dataset(self, dataset: Dataset, dataset_directory: str) -> None:
624
- """Uploads the data files in an existing Arrow dataset for which a
625
- Dataset resource has already been created.
653
+ """Uploads the data files in an existing Arrow dataset for which a Dataset
654
+ resource has already been created.
626
655
 
627
656
  Typical usage::
628
657
 
@@ -652,7 +681,7 @@ class DatasetsOperations:
652
681
  put_url.url,
653
682
  content=fin,
654
683
  headers=headers,
655
- verify=self._verify_ssl_certificates,
684
+ verify=not self._insecure,
656
685
  )
657
686
  response.raise_for_status()
658
687
  self._raw_ops.finalize(dataset.id)
@@ -747,8 +776,8 @@ class EvaluationsOperations:
747
776
  ]
748
777
 
749
778
  def label(self, evaluation_id: str, labels: dict[str, Optional[str]]) -> None:
750
- """Label the specified Evaluation with key-value pairs (stored in
751
- the ``.labels`` field of the resource).
779
+ """Label the specified Evaluation with key-value pairs (stored in the
780
+ ``.labels`` field of the resource).
752
781
 
753
782
  Providing ``None`` for the value deletes the label.
754
783
 
@@ -859,8 +888,8 @@ class InferenceservicesOperations:
859
888
  ]
860
889
 
861
890
  def label(self, service_id: str, labels: dict[str, Optional[str]]) -> None:
862
- """Label the specified InferenceService with key-value pairs (stored in
863
- the ``.labels`` field of the resource).
891
+ """Label the specified InferenceService with key-value pairs (stored in the
892
+ ``.labels`` field of the resource).
864
893
 
865
894
  Providing ``None`` for the value deletes the label.
866
895
 
@@ -901,6 +930,8 @@ class InferencesessionsOperations:
901
930
 
902
931
  Do not instantiate this class. Access it through the
903
932
  ``.inferencesessions`` attribute of :class:`~dyff.client.Client`.
933
+
934
+ `verify_ssl_certifcates` is deprecated, use `insecure` instead.
904
935
  """
905
936
 
906
937
  def __init__(
@@ -908,9 +939,18 @@ class InferencesessionsOperations:
908
939
  _raw_ops: InferencesessionsOperationsGenerated,
909
940
  *,
910
941
  verify_ssl_certificates: bool = True,
942
+ insecure: bool = False,
911
943
  ):
912
944
  self._raw_ops = _raw_ops
913
- self._verify_ssl_certificates = verify_ssl_certificates
945
+
946
+ # verify_ssl_certificates deprecated
947
+ # remove after 10/2024
948
+ insecure = _check_deprecated_verify_ssl_certificates(
949
+ verify_ssl_certificates, insecure
950
+ )
951
+
952
+ self._verify_ssl_certificates = not insecure
953
+ self._insecure = insecure
914
954
 
915
955
  def get(self, session_id: str) -> InferenceSession:
916
956
  """Get an InferenceSession by its key.
@@ -985,8 +1025,8 @@ class InferencesessionsOperations:
985
1025
  ]
986
1026
 
987
1027
  def label(self, session_id: str, labels: dict[str, Optional[str]]) -> None:
988
- """Label the specified InferenceSession with key-value pairs (stored in
989
- the ``.labels`` field of the resource).
1028
+ """Label the specified InferenceSession with key-value pairs (stored in the
1029
+ ``.labels`` field of the resource).
990
1030
 
991
1031
  Providing ``None`` for the value deletes the label.
992
1032
 
@@ -1031,8 +1071,8 @@ class InferencesessionsOperations:
1031
1071
  input_adapter: Optional[Adapter] = None,
1032
1072
  output_adapter: Optional[Adapter] = None,
1033
1073
  ) -> InferenceSessionClient:
1034
- """Create an InferenceSessionClient that interacts with the given
1035
- inference session. The token should be one returned either from
1074
+ """Create an InferenceSessionClient that interacts with the given inference
1075
+ session. The token should be one returned either from
1036
1076
  ``Client.inferencesessions.create()`` or from
1037
1077
  ``Client.inferencesessions.token(session_id)``.
1038
1078
 
@@ -1083,7 +1123,7 @@ class InferencesessionsOperations:
1083
1123
  inference_endpoint=endpoint,
1084
1124
  input_adapter=input_adapter,
1085
1125
  output_adapter=output_adapter,
1086
- verify_ssl_certificates=self._verify_ssl_certificates,
1126
+ insecure=self._insecure,
1087
1127
  )
1088
1128
 
1089
1129
  def ready(self, session_id: str) -> bool:
@@ -1171,8 +1211,8 @@ class ModelsOperations:
1171
1211
  labels: Optional[dict[str, str]] = None,
1172
1212
  name: Optional[str] = None,
1173
1213
  ) -> list[Model]:
1174
- """Get all Models matching a query. The query is a set of equality
1175
- constraints specified as key-value pairs.
1214
+ """Get all Models matching a query. The query is a set of equality constraints
1215
+ specified as key-value pairs.
1176
1216
 
1177
1217
  :keyword id:
1178
1218
  :paramtype id: str
@@ -1203,8 +1243,8 @@ class ModelsOperations:
1203
1243
  ]
1204
1244
 
1205
1245
  def label(self, model_id: str, labels: dict[str, Optional[str]]) -> None:
1206
- """Label the specified Model with key-value pairs (stored in
1207
- the ``.labels`` field of the resource).
1246
+ """Label the specified Model with key-value pairs (stored in the ``.labels``
1247
+ field of the resource).
1208
1248
 
1209
1249
  Providing ``None`` for the value deletes the label.
1210
1250
 
@@ -1241,6 +1281,8 @@ class ModulesOperations:
1241
1281
 
1242
1282
  Do not instantiate this class. Access it through the
1243
1283
  ``.modules`` attribute of :class:`~dyff.client.Client`.
1284
+
1285
+ `verify_ssl_certifcates` is deprecated, use `insecure` instead.
1244
1286
  """
1245
1287
 
1246
1288
  def __init__(
@@ -1248,9 +1290,18 @@ class ModulesOperations:
1248
1290
  _raw_ops: ModulesOperationsGenerated,
1249
1291
  *,
1250
1292
  verify_ssl_certificates: bool = True,
1293
+ insecure: bool = False,
1251
1294
  ):
1252
1295
  self._raw_ops = _raw_ops
1253
- self._verify_ssl_certificates = verify_ssl_certificates
1296
+
1297
+ # verify_ssl_certificates deprecated
1298
+ # remove after 10/2024
1299
+ insecure = _check_deprecated_verify_ssl_certificates(
1300
+ verify_ssl_certificates, insecure
1301
+ )
1302
+
1303
+ self._verify_ssl_certificates = not insecure
1304
+ self._insecure = insecure
1254
1305
 
1255
1306
  def get(self, module_id: str) -> Module:
1256
1307
  """Get a Module by its key.
@@ -1281,8 +1332,8 @@ class ModulesOperations:
1281
1332
  labels: Optional[dict[str, str]] = None,
1282
1333
  name: Optional[str] = None,
1283
1334
  ) -> list[Module]:
1284
- """Get all Modules matching a query. The query is a set of equality
1285
- constraints specified as key-value pairs.
1335
+ """Get all Modules matching a query. The query is a set of equality constraints
1336
+ specified as key-value pairs.
1286
1337
 
1287
1338
  :keyword id:
1288
1339
  :paramtype id: str
@@ -1313,8 +1364,8 @@ class ModulesOperations:
1313
1364
  ]
1314
1365
 
1315
1366
  def label(self, module_id: str, labels: dict[str, Optional[str]]) -> None:
1316
- """Label the specified Module with key-value pairs (stored in
1317
- the ``.labels`` field of the resource).
1367
+ """Label the specified Module with key-value pairs (stored in the ``.labels``
1368
+ field of the resource).
1318
1369
 
1319
1370
  Providing ``None`` for the value deletes the label.
1320
1371
 
@@ -1346,8 +1397,7 @@ class ModulesOperations:
1346
1397
  def create_package(
1347
1398
  self, package_directory: str, *, account: str, name: str
1348
1399
  ) -> Module:
1349
- """Create a Module resource describing a package structured as a
1350
- directory tree.
1400
+ """Create a Module resource describing a package structured as a directory tree.
1351
1401
 
1352
1402
  Internally, constructs a ``ModuleCreateRequest`` using information
1353
1403
  obtained from the directory tree, then calls ``create()`` with the
@@ -1396,8 +1446,8 @@ class ModulesOperations:
1396
1446
  return self.create(request)
1397
1447
 
1398
1448
  def upload_package(self, module: Module, package_directory: str) -> None:
1399
- """Uploads the files in a package directory for which a Module resource
1400
- has already been created.
1449
+ """Uploads the files in a package directory for which a Module resource has
1450
+ already been created.
1401
1451
 
1402
1452
  Typical usage::
1403
1453
 
@@ -1427,7 +1477,7 @@ class ModulesOperations:
1427
1477
  put_url.url,
1428
1478
  content=fin,
1429
1479
  headers=headers,
1430
- verify=self._verify_ssl_certificates,
1480
+ verify=not self._insecure,
1431
1481
  )
1432
1482
  response.raise_for_status()
1433
1483
  self._raw_ops.finalize(module.id)
@@ -1478,8 +1528,8 @@ class ReportsOperations:
1478
1528
  inferenceService: Optional[str] = None,
1479
1529
  model: Optional[str] = None,
1480
1530
  ) -> list[Report]:
1481
- """Get all Reports matching a query. The query is a set of equality
1482
- constraints specified as key-value pairs.
1531
+ """Get all Reports matching a query. The query is a set of equality constraints
1532
+ specified as key-value pairs.
1483
1533
 
1484
1534
  :keyword id:
1485
1535
  :paramtype id: str
@@ -1522,8 +1572,8 @@ class ReportsOperations:
1522
1572
  ]
1523
1573
 
1524
1574
  def label(self, report_id: str, labels: dict[str, Optional[str]]) -> None:
1525
- """Label the specified Report with key-value pairs (stored in
1526
- the ``.labels`` field of the resource).
1575
+ """Label the specified Report with key-value pairs (stored in the ``.labels``
1576
+ field of the resource).
1527
1577
 
1528
1578
  Providing ``None`` for the value deletes the label.
1529
1579
 
@@ -1601,6 +1651,7 @@ class Client:
1601
1651
  api_key: str,
1602
1652
  endpoint: Optional[str] = None,
1603
1653
  verify_ssl_certificates: bool = True,
1654
+ insecure: bool = False,
1604
1655
  ):
1605
1656
  """
1606
1657
  :param str api_key: An API token to use for authentication.
@@ -1609,10 +1660,23 @@ class Client:
1609
1660
  :param bool verify_ssl_certificates: You can disable certificate
1610
1661
  verification for testing; you should do this only if you have
1611
1662
  also changed ``endpoint`` to point to a trusted local server.
1663
+
1664
+ .. deprecated:: 0.2.2
1665
+ Use insecure instead
1666
+ :param bool insecure: Disable certificate verification for testing.
1667
+ you should do this only if you have
1668
+ also changed ``endpoint`` to point to a trusted local server.
1612
1669
  """
1670
+ if not verify_ssl_certificates:
1671
+ warn("verify_ssl_certificates is deprecated", DeprecationWarning)
1672
+ # verify_ssl_certificates deprecated
1673
+ # remove after 10/2024
1674
+ insecure = _check_deprecated_verify_ssl_certificates(
1675
+ verify_ssl_certificates, insecure
1676
+ )
1613
1677
 
1614
1678
  if endpoint is None:
1615
- endpoint = "https://apis.alignmentlabs.ai/dyff/v0"
1679
+ endpoint = "https://api.dyff.io/v0"
1616
1680
  credential = _APIKeyCredential(api_key=api_key)
1617
1681
  authentication_policy = BearerTokenCredentialPolicy(credential)
1618
1682
  self._raw = RawClient(
@@ -1642,26 +1706,24 @@ class Client:
1642
1706
  # >> print(self._pipeline._transport.connection_config.verify)
1643
1707
  # True
1644
1708
  self._raw._client._pipeline._transport.connection_config.verify = ( # type: ignore
1645
- verify_ssl_certificates
1709
+ not insecure
1646
1710
  )
1647
1711
 
1648
1712
  self._audits = AuditsOperations(self._raw.audits)
1649
1713
  self._auditprocedures = AuditproceduresOperations(self._raw.auditprocedures)
1650
- self._datasets = DatasetsOperations(
1651
- self._raw.datasets, verify_ssl_certificates=verify_ssl_certificates
1652
- )
1714
+ self._datasets = DatasetsOperations(self._raw.datasets, insecure=insecure)
1653
1715
  self._evaluations = EvaluationsOperations(self._raw.evaluations)
1654
1716
  self._inferenceservices = InferenceservicesOperations(
1655
1717
  self._raw.inferenceservices
1656
1718
  )
1657
1719
  self._inferencesessions = InferencesessionsOperations(
1658
1720
  self._raw.inferencesessions,
1659
- verify_ssl_certificates=verify_ssl_certificates,
1721
+ insecure=insecure,
1660
1722
  )
1661
1723
  self._models = ModelsOperations(self._raw.models)
1662
1724
  self._modules = ModulesOperations(
1663
1725
  self._raw.modules,
1664
- verify_ssl_certificates=verify_ssl_certificates,
1726
+ insecure=insecure,
1665
1727
  )
1666
1728
  self._reports = ReportsOperations(self._raw.reports)
1667
1729
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dyff-client
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Python client for the Dyff AI auditing platform.
5
5
  Author-email: Digital Safety Research Institute <contact@dsri.org>
6
6
  License: Apache-2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes