orca-sdk 0.1.2__py3-none-any.whl → 0.1.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.
orca_sdk/client.py CHANGED
@@ -6,15 +6,31 @@ import json
6
6
  import logging
7
7
  import os
8
8
  import uuid
9
+ from contextlib import contextmanager
10
+ from contextvars import ContextVar
9
11
  from string import Formatter
10
- from typing import Any, Literal, Mapping, NotRequired, TypedDict, cast, overload
12
+ from typing import (
13
+ Any,
14
+ Callable,
15
+ Generator,
16
+ Literal,
17
+ Mapping,
18
+ NotRequired,
19
+ Self,
20
+ TypedDict,
21
+ cast,
22
+ overload,
23
+ )
11
24
 
12
25
  from httpx import (
13
26
  URL,
14
27
  USE_CLIENT_DEFAULT,
28
+ BaseTransport,
15
29
  Client,
16
30
  Headers,
17
31
  HTTPTransport,
32
+ Limits,
33
+ Proxy,
18
34
  Request,
19
35
  Response,
20
36
  Timeout,
@@ -243,6 +259,11 @@ class LabelClassMetrics(TypedDict):
243
259
  memory_count: int
244
260
 
245
261
 
262
+ class LabelPercentage(TypedDict):
263
+ label: int | None
264
+ percentage: float
265
+
266
+
246
267
  class LabeledExample(TypedDict):
247
268
  text: str
248
269
  label_name: str
@@ -335,16 +356,31 @@ class MemorysetClusterMetrics(TypedDict):
335
356
  class MemorysetConceptAnalysisConfig(TypedDict):
336
357
  high_level_description: NotRequired[str | None]
337
358
  max_sample_rows: NotRequired[int]
359
+ min_lookup_count: NotRequired[int]
360
+ max_lookup_count: NotRequired[int]
361
+ overlap_decay_tau: NotRequired[float]
362
+ target_lcc_fraction: NotRequired[float]
363
+ min_cluster_count: NotRequired[int]
364
+ max_cluster_count: NotRequired[int]
338
365
  max_trial_count: NotRequired[int]
339
- min_desired_clusters_per_label: NotRequired[int]
340
- max_desired_clusters_per_label: NotRequired[int]
341
- accuracy_importance: NotRequired[float]
342
- noise_penalty: NotRequired[float]
366
+ resolution: NotRequired[float]
367
+ iterations: NotRequired[int]
368
+ use_generative_naming: NotRequired[bool]
343
369
  naming_examples_count: NotRequired[int]
344
370
  naming_counterexample_count: NotRequired[int]
345
371
  seed: NotRequired[int]
346
372
 
347
373
 
374
+ class MemorysetDistributionAnalysisConfig(TypedDict):
375
+ neighbor_counts: NotRequired[list[int]]
376
+ quantiles: NotRequired[list[float]]
377
+
378
+
379
+ class MemorysetDistributionMetrics(TypedDict):
380
+ lookup_score_metrics: dict[str, LookupScoreMetrics]
381
+ updated_at: str
382
+
383
+
348
384
  class MemorysetDuplicateAnalysisConfig(TypedDict):
349
385
  potential_duplicate_threshold: NotRequired[float]
350
386
 
@@ -370,16 +406,6 @@ class MemorysetLabelMetrics(TypedDict):
370
406
  updated_at: str
371
407
 
372
408
 
373
- class MemorysetNeighborAnalysisConfig(TypedDict):
374
- neighbor_counts: NotRequired[list[int]]
375
- quantiles: NotRequired[list[float]]
376
-
377
-
378
- class MemorysetNeighborMetrics(TypedDict):
379
- lookup_score_metrics: dict[str, LookupScoreMetrics]
380
- updated_at: str
381
-
382
-
383
409
  class MemorysetProjectionAnalysisConfig(TypedDict):
384
410
  min_dist: NotRequired[float]
385
411
  spread: NotRequired[float]
@@ -415,8 +441,8 @@ class NotFoundErrorResponse(TypedDict):
415
441
  "pretrained_embedding_model",
416
442
  "finetuned_embedding_model",
417
443
  "feedback_category",
418
- "embedding_evaluation",
419
444
  "org_plan",
445
+ "worker",
420
446
  ]
421
447
  | None
422
448
  )
@@ -733,6 +759,13 @@ class ValidationError(TypedDict):
733
759
  type: str
734
760
 
735
761
 
762
+ WorkerStatus = Literal["IDLE", "BUSY", "DRAINING", "SHUTDOWN", "CRASHED"]
763
+
764
+
765
+ class GetTestErrorByStatusCodeParams(TypedDict):
766
+ status_code: int | Literal["error", "warning"]
767
+
768
+
736
769
  class DeleteAuthApiKeyByNameOrIdParams(TypedDict):
737
770
  name_or_id: str
738
771
 
@@ -830,6 +863,10 @@ class GetFinetunedEmbeddingModelByNameOrIdEvaluationByTaskIdParams(TypedDict):
830
863
 
831
864
  class GetFinetunedEmbeddingModelByNameOrIdEvaluationsParams(TypedDict):
832
865
  name_or_id: str
866
+ datasource: NotRequired[str | None]
867
+ value_column: NotRequired[str | None]
868
+ label_column: NotRequired[str | None]
869
+ score_column: NotRequired[str | None]
833
870
 
834
871
 
835
872
  class GetPretrainedEmbeddingModelByModelNameParams(TypedDict):
@@ -847,6 +884,10 @@ class GetPretrainedEmbeddingModelByModelNameEvaluationByTaskIdParams(TypedDict):
847
884
 
848
885
  class GetPretrainedEmbeddingModelByModelNameEvaluationsParams(TypedDict):
849
886
  model_name: PretrainedEmbeddingModelName
887
+ datasource: NotRequired[str | None]
888
+ value_column: NotRequired[str | None]
889
+ label_column: NotRequired[str | None]
890
+ score_column: NotRequired[str | None]
850
891
 
851
892
 
852
893
  class PostDatasourceUploadRequest(TypedDict):
@@ -868,20 +909,11 @@ class DeleteDatasourceByNameOrIdParams(TypedDict):
868
909
  name_or_id: str
869
910
 
870
911
 
871
- class PostDatasourceByNameOrIdEmbeddingEvaluationParams(TypedDict):
872
- name_or_id: str
873
-
874
-
875
- class GetDatasourceByNameOrIdEmbeddingEvaluationParams(TypedDict):
876
- name_or_id: str
877
- status: NotRequired[TaskStatus | None]
878
- limit: NotRequired[int | None]
879
- offset: NotRequired[int | None]
880
-
881
-
882
- class GetDatasourceByNameOrIdEmbeddingEvaluationByTaskIdParams(TypedDict):
912
+ class GetDatasourceByNameOrIdEmbeddingModelEvaluationsParams(TypedDict):
883
913
  name_or_id: str
884
- task_id: str
914
+ value_column: NotRequired[str | None]
915
+ label_column: NotRequired[str | None]
916
+ score_column: NotRequired[str | None]
885
917
 
886
918
 
887
919
  class GetDatasourceByNameOrIdDownloadParams(TypedDict):
@@ -976,6 +1008,16 @@ class DeleteTaskByTaskIdAbortParams(TypedDict):
976
1008
  task_id: str
977
1009
 
978
1010
 
1011
+ class GetWorkerParams(TypedDict):
1012
+ status: NotRequired[WorkerStatus | list[WorkerStatus] | None]
1013
+ limit: NotRequired[int | None]
1014
+ offset: NotRequired[int]
1015
+
1016
+
1017
+ class GetWorkerByWorkerIdParams(TypedDict):
1018
+ worker_id: str
1019
+
1020
+
979
1021
  class GetTelemetryPredictionByPredictionIdParams(TypedDict):
980
1022
  prediction_id: str
981
1023
 
@@ -1154,6 +1196,7 @@ class ConceptMetrics(TypedDict):
1154
1196
  primary_label: int | None
1155
1197
  memory_count: int
1156
1198
  subconcepts: list[SubConceptMetrics]
1199
+ label_percentages: list[LabelPercentage]
1157
1200
 
1158
1201
 
1159
1202
  class CreateClassificationModelRequest(TypedDict):
@@ -1187,6 +1230,7 @@ class CreateMemorysetRequest(TypedDict):
1187
1230
  index_params: NotRequired[dict[str, int | float | str]]
1188
1231
  prompt: NotRequired[str]
1189
1232
  hidden: NotRequired[bool]
1233
+ batch_size: NotRequired[int]
1190
1234
 
1191
1235
 
1192
1236
  class CreateRegressionModelRequest(TypedDict):
@@ -1198,25 +1242,6 @@ class CreateRegressionModelRequest(TypedDict):
1198
1242
  head_type: NotRequired[RARHeadType]
1199
1243
 
1200
1244
 
1201
- class DatasourceEmbeddingEvaluationsRequest(TypedDict):
1202
- value_column: str
1203
- label_column: str
1204
- source_id_column: str | None
1205
- neighbor_count: NotRequired[int]
1206
- label_names: NotRequired[list[str] | None]
1207
- embedding_models: NotRequired[list[PretrainedEmbeddingModelName | str] | None]
1208
-
1209
-
1210
- class DatasourceEmbeddingEvaluationsTaskPayload(TypedDict):
1211
- value_column: str
1212
- label_column: str
1213
- source_id_column: str | None
1214
- neighbor_count: NotRequired[int]
1215
- label_names: NotRequired[list[str] | None]
1216
- embedding_models: NotRequired[list[PretrainedEmbeddingModelName | str] | None]
1217
- datasource_id: str
1218
-
1219
-
1220
1245
  class DatasourceMetadata(TypedDict):
1221
1246
  id: str
1222
1247
  org_id: str
@@ -1232,29 +1257,21 @@ class DatasourceMetadata(TypedDict):
1232
1257
  class EmbeddingEvaluationResponse(TypedDict):
1233
1258
  task_id: str
1234
1259
  org_id: str
1260
+ finetuned_embedding_model_id: str | None
1261
+ pretrained_embedding_model_name: PretrainedEmbeddingModelName | None
1262
+ datasource_id: str
1263
+ subsample: int | None
1264
+ datasource_value_column: str
1265
+ datasource_label_column: NotRequired[str | None]
1266
+ datasource_score_column: NotRequired[str | None]
1267
+ neighbor_count: int
1268
+ weigh_memories: bool
1235
1269
  status: TaskStatus
1236
1270
  result: ClassificationMetrics | RegressionMetrics | None
1237
1271
  created_at: str
1238
1272
  updated_at: str
1239
1273
 
1240
1274
 
1241
- class EmbeddingEvaluationResponseUnionClassificationMetricsRegressionMetrics(TypedDict):
1242
- task_id: str
1243
- org_id: str
1244
- status: TaskStatus
1245
- result: ClassificationMetrics | RegressionMetrics | None
1246
- created_at: str
1247
- updated_at: str
1248
-
1249
-
1250
- class EmbeddingModelResult(TypedDict):
1251
- embedding_model_name: str
1252
- embedding_model_path: str
1253
- analysis_result: MemorysetLabelMetrics
1254
- memoryset_name: NotRequired[str | None]
1255
- is_finetuned: NotRequired[bool]
1256
-
1257
-
1258
1275
  class EvaluationResponse(TypedDict):
1259
1276
  task_id: str
1260
1277
  org_id: str
@@ -1429,7 +1446,7 @@ class ListPredictionsRequest(TypedDict):
1429
1446
 
1430
1447
 
1431
1448
  class MemorysetAnalysisConfigs(TypedDict):
1432
- neighbor: NotRequired[MemorysetNeighborAnalysisConfig | None]
1449
+ distribution: NotRequired[MemorysetDistributionAnalysisConfig | None]
1433
1450
  label: NotRequired[MemorysetLabelAnalysisConfig | None]
1434
1451
  duplicate: NotRequired[MemorysetDuplicateAnalysisConfig | None]
1435
1452
  projection: NotRequired[MemorysetProjectionAnalysisConfig | None]
@@ -1452,7 +1469,7 @@ class MemorysetConceptMetrics(TypedDict):
1452
1469
 
1453
1470
 
1454
1471
  class MemorysetMetrics(TypedDict):
1455
- neighbor: NotRequired[MemorysetNeighborMetrics | None]
1472
+ distribution: NotRequired[MemorysetDistributionMetrics | None]
1456
1473
  label: NotRequired[MemorysetLabelMetrics | None]
1457
1474
  duplicate: NotRequired[MemorysetDuplicateMetrics | None]
1458
1475
  projection: NotRequired[MemorysetProjectionMetrics | None]
@@ -1487,10 +1504,12 @@ class Task(TypedDict):
1487
1504
  created_at: str
1488
1505
  id: str
1489
1506
  org_id: str
1507
+ worker_id: str | None
1490
1508
  type: str
1491
1509
  payload: BaseModel
1492
1510
  result: BaseModel | None
1493
- depends_on: NotRequired[list[str]]
1511
+ depends_on: list[str]
1512
+ lease_token: str | None
1494
1513
 
1495
1514
 
1496
1515
  class TelemetryMemoriesRequest(TypedDict):
@@ -1501,6 +1520,16 @@ class TelemetryMemoriesRequest(TypedDict):
1501
1520
  sort: NotRequired[list[TelemetrySortOptions] | None]
1502
1521
 
1503
1522
 
1523
+ class WorkerInfo(TypedDict):
1524
+ id: str
1525
+ status: WorkerStatus
1526
+ started_at: str
1527
+ updated_at: str
1528
+ version: str | None
1529
+ git_sha: str
1530
+ config: dict[str, str | float | int | bool | dict[str, str] | None]
1531
+
1532
+
1504
1533
  PatchGpuMemorysetByNameOrIdMemoryRequest = LabeledMemoryUpdate | ScoredMemoryUpdate
1505
1534
 
1506
1535
 
@@ -1513,10 +1542,6 @@ class CascadingEditSuggestion(TypedDict):
1513
1542
  lookup_score: float
1514
1543
 
1515
1544
 
1516
- class EmbeddingEvaluationResult(TypedDict):
1517
- evaluation_results: list[EmbeddingModelResult]
1518
-
1519
-
1520
1545
  class MemorysetAnalysisResponse(TypedDict):
1521
1546
  task_id: str
1522
1547
  org_id: str
@@ -1564,6 +1589,13 @@ class PaginatedTask(TypedDict):
1564
1589
  limit: int
1565
1590
 
1566
1591
 
1592
+ class PaginatedWorkerInfo(TypedDict):
1593
+ items: list[WorkerInfo]
1594
+ total: int
1595
+ offset: int
1596
+ limit: int
1597
+
1598
+
1567
1599
  class BootstrapClassificationModelMeta(TypedDict):
1568
1600
  datasource_meta: DatasourceMetadata
1569
1601
  memoryset_meta: MemorysetMetadata
@@ -1579,17 +1611,6 @@ class BootstrapClassificationModelResponse(TypedDict):
1579
1611
  input: BootstrapClassificationModelRequest | None
1580
1612
 
1581
1613
 
1582
- class DatasourceEmbeddingEvaluationsResponse(TypedDict):
1583
- task_id: str
1584
- org_id: str
1585
- datasource_id: str
1586
- status: TaskStatus
1587
- result: EmbeddingEvaluationResult | None
1588
- payload: DatasourceEmbeddingEvaluationsTaskPayload
1589
- created_at: str
1590
- updated_at: str
1591
-
1592
-
1593
1614
  class OrcaClient(Client):
1594
1615
  @staticmethod
1595
1616
  def _parse_params(
@@ -1604,11 +1625,11 @@ class OrcaClient(Client):
1604
1625
  return path_params, query_params
1605
1626
 
1606
1627
  @overload
1607
- def DELETE(
1628
+ def GET(
1608
1629
  self,
1609
- path: Literal["/cleanup"],
1630
+ path: Literal["/test_error/{status_code}"],
1610
1631
  *,
1611
- params: None = None,
1632
+ params: GetTestErrorByStatusCodeParams,
1612
1633
  parse_as: Literal["json"] = "json",
1613
1634
  headers: HeaderTypes | None = None,
1614
1635
  cookies: CookieTypes | None = None,
@@ -1616,16 +1637,15 @@ class OrcaClient(Client):
1616
1637
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1617
1638
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1618
1639
  extensions: RequestExtensions | None = None,
1619
- ) -> CleanupResponse:
1620
- """Cleanup orphaned milvus collections and blobs"""
1640
+ ) -> Any:
1621
1641
  pass
1622
1642
 
1623
1643
  @overload
1624
- def DELETE(
1644
+ def GET(
1625
1645
  self,
1626
- path: Literal["/auth/api_key/{name_or_id}"],
1646
+ path: Literal["/check/alive"],
1627
1647
  *,
1628
- params: DeleteAuthApiKeyByNameOrIdParams,
1648
+ params: None = None,
1629
1649
  parse_as: Literal["json"] = "json",
1630
1650
  headers: HeaderTypes | None = None,
1631
1651
  cookies: CookieTypes | None = None,
@@ -1633,14 +1653,13 @@ class OrcaClient(Client):
1633
1653
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1634
1654
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1635
1655
  extensions: RequestExtensions | None = None,
1636
- ) -> None:
1637
- """Delete an API key by name or ID."""
1656
+ ) -> AliveResponse:
1638
1657
  pass
1639
1658
 
1640
1659
  @overload
1641
- def DELETE(
1660
+ def GET(
1642
1661
  self,
1643
- path: Literal["/auth/org"],
1662
+ path: Literal["/check/ready"],
1644
1663
  *,
1645
1664
  params: None = None,
1646
1665
  parse_as: Literal["json"] = "json",
@@ -1650,16 +1669,15 @@ class OrcaClient(Client):
1650
1669
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1651
1670
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1652
1671
  extensions: RequestExtensions | None = None,
1653
- ) -> None:
1654
- """Deletes the org and all associated resources"""
1672
+ ) -> ReadyResponse:
1655
1673
  pass
1656
1674
 
1657
1675
  @overload
1658
- def DELETE(
1676
+ def GET(
1659
1677
  self,
1660
- path: Literal["/memoryset/{name_or_id}"],
1678
+ path: Literal["/gpu/check/healthy"],
1661
1679
  *,
1662
- params: DeleteMemorysetByNameOrIdParams,
1680
+ params: None = None,
1663
1681
  parse_as: Literal["json"] = "json",
1664
1682
  headers: HeaderTypes | None = None,
1665
1683
  cookies: CookieTypes | None = None,
@@ -1667,15 +1685,15 @@ class OrcaClient(Client):
1667
1685
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1668
1686
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1669
1687
  extensions: RequestExtensions | None = None,
1670
- ) -> None:
1688
+ ) -> HealthyResponse:
1671
1689
  pass
1672
1690
 
1673
1691
  @overload
1674
- def DELETE(
1692
+ def GET(
1675
1693
  self,
1676
- path: Literal["/memoryset/{name_or_id}/memory/{memory_id}"],
1694
+ path: Literal["/check/healthy"],
1677
1695
  *,
1678
- params: DeleteMemorysetByNameOrIdMemoryByMemoryIdParams,
1696
+ params: None = None,
1679
1697
  parse_as: Literal["json"] = "json",
1680
1698
  headers: HeaderTypes | None = None,
1681
1699
  cookies: CookieTypes | None = None,
@@ -1683,15 +1701,15 @@ class OrcaClient(Client):
1683
1701
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1684
1702
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1685
1703
  extensions: RequestExtensions | None = None,
1686
- ) -> None:
1704
+ ) -> HealthyResponse:
1687
1705
  pass
1688
1706
 
1689
1707
  @overload
1690
- def DELETE(
1708
+ def GET(
1691
1709
  self,
1692
- path: Literal["/finetuned_embedding_model/{name_or_id}"],
1710
+ path: Literal["/gpu/config"],
1693
1711
  *,
1694
- params: DeleteFinetunedEmbeddingModelByNameOrIdParams,
1712
+ params: None = None,
1695
1713
  parse_as: Literal["json"] = "json",
1696
1714
  headers: HeaderTypes | None = None,
1697
1715
  cookies: CookieTypes | None = None,
@@ -1699,16 +1717,15 @@ class OrcaClient(Client):
1699
1717
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1700
1718
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1701
1719
  extensions: RequestExtensions | None = None,
1702
- ) -> None:
1703
- """Delete a finetuned embedding model by name or ID."""
1720
+ ) -> dict[str, str | float | int | bool | None]:
1704
1721
  pass
1705
1722
 
1706
1723
  @overload
1707
- def DELETE(
1724
+ def GET(
1708
1725
  self,
1709
- path: Literal["/datasource/{name_or_id}"],
1726
+ path: Literal["/config"],
1710
1727
  *,
1711
- params: DeleteDatasourceByNameOrIdParams,
1728
+ params: None = None,
1712
1729
  parse_as: Literal["json"] = "json",
1713
1730
  headers: HeaderTypes | None = None,
1714
1731
  cookies: CookieTypes | None = None,
@@ -1716,16 +1733,15 @@ class OrcaClient(Client):
1716
1733
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1717
1734
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1718
1735
  extensions: RequestExtensions | None = None,
1719
- ) -> None:
1720
- """Delete a datasource by name or ID."""
1736
+ ) -> dict[str, str | float | int | bool | None]:
1721
1737
  pass
1722
1738
 
1723
1739
  @overload
1724
- def DELETE(
1740
+ def GET(
1725
1741
  self,
1726
- path: Literal["/classification_model/{name_or_id}"],
1742
+ path: Literal["/auth/root"],
1727
1743
  *,
1728
- params: DeleteClassificationModelByNameOrIdParams,
1744
+ params: None = None,
1729
1745
  parse_as: Literal["json"] = "json",
1730
1746
  headers: HeaderTypes | None = None,
1731
1747
  cookies: CookieTypes | None = None,
@@ -1733,15 +1749,16 @@ class OrcaClient(Client):
1733
1749
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1734
1750
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1735
1751
  extensions: RequestExtensions | None = None,
1736
- ) -> None:
1752
+ ) -> bool:
1753
+ """Return true only when called with a valid root API key; otherwise 401 Unauthenticated."""
1737
1754
  pass
1738
1755
 
1739
1756
  @overload
1740
- def DELETE(
1757
+ def GET(
1741
1758
  self,
1742
- path: Literal["/classification_model/{model_name_or_id}/evaluation/{task_id}"],
1759
+ path: Literal["/auth/api_key"],
1743
1760
  *,
1744
- params: DeleteClassificationModelByModelNameOrIdEvaluationByTaskIdParams,
1761
+ params: None = None,
1745
1762
  parse_as: Literal["json"] = "json",
1746
1763
  headers: HeaderTypes | None = None,
1747
1764
  cookies: CookieTypes | None = None,
@@ -1749,15 +1766,16 @@ class OrcaClient(Client):
1749
1766
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1750
1767
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1751
1768
  extensions: RequestExtensions | None = None,
1752
- ) -> None:
1769
+ ) -> list[ApiKeyMetadata]:
1770
+ """List all API keys for the organization."""
1753
1771
  pass
1754
1772
 
1755
1773
  @overload
1756
- def DELETE(
1774
+ def GET(
1757
1775
  self,
1758
- path: Literal["/regression_model/{name_or_id}"],
1776
+ path: Literal["/auth"],
1759
1777
  *,
1760
- params: DeleteRegressionModelByNameOrIdParams,
1778
+ params: None = None,
1761
1779
  parse_as: Literal["json"] = "json",
1762
1780
  headers: HeaderTypes | None = None,
1763
1781
  cookies: CookieTypes | None = None,
@@ -1765,15 +1783,16 @@ class OrcaClient(Client):
1765
1783
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1766
1784
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1767
1785
  extensions: RequestExtensions | None = None,
1768
- ) -> None:
1786
+ ) -> bool:
1787
+ """Returns true if the api key header is valid for the org (will be false for admin api key)"""
1769
1788
  pass
1770
1789
 
1771
1790
  @overload
1772
- def DELETE(
1791
+ def GET(
1773
1792
  self,
1774
- path: Literal["/regression_model/{model_name_or_id}/evaluation/{task_id}"],
1793
+ path: Literal["/auth/org/plan"],
1775
1794
  *,
1776
- params: DeleteRegressionModelByModelNameOrIdEvaluationByTaskIdParams,
1795
+ params: None = None,
1777
1796
  parse_as: Literal["json"] = "json",
1778
1797
  headers: HeaderTypes | None = None,
1779
1798
  cookies: CookieTypes | None = None,
@@ -1781,15 +1800,16 @@ class OrcaClient(Client):
1781
1800
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1782
1801
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1783
1802
  extensions: RequestExtensions | None = None,
1784
- ) -> None:
1803
+ ) -> OrgPlan:
1804
+ """Get the organization plan."""
1785
1805
  pass
1786
1806
 
1787
1807
  @overload
1788
- def DELETE(
1808
+ def GET(
1789
1809
  self,
1790
- path: Literal["/task/{task_id}/abort"],
1810
+ path: Literal["/memoryset"],
1791
1811
  *,
1792
- params: DeleteTaskByTaskIdAbortParams,
1812
+ params: GetMemorysetParams,
1793
1813
  parse_as: Literal["json"] = "json",
1794
1814
  headers: HeaderTypes | None = None,
1795
1815
  cookies: CookieTypes | None = None,
@@ -1797,15 +1817,15 @@ class OrcaClient(Client):
1797
1817
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1798
1818
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1799
1819
  extensions: RequestExtensions | None = None,
1800
- ) -> None:
1820
+ ) -> list[MemorysetMetadata]:
1801
1821
  pass
1802
1822
 
1803
1823
  @overload
1804
- def DELETE(
1824
+ def GET(
1805
1825
  self,
1806
- path: Literal["/telemetry/feedback_category/{name_or_id}"],
1826
+ path: Literal["/memoryset/{name_or_id}"],
1807
1827
  *,
1808
- params: DeleteTelemetryFeedbackCategoryByNameOrIdParams,
1828
+ params: GetMemorysetByNameOrIdParams,
1809
1829
  parse_as: Literal["json"] = "json",
1810
1830
  headers: HeaderTypes | None = None,
1811
1831
  cookies: CookieTypes | None = None,
@@ -1813,46 +1833,31 @@ class OrcaClient(Client):
1813
1833
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1814
1834
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1815
1835
  extensions: RequestExtensions | None = None,
1816
- ) -> None:
1817
- """Delete a feedback category and all associated feedback records."""
1836
+ ) -> MemorysetMetadata:
1818
1837
  pass
1819
1838
 
1820
- def DELETE(
1839
+ @overload
1840
+ def GET(
1821
1841
  self,
1822
- path: str,
1842
+ path: Literal["/memoryset/{name_or_id}/memory/{memory_id}"],
1823
1843
  *,
1824
- params: Mapping[str, Any] | None = None,
1825
- parse_as: Literal["json", "text"] | None = "json",
1844
+ params: GetMemorysetByNameOrIdMemoryByMemoryIdParams,
1845
+ parse_as: Literal["json"] = "json",
1826
1846
  headers: HeaderTypes | None = None,
1827
1847
  cookies: CookieTypes | None = None,
1828
1848
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1829
1849
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1830
1850
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1831
1851
  extensions: RequestExtensions | None = None,
1832
- ) -> Any:
1833
- path_params, query_params = self._parse_params(params or {}, path)
1834
- res = self.delete(
1835
- path.format(**path_params),
1836
- params=query_params,
1837
- headers=headers,
1838
- cookies=cookies,
1839
- auth=auth,
1840
- follow_redirects=follow_redirects,
1841
- timeout=timeout,
1842
- extensions=extensions,
1843
- ).raise_for_status()
1844
- return (
1845
- None
1846
- if res.status_code == 204
1847
- else res.json() if parse_as == "json" else res.text if parse_as == "text" else res.content
1848
- )
1852
+ ) -> LabeledMemory | ScoredMemory:
1853
+ pass
1849
1854
 
1850
1855
  @overload
1851
1856
  def GET(
1852
1857
  self,
1853
- path: Literal["/check/alive"],
1858
+ path: Literal["/memoryset/{name_or_id}/potential_duplicate_groups"],
1854
1859
  *,
1855
- params: None = None,
1860
+ params: GetMemorysetByNameOrIdPotentialDuplicateGroupsParams,
1856
1861
  parse_as: Literal["json"] = "json",
1857
1862
  headers: HeaderTypes | None = None,
1858
1863
  cookies: CookieTypes | None = None,
@@ -1860,15 +1865,15 @@ class OrcaClient(Client):
1860
1865
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1861
1866
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1862
1867
  extensions: RequestExtensions | None = None,
1863
- ) -> AliveResponse:
1868
+ ) -> list[list[LabeledMemory]] | list[list[ScoredMemory]]:
1864
1869
  pass
1865
1870
 
1866
1871
  @overload
1867
1872
  def GET(
1868
1873
  self,
1869
- path: Literal["/check/ready"],
1874
+ path: Literal["/memoryset/{name_or_id}/analysis"],
1870
1875
  *,
1871
- params: None = None,
1876
+ params: GetMemorysetByNameOrIdAnalysisParams,
1872
1877
  parse_as: Literal["json"] = "json",
1873
1878
  headers: HeaderTypes | None = None,
1874
1879
  cookies: CookieTypes | None = None,
@@ -1876,15 +1881,15 @@ class OrcaClient(Client):
1876
1881
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1877
1882
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1878
1883
  extensions: RequestExtensions | None = None,
1879
- ) -> ReadyResponse:
1884
+ ) -> list[MemorysetAnalysisResponse]:
1880
1885
  pass
1881
1886
 
1882
1887
  @overload
1883
1888
  def GET(
1884
1889
  self,
1885
- path: Literal["/gpu/check/healthy"],
1890
+ path: Literal["/memoryset/{name_or_id}/analysis/{analysis_task_id}"],
1886
1891
  *,
1887
- params: None = None,
1892
+ params: GetMemorysetByNameOrIdAnalysisByAnalysisTaskIdParams,
1888
1893
  parse_as: Literal["json"] = "json",
1889
1894
  headers: HeaderTypes | None = None,
1890
1895
  cookies: CookieTypes | None = None,
@@ -1892,13 +1897,13 @@ class OrcaClient(Client):
1892
1897
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1893
1898
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1894
1899
  extensions: RequestExtensions | None = None,
1895
- ) -> HealthyResponse:
1900
+ ) -> MemorysetAnalysisResponse:
1896
1901
  pass
1897
1902
 
1898
1903
  @overload
1899
1904
  def GET(
1900
1905
  self,
1901
- path: Literal["/check/healthy"],
1906
+ path: Literal["/finetuned_embedding_model"],
1902
1907
  *,
1903
1908
  params: None = None,
1904
1909
  parse_as: Literal["json"] = "json",
@@ -1908,15 +1913,16 @@ class OrcaClient(Client):
1908
1913
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1909
1914
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1910
1915
  extensions: RequestExtensions | None = None,
1911
- ) -> HealthyResponse:
1916
+ ) -> list[FinetunedEmbeddingModelMetadata]:
1917
+ """List all finetuned embedding models for the organization."""
1912
1918
  pass
1913
1919
 
1914
1920
  @overload
1915
1921
  def GET(
1916
1922
  self,
1917
- path: Literal["/gpu/config"],
1923
+ path: Literal["/finetuned_embedding_model/{name_or_id}"],
1918
1924
  *,
1919
- params: None = None,
1925
+ params: GetFinetunedEmbeddingModelByNameOrIdParams,
1920
1926
  parse_as: Literal["json"] = "json",
1921
1927
  headers: HeaderTypes | None = None,
1922
1928
  cookies: CookieTypes | None = None,
@@ -1924,15 +1930,16 @@ class OrcaClient(Client):
1924
1930
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1925
1931
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1926
1932
  extensions: RequestExtensions | None = None,
1927
- ) -> dict[str, str | float | int | bool | None]:
1933
+ ) -> FinetunedEmbeddingModelMetadata:
1934
+ """Get a finetuned embedding model by name or ID."""
1928
1935
  pass
1929
1936
 
1930
1937
  @overload
1931
1938
  def GET(
1932
1939
  self,
1933
- path: Literal["/config"],
1940
+ path: Literal["/finetuned_embedding_model/{name_or_id}/evaluation/{task_id}"],
1934
1941
  *,
1935
- params: None = None,
1942
+ params: GetFinetunedEmbeddingModelByNameOrIdEvaluationByTaskIdParams,
1936
1943
  parse_as: Literal["json"] = "json",
1937
1944
  headers: HeaderTypes | None = None,
1938
1945
  cookies: CookieTypes | None = None,
@@ -1940,47 +1947,50 @@ class OrcaClient(Client):
1940
1947
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1941
1948
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1942
1949
  extensions: RequestExtensions | None = None,
1943
- ) -> dict[str, str | float | int | bool | None]:
1950
+ ) -> EmbeddingEvaluationResponse:
1951
+ """Get evaluation results for a finetuned embedding model by task ID."""
1944
1952
  pass
1945
1953
 
1946
1954
  @overload
1947
1955
  def GET(
1948
1956
  self,
1949
- path: Literal["/gpu/"],
1957
+ path: Literal["/finetuned_embedding_model/{name_or_id}/evaluations"],
1950
1958
  *,
1951
- params: None = None,
1952
- parse_as: Literal["text"],
1959
+ params: GetFinetunedEmbeddingModelByNameOrIdEvaluationsParams,
1960
+ parse_as: Literal["json"] = "json",
1953
1961
  headers: HeaderTypes | None = None,
1954
1962
  cookies: CookieTypes | None = None,
1955
1963
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1956
1964
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1957
1965
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1958
1966
  extensions: RequestExtensions | None = None,
1959
- ) -> str:
1967
+ ) -> list[EmbeddingEvaluationResponse]:
1968
+ """List all evaluation results for a finetuned embedding model."""
1960
1969
  pass
1961
1970
 
1962
1971
  @overload
1963
1972
  def GET(
1964
1973
  self,
1965
- path: Literal["/"],
1974
+ path: Literal["/pretrained_embedding_model"],
1966
1975
  *,
1967
1976
  params: None = None,
1968
- parse_as: Literal["text"],
1977
+ parse_as: Literal["json"] = "json",
1969
1978
  headers: HeaderTypes | None = None,
1970
1979
  cookies: CookieTypes | None = None,
1971
1980
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1972
1981
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1973
1982
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1974
1983
  extensions: RequestExtensions | None = None,
1975
- ) -> str:
1984
+ ) -> list[PretrainedEmbeddingModelMetadata]:
1985
+ """List all available pretrained embedding models."""
1976
1986
  pass
1977
1987
 
1978
1988
  @overload
1979
1989
  def GET(
1980
1990
  self,
1981
- path: Literal["/auth/root"],
1991
+ path: Literal["/pretrained_embedding_model/{model_name}"],
1982
1992
  *,
1983
- params: None = None,
1993
+ params: GetPretrainedEmbeddingModelByModelNameParams,
1984
1994
  parse_as: Literal["json"] = "json",
1985
1995
  headers: HeaderTypes | None = None,
1986
1996
  cookies: CookieTypes | None = None,
@@ -1988,16 +1998,16 @@ class OrcaClient(Client):
1988
1998
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1989
1999
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1990
2000
  extensions: RequestExtensions | None = None,
1991
- ) -> bool:
1992
- """Return true only when called with a valid root API key; otherwise 401 Unauthenticated."""
2001
+ ) -> PretrainedEmbeddingModelMetadata:
2002
+ """Get metadata for a specific pretrained embedding model."""
1993
2003
  pass
1994
2004
 
1995
2005
  @overload
1996
2006
  def GET(
1997
2007
  self,
1998
- path: Literal["/auth/api_key"],
2008
+ path: Literal["/pretrained_embedding_model/{model_name}/evaluation/{task_id}"],
1999
2009
  *,
2000
- params: None = None,
2010
+ params: GetPretrainedEmbeddingModelByModelNameEvaluationByTaskIdParams,
2001
2011
  parse_as: Literal["json"] = "json",
2002
2012
  headers: HeaderTypes | None = None,
2003
2013
  cookies: CookieTypes | None = None,
@@ -2005,16 +2015,16 @@ class OrcaClient(Client):
2005
2015
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2006
2016
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2007
2017
  extensions: RequestExtensions | None = None,
2008
- ) -> list[ApiKeyMetadata]:
2009
- """List all API keys for the organization."""
2018
+ ) -> EmbeddingEvaluationResponse:
2019
+ """Get evaluation results for a pretrained embedding model by task ID."""
2010
2020
  pass
2011
2021
 
2012
2022
  @overload
2013
2023
  def GET(
2014
2024
  self,
2015
- path: Literal["/auth"],
2025
+ path: Literal["/pretrained_embedding_model/{model_name}/evaluations"],
2016
2026
  *,
2017
- params: None = None,
2027
+ params: GetPretrainedEmbeddingModelByModelNameEvaluationsParams,
2018
2028
  parse_as: Literal["json"] = "json",
2019
2029
  headers: HeaderTypes | None = None,
2020
2030
  cookies: CookieTypes | None = None,
@@ -2022,14 +2032,14 @@ class OrcaClient(Client):
2022
2032
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2023
2033
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2024
2034
  extensions: RequestExtensions | None = None,
2025
- ) -> bool:
2026
- """Returns true if the api key header is valid for the org (will be false for admin api key)"""
2035
+ ) -> list[EmbeddingEvaluationResponse]:
2036
+ """List all evaluation results for a pretrained embedding model."""
2027
2037
  pass
2028
2038
 
2029
2039
  @overload
2030
2040
  def GET(
2031
2041
  self,
2032
- path: Literal["/auth/org/plan"],
2042
+ path: Literal["/datasource"],
2033
2043
  *,
2034
2044
  params: None = None,
2035
2045
  parse_as: Literal["json"] = "json",
@@ -2039,16 +2049,16 @@ class OrcaClient(Client):
2039
2049
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2040
2050
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2041
2051
  extensions: RequestExtensions | None = None,
2042
- ) -> OrgPlan:
2043
- """Get the organization plan."""
2052
+ ) -> list[DatasourceMetadata]:
2053
+ """List all datasources for the organization."""
2044
2054
  pass
2045
2055
 
2046
2056
  @overload
2047
2057
  def GET(
2048
2058
  self,
2049
- path: Literal["/memoryset"],
2059
+ path: Literal["/datasource/{name_or_id}"],
2050
2060
  *,
2051
- params: GetMemorysetParams,
2061
+ params: GetDatasourceByNameOrIdParams,
2052
2062
  parse_as: Literal["json"] = "json",
2053
2063
  headers: HeaderTypes | None = None,
2054
2064
  cookies: CookieTypes | None = None,
@@ -2056,15 +2066,16 @@ class OrcaClient(Client):
2056
2066
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2057
2067
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2058
2068
  extensions: RequestExtensions | None = None,
2059
- ) -> list[MemorysetMetadata]:
2069
+ ) -> DatasourceMetadata:
2070
+ """Get a datasource by name or ID."""
2060
2071
  pass
2061
2072
 
2062
2073
  @overload
2063
2074
  def GET(
2064
2075
  self,
2065
- path: Literal["/memoryset/{name_or_id}"],
2076
+ path: Literal["/datasource/{name_or_id}/embedding_model_evaluations"],
2066
2077
  *,
2067
- params: GetMemorysetByNameOrIdParams,
2078
+ params: GetDatasourceByNameOrIdEmbeddingModelEvaluationsParams,
2068
2079
  parse_as: Literal["json"] = "json",
2069
2080
  headers: HeaderTypes | None = None,
2070
2081
  cookies: CookieTypes | None = None,
@@ -2072,15 +2083,16 @@ class OrcaClient(Client):
2072
2083
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2073
2084
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2074
2085
  extensions: RequestExtensions | None = None,
2075
- ) -> MemorysetMetadata:
2086
+ ) -> list[EmbeddingEvaluationResponse]:
2087
+ """List all evaluation results for a datasource."""
2076
2088
  pass
2077
2089
 
2078
2090
  @overload
2079
2091
  def GET(
2080
2092
  self,
2081
- path: Literal["/memoryset/{name_or_id}/memory/{memory_id}"],
2093
+ path: Literal["/datasource/{name_or_id}/download"],
2082
2094
  *,
2083
- params: GetMemorysetByNameOrIdMemoryByMemoryIdParams,
2095
+ params: GetDatasourceByNameOrIdDownloadParams,
2084
2096
  parse_as: Literal["json"] = "json",
2085
2097
  headers: HeaderTypes | None = None,
2086
2098
  cookies: CookieTypes | None = None,
@@ -2088,47 +2100,50 @@ class OrcaClient(Client):
2088
2100
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2089
2101
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2090
2102
  extensions: RequestExtensions | None = None,
2091
- ) -> LabeledMemory | ScoredMemory:
2103
+ ) -> list[dict[str, Any]]:
2104
+ """Download datasource in the specified format."""
2092
2105
  pass
2093
2106
 
2094
2107
  @overload
2095
2108
  def GET(
2096
2109
  self,
2097
- path: Literal["/memoryset/{name_or_id}/potential_duplicate_groups"],
2110
+ path: Literal["/datasource/{name_or_id}/download"],
2098
2111
  *,
2099
- params: GetMemorysetByNameOrIdPotentialDuplicateGroupsParams,
2100
- parse_as: Literal["json"] = "json",
2112
+ params: GetDatasourceByNameOrIdDownloadParams,
2113
+ parse_as: Literal["text"],
2101
2114
  headers: HeaderTypes | None = None,
2102
2115
  cookies: CookieTypes | None = None,
2103
2116
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2104
2117
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2105
2118
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2106
2119
  extensions: RequestExtensions | None = None,
2107
- ) -> list[list[LabeledMemory]] | list[list[ScoredMemory]]:
2120
+ ) -> str:
2121
+ """Download datasource in the specified format."""
2108
2122
  pass
2109
2123
 
2110
2124
  @overload
2111
2125
  def GET(
2112
2126
  self,
2113
- path: Literal["/memoryset/{name_or_id}/analysis"],
2127
+ path: Literal["/datasource/{name_or_id}/download"],
2114
2128
  *,
2115
- params: GetMemorysetByNameOrIdAnalysisParams,
2116
- parse_as: Literal["json"] = "json",
2129
+ params: GetDatasourceByNameOrIdDownloadParams,
2130
+ parse_as: None,
2117
2131
  headers: HeaderTypes | None = None,
2118
2132
  cookies: CookieTypes | None = None,
2119
2133
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2120
2134
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2121
2135
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2122
2136
  extensions: RequestExtensions | None = None,
2123
- ) -> list[MemorysetAnalysisResponse]:
2137
+ ) -> bytes:
2138
+ """Download datasource in the specified format."""
2124
2139
  pass
2125
2140
 
2126
2141
  @overload
2127
2142
  def GET(
2128
2143
  self,
2129
- path: Literal["/memoryset/{name_or_id}/analysis/{analysis_task_id}"],
2144
+ path: Literal["/predictive_model"],
2130
2145
  *,
2131
- params: GetMemorysetByNameOrIdAnalysisByAnalysisTaskIdParams,
2146
+ params: None = None,
2132
2147
  parse_as: Literal["json"] = "json",
2133
2148
  headers: HeaderTypes | None = None,
2134
2149
  cookies: CookieTypes | None = None,
@@ -2136,13 +2151,13 @@ class OrcaClient(Client):
2136
2151
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2137
2152
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2138
2153
  extensions: RequestExtensions | None = None,
2139
- ) -> MemorysetAnalysisResponse:
2154
+ ) -> list[ClassificationModelMetadata | RegressionModelMetadata]:
2140
2155
  pass
2141
2156
 
2142
2157
  @overload
2143
2158
  def GET(
2144
2159
  self,
2145
- path: Literal["/finetuned_embedding_model"],
2160
+ path: Literal["/classification_model"],
2146
2161
  *,
2147
2162
  params: None = None,
2148
2163
  parse_as: Literal["json"] = "json",
@@ -2152,16 +2167,15 @@ class OrcaClient(Client):
2152
2167
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2153
2168
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2154
2169
  extensions: RequestExtensions | None = None,
2155
- ) -> list[FinetunedEmbeddingModelMetadata]:
2156
- """List all finetuned embedding models for the organization."""
2170
+ ) -> list[ClassificationModelMetadata]:
2157
2171
  pass
2158
2172
 
2159
2173
  @overload
2160
2174
  def GET(
2161
2175
  self,
2162
- path: Literal["/finetuned_embedding_model/{name_or_id}"],
2176
+ path: Literal["/classification_model/{name_or_id}"],
2163
2177
  *,
2164
- params: GetFinetunedEmbeddingModelByNameOrIdParams,
2178
+ params: GetClassificationModelByNameOrIdParams,
2165
2179
  parse_as: Literal["json"] = "json",
2166
2180
  headers: HeaderTypes | None = None,
2167
2181
  cookies: CookieTypes | None = None,
@@ -2169,16 +2183,15 @@ class OrcaClient(Client):
2169
2183
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2170
2184
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2171
2185
  extensions: RequestExtensions | None = None,
2172
- ) -> FinetunedEmbeddingModelMetadata:
2173
- """Get a finetuned embedding model by name or ID."""
2186
+ ) -> ClassificationModelMetadata:
2174
2187
  pass
2175
2188
 
2176
2189
  @overload
2177
2190
  def GET(
2178
2191
  self,
2179
- path: Literal["/finetuned_embedding_model/{name_or_id}/evaluation/{task_id}"],
2192
+ path: Literal["/classification_model/{model_name_or_id}/evaluation"],
2180
2193
  *,
2181
- params: GetFinetunedEmbeddingModelByNameOrIdEvaluationByTaskIdParams,
2194
+ params: GetClassificationModelByModelNameOrIdEvaluationParams,
2182
2195
  parse_as: Literal["json"] = "json",
2183
2196
  headers: HeaderTypes | None = None,
2184
2197
  cookies: CookieTypes | None = None,
@@ -2186,16 +2199,15 @@ class OrcaClient(Client):
2186
2199
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2187
2200
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2188
2201
  extensions: RequestExtensions | None = None,
2189
- ) -> EmbeddingEvaluationResponseUnionClassificationMetricsRegressionMetrics:
2190
- """Get evaluation results for a finetuned embedding model by task ID."""
2202
+ ) -> list[EvaluationResponseClassificationMetrics]:
2191
2203
  pass
2192
2204
 
2193
2205
  @overload
2194
2206
  def GET(
2195
2207
  self,
2196
- path: Literal["/finetuned_embedding_model/{name_or_id}/evaluations"],
2208
+ path: Literal["/classification_model/{model_name_or_id}/evaluation/{task_id}"],
2197
2209
  *,
2198
- params: GetFinetunedEmbeddingModelByNameOrIdEvaluationsParams,
2210
+ params: GetClassificationModelByModelNameOrIdEvaluationByTaskIdParams,
2199
2211
  parse_as: Literal["json"] = "json",
2200
2212
  headers: HeaderTypes | None = None,
2201
2213
  cookies: CookieTypes | None = None,
@@ -2203,14 +2215,13 @@ class OrcaClient(Client):
2203
2215
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2204
2216
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2205
2217
  extensions: RequestExtensions | None = None,
2206
- ) -> list[EmbeddingEvaluationResponseUnionClassificationMetricsRegressionMetrics]:
2207
- """List all evaluation results for a finetuned embedding model."""
2218
+ ) -> EvaluationResponseClassificationMetrics:
2208
2219
  pass
2209
2220
 
2210
2221
  @overload
2211
2222
  def GET(
2212
2223
  self,
2213
- path: Literal["/pretrained_embedding_model"],
2224
+ path: Literal["/regression_model"],
2214
2225
  *,
2215
2226
  params: None = None,
2216
2227
  parse_as: Literal["json"] = "json",
@@ -2220,16 +2231,15 @@ class OrcaClient(Client):
2220
2231
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2221
2232
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2222
2233
  extensions: RequestExtensions | None = None,
2223
- ) -> list[PretrainedEmbeddingModelMetadata]:
2224
- """List all available pretrained embedding models."""
2234
+ ) -> list[RegressionModelMetadata]:
2225
2235
  pass
2226
2236
 
2227
2237
  @overload
2228
2238
  def GET(
2229
2239
  self,
2230
- path: Literal["/pretrained_embedding_model/{model_name}"],
2240
+ path: Literal["/regression_model/{name_or_id}"],
2231
2241
  *,
2232
- params: GetPretrainedEmbeddingModelByModelNameParams,
2242
+ params: GetRegressionModelByNameOrIdParams,
2233
2243
  parse_as: Literal["json"] = "json",
2234
2244
  headers: HeaderTypes | None = None,
2235
2245
  cookies: CookieTypes | None = None,
@@ -2237,16 +2247,15 @@ class OrcaClient(Client):
2237
2247
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2238
2248
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2239
2249
  extensions: RequestExtensions | None = None,
2240
- ) -> PretrainedEmbeddingModelMetadata:
2241
- """Get metadata for a specific pretrained embedding model."""
2250
+ ) -> RegressionModelMetadata:
2242
2251
  pass
2243
2252
 
2244
2253
  @overload
2245
2254
  def GET(
2246
2255
  self,
2247
- path: Literal["/pretrained_embedding_model/{model_name}/evaluation/{task_id}"],
2256
+ path: Literal["/regression_model/{model_name_or_id}/evaluation"],
2248
2257
  *,
2249
- params: GetPretrainedEmbeddingModelByModelNameEvaluationByTaskIdParams,
2258
+ params: GetRegressionModelByModelNameOrIdEvaluationParams,
2250
2259
  parse_as: Literal["json"] = "json",
2251
2260
  headers: HeaderTypes | None = None,
2252
2261
  cookies: CookieTypes | None = None,
@@ -2254,16 +2263,15 @@ class OrcaClient(Client):
2254
2263
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2255
2264
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2256
2265
  extensions: RequestExtensions | None = None,
2257
- ) -> EmbeddingEvaluationResponseUnionClassificationMetricsRegressionMetrics:
2258
- """Get evaluation results for a pretrained embedding model by task ID."""
2266
+ ) -> list[EvaluationResponseRegressionMetrics]:
2259
2267
  pass
2260
2268
 
2261
2269
  @overload
2262
2270
  def GET(
2263
2271
  self,
2264
- path: Literal["/pretrained_embedding_model/{model_name}/evaluations"],
2272
+ path: Literal["/regression_model/{model_name_or_id}/evaluation/{task_id}"],
2265
2273
  *,
2266
- params: GetPretrainedEmbeddingModelByModelNameEvaluationsParams,
2274
+ params: GetRegressionModelByModelNameOrIdEvaluationByTaskIdParams,
2267
2275
  parse_as: Literal["json"] = "json",
2268
2276
  headers: HeaderTypes | None = None,
2269
2277
  cookies: CookieTypes | None = None,
@@ -2271,16 +2279,15 @@ class OrcaClient(Client):
2271
2279
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2272
2280
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2273
2281
  extensions: RequestExtensions | None = None,
2274
- ) -> list[EmbeddingEvaluationResponseUnionClassificationMetricsRegressionMetrics]:
2275
- """List all evaluation results for a pretrained embedding model."""
2282
+ ) -> EvaluationResponseRegressionMetrics:
2276
2283
  pass
2277
2284
 
2278
2285
  @overload
2279
2286
  def GET(
2280
2287
  self,
2281
- path: Literal["/datasource"],
2288
+ path: Literal["/task/{task_id}"],
2282
2289
  *,
2283
- params: None = None,
2290
+ params: GetTaskByTaskIdParams,
2284
2291
  parse_as: Literal["json"] = "json",
2285
2292
  headers: HeaderTypes | None = None,
2286
2293
  cookies: CookieTypes | None = None,
@@ -2288,16 +2295,15 @@ class OrcaClient(Client):
2288
2295
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2289
2296
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2290
2297
  extensions: RequestExtensions | None = None,
2291
- ) -> list[DatasourceMetadata]:
2292
- """List all datasources for the organization."""
2298
+ ) -> Task:
2293
2299
  pass
2294
2300
 
2295
2301
  @overload
2296
2302
  def GET(
2297
2303
  self,
2298
- path: Literal["/datasource/{name_or_id}"],
2304
+ path: Literal["/task/{task_id}/status"],
2299
2305
  *,
2300
- params: GetDatasourceByNameOrIdParams,
2306
+ params: GetTaskByTaskIdStatusParams,
2301
2307
  parse_as: Literal["json"] = "json",
2302
2308
  headers: HeaderTypes | None = None,
2303
2309
  cookies: CookieTypes | None = None,
@@ -2305,16 +2311,15 @@ class OrcaClient(Client):
2305
2311
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2306
2312
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2307
2313
  extensions: RequestExtensions | None = None,
2308
- ) -> DatasourceMetadata:
2309
- """Get a datasource by name or ID."""
2314
+ ) -> TaskStatusInfo:
2310
2315
  pass
2311
2316
 
2312
2317
  @overload
2313
2318
  def GET(
2314
2319
  self,
2315
- path: Literal["/datasource/{name_or_id}/embedding_evaluation"],
2320
+ path: Literal["/task"],
2316
2321
  *,
2317
- params: GetDatasourceByNameOrIdEmbeddingEvaluationParams,
2322
+ params: GetTaskParams,
2318
2323
  parse_as: Literal["json"] = "json",
2319
2324
  headers: HeaderTypes | None = None,
2320
2325
  cookies: CookieTypes | None = None,
@@ -2322,16 +2327,15 @@ class OrcaClient(Client):
2322
2327
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2323
2328
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2324
2329
  extensions: RequestExtensions | None = None,
2325
- ) -> list[DatasourceEmbeddingEvaluationsResponse]:
2326
- """List embedding evaluation tasks for a datasource."""
2330
+ ) -> PaginatedTask:
2327
2331
  pass
2328
2332
 
2329
2333
  @overload
2330
2334
  def GET(
2331
2335
  self,
2332
- path: Literal["/datasource/{name_or_id}/embedding_evaluation/{task_id}"],
2336
+ path: Literal["/worker"],
2333
2337
  *,
2334
- params: GetDatasourceByNameOrIdEmbeddingEvaluationByTaskIdParams,
2338
+ params: GetWorkerParams,
2335
2339
  parse_as: Literal["json"] = "json",
2336
2340
  headers: HeaderTypes | None = None,
2337
2341
  cookies: CookieTypes | None = None,
@@ -2339,16 +2343,20 @@ class OrcaClient(Client):
2339
2343
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2340
2344
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2341
2345
  extensions: RequestExtensions | None = None,
2342
- ) -> DatasourceEmbeddingEvaluationsResponse:
2343
- """Get an embedding evaluation task by ID."""
2346
+ ) -> PaginatedWorkerInfo:
2347
+ """
2348
+ List all workers in the system. Requires root access.
2349
+
2350
+ This endpoint automatically cleans up orphaned workers before returning results.
2351
+ """
2344
2352
  pass
2345
2353
 
2346
2354
  @overload
2347
2355
  def GET(
2348
2356
  self,
2349
- path: Literal["/datasource/{name_or_id}/download"],
2357
+ path: Literal["/worker/{worker_id}"],
2350
2358
  *,
2351
- params: GetDatasourceByNameOrIdDownloadParams,
2359
+ params: GetWorkerByWorkerIdParams,
2352
2360
  parse_as: Literal["json"] = "json",
2353
2361
  headers: HeaderTypes | None = None,
2354
2362
  cookies: CookieTypes | None = None,
@@ -2356,50 +2364,50 @@ class OrcaClient(Client):
2356
2364
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2357
2365
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2358
2366
  extensions: RequestExtensions | None = None,
2359
- ) -> list[dict[str, Any]]:
2360
- """Download datasource in the specified format."""
2367
+ ) -> WorkerInfo:
2368
+ """Get information about a specific worker. Requires root access."""
2361
2369
  pass
2362
2370
 
2363
2371
  @overload
2364
2372
  def GET(
2365
2373
  self,
2366
- path: Literal["/datasource/{name_or_id}/download"],
2374
+ path: Literal["/telemetry/prediction/{prediction_id}"],
2367
2375
  *,
2368
- params: GetDatasourceByNameOrIdDownloadParams,
2369
- parse_as: Literal["text"],
2376
+ params: GetTelemetryPredictionByPredictionIdParams,
2377
+ parse_as: Literal["json"] = "json",
2370
2378
  headers: HeaderTypes | None = None,
2371
2379
  cookies: CookieTypes | None = None,
2372
2380
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2373
2381
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2374
2382
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2375
2383
  extensions: RequestExtensions | None = None,
2376
- ) -> str:
2377
- """Download datasource in the specified format."""
2384
+ ) -> LabelPredictionWithMemoriesAndFeedback | ScorePredictionWithMemoriesAndFeedback:
2385
+ """Get a specific prediction by ID."""
2378
2386
  pass
2379
2387
 
2380
2388
  @overload
2381
2389
  def GET(
2382
2390
  self,
2383
- path: Literal["/datasource/{name_or_id}/download"],
2391
+ path: Literal["/telemetry/prediction/{prediction_id}/explanation"],
2384
2392
  *,
2385
- params: GetDatasourceByNameOrIdDownloadParams,
2386
- parse_as: None,
2393
+ params: GetTelemetryPredictionByPredictionIdExplanationParams,
2394
+ parse_as: Literal["text"],
2387
2395
  headers: HeaderTypes | None = None,
2388
2396
  cookies: CookieTypes | None = None,
2389
2397
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2390
2398
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2391
2399
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2392
2400
  extensions: RequestExtensions | None = None,
2393
- ) -> bytes:
2394
- """Download datasource in the specified format."""
2401
+ ) -> str:
2402
+ """Get explanation for a prediction, optionally streaming the response."""
2395
2403
  pass
2396
2404
 
2397
2405
  @overload
2398
2406
  def GET(
2399
2407
  self,
2400
- path: Literal["/predictive_model"],
2408
+ path: Literal["/telemetry/prediction/{prediction_id}/action"],
2401
2409
  *,
2402
- params: None = None,
2410
+ params: GetTelemetryPredictionByPredictionIdActionParams,
2403
2411
  parse_as: Literal["json"] = "json",
2404
2412
  headers: HeaderTypes | None = None,
2405
2413
  cookies: CookieTypes | None = None,
@@ -2407,15 +2415,16 @@ class OrcaClient(Client):
2407
2415
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2408
2416
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2409
2417
  extensions: RequestExtensions | None = None,
2410
- ) -> list[ClassificationModelMetadata | RegressionModelMetadata]:
2418
+ ) -> ActionRecommendation:
2419
+ """Get action recommendation for improving a specific prediction."""
2411
2420
  pass
2412
2421
 
2413
2422
  @overload
2414
2423
  def GET(
2415
2424
  self,
2416
- path: Literal["/classification_model"],
2425
+ path: Literal["/telemetry/prediction/{prediction_id}/memory_suggestions"],
2417
2426
  *,
2418
- params: None = None,
2427
+ params: GetTelemetryPredictionByPredictionIdMemorySuggestionsParams,
2419
2428
  parse_as: Literal["json"] = "json",
2420
2429
  headers: HeaderTypes | None = None,
2421
2430
  cookies: CookieTypes | None = None,
@@ -2423,15 +2432,21 @@ class OrcaClient(Client):
2423
2432
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2424
2433
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2425
2434
  extensions: RequestExtensions | None = None,
2426
- ) -> list[ClassificationModelMetadata]:
2435
+ ) -> AddMemoryRecommendations:
2436
+ """
2437
+ Generate synthetic memory suggestions to improve a specific prediction.
2438
+
2439
+ The returned suggestions have labels as string representations of integer indices
2440
+ corresponding to the memoryset's label_names.
2441
+ """
2427
2442
  pass
2428
2443
 
2429
2444
  @overload
2430
2445
  def GET(
2431
2446
  self,
2432
- path: Literal["/classification_model/{name_or_id}"],
2447
+ path: Literal["/telemetry/feedback_category"],
2433
2448
  *,
2434
- params: GetClassificationModelByNameOrIdParams,
2449
+ params: None = None,
2435
2450
  parse_as: Literal["json"] = "json",
2436
2451
  headers: HeaderTypes | None = None,
2437
2452
  cookies: CookieTypes | None = None,
@@ -2439,15 +2454,16 @@ class OrcaClient(Client):
2439
2454
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2440
2455
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2441
2456
  extensions: RequestExtensions | None = None,
2442
- ) -> ClassificationModelMetadata:
2457
+ ) -> list[PredictionFeedbackCategory]:
2458
+ """List all feedback categories for the organization."""
2443
2459
  pass
2444
2460
 
2445
2461
  @overload
2446
2462
  def GET(
2447
2463
  self,
2448
- path: Literal["/classification_model/{model_name_or_id}/evaluation"],
2464
+ path: Literal["/telemetry/feedback_category/{name_or_id}"],
2449
2465
  *,
2450
- params: GetClassificationModelByModelNameOrIdEvaluationParams,
2466
+ params: GetTelemetryFeedbackCategoryByNameOrIdParams,
2451
2467
  parse_as: Literal["json"] = "json",
2452
2468
  headers: HeaderTypes | None = None,
2453
2469
  cookies: CookieTypes | None = None,
@@ -2455,15 +2471,16 @@ class OrcaClient(Client):
2455
2471
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2456
2472
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2457
2473
  extensions: RequestExtensions | None = None,
2458
- ) -> list[EvaluationResponseClassificationMetrics]:
2474
+ ) -> PredictionFeedbackCategory:
2475
+ """Get a feedback category by name or ID."""
2459
2476
  pass
2460
2477
 
2461
2478
  @overload
2462
2479
  def GET(
2463
2480
  self,
2464
- path: Literal["/classification_model/{model_name_or_id}/evaluation/{task_id}"],
2481
+ path: Literal["/agents/bootstrap_classification_model/{task_id}"],
2465
2482
  *,
2466
- params: GetClassificationModelByModelNameOrIdEvaluationByTaskIdParams,
2483
+ params: GetAgentsBootstrapClassificationModelByTaskIdParams,
2467
2484
  parse_as: Literal["json"] = "json",
2468
2485
  headers: HeaderTypes | None = None,
2469
2486
  cookies: CookieTypes | None = None,
@@ -2471,31 +2488,47 @@ class OrcaClient(Client):
2471
2488
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2472
2489
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2473
2490
  extensions: RequestExtensions | None = None,
2474
- ) -> EvaluationResponseClassificationMetrics:
2491
+ ) -> BootstrapClassificationModelResponse:
2492
+ """Get the status of a bootstrap classification model task"""
2475
2493
  pass
2476
2494
 
2477
- @overload
2478
2495
  def GET(
2479
2496
  self,
2480
- path: Literal["/regression_model"],
2497
+ path: str,
2481
2498
  *,
2482
- params: None = None,
2483
- parse_as: Literal["json"] = "json",
2499
+ params: Mapping[str, Any] | None = None,
2500
+ parse_as: Literal["json", "text"] | None = "json",
2484
2501
  headers: HeaderTypes | None = None,
2485
2502
  cookies: CookieTypes | None = None,
2486
2503
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2487
2504
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2488
2505
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2489
2506
  extensions: RequestExtensions | None = None,
2490
- ) -> list[RegressionModelMetadata]:
2491
- pass
2507
+ ) -> Any:
2508
+ path_params, query_params = self._parse_params(params or {}, path)
2509
+ res = self.get(
2510
+ path.format(**path_params),
2511
+ params=query_params,
2512
+ headers=headers,
2513
+ cookies=cookies,
2514
+ auth=auth,
2515
+ follow_redirects=follow_redirects,
2516
+ timeout=timeout,
2517
+ extensions=extensions,
2518
+ )
2519
+ res.raise_for_status()
2520
+ return (
2521
+ None
2522
+ if res.status_code == 204
2523
+ else res.json() if parse_as == "json" else res.text if parse_as == "text" else res.content
2524
+ )
2492
2525
 
2493
2526
  @overload
2494
- def GET(
2527
+ def DELETE(
2495
2528
  self,
2496
- path: Literal["/regression_model/{name_or_id}"],
2529
+ path: Literal["/cleanup"],
2497
2530
  *,
2498
- params: GetRegressionModelByNameOrIdParams,
2531
+ params: None = None,
2499
2532
  parse_as: Literal["json"] = "json",
2500
2533
  headers: HeaderTypes | None = None,
2501
2534
  cookies: CookieTypes | None = None,
@@ -2503,15 +2536,16 @@ class OrcaClient(Client):
2503
2536
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2504
2537
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2505
2538
  extensions: RequestExtensions | None = None,
2506
- ) -> RegressionModelMetadata:
2539
+ ) -> CleanupResponse:
2540
+ """Cleanup orphaned milvus collections and blobs"""
2507
2541
  pass
2508
2542
 
2509
2543
  @overload
2510
- def GET(
2544
+ def DELETE(
2511
2545
  self,
2512
- path: Literal["/regression_model/{model_name_or_id}/evaluation"],
2546
+ path: Literal["/auth/api_key/{name_or_id}"],
2513
2547
  *,
2514
- params: GetRegressionModelByModelNameOrIdEvaluationParams,
2548
+ params: DeleteAuthApiKeyByNameOrIdParams,
2515
2549
  parse_as: Literal["json"] = "json",
2516
2550
  headers: HeaderTypes | None = None,
2517
2551
  cookies: CookieTypes | None = None,
@@ -2519,15 +2553,16 @@ class OrcaClient(Client):
2519
2553
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2520
2554
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2521
2555
  extensions: RequestExtensions | None = None,
2522
- ) -> list[EvaluationResponseRegressionMetrics]:
2556
+ ) -> None:
2557
+ """Delete an API key by name or ID."""
2523
2558
  pass
2524
2559
 
2525
2560
  @overload
2526
- def GET(
2561
+ def DELETE(
2527
2562
  self,
2528
- path: Literal["/regression_model/{model_name_or_id}/evaluation/{task_id}"],
2563
+ path: Literal["/auth/org"],
2529
2564
  *,
2530
- params: GetRegressionModelByModelNameOrIdEvaluationByTaskIdParams,
2565
+ params: None = None,
2531
2566
  parse_as: Literal["json"] = "json",
2532
2567
  headers: HeaderTypes | None = None,
2533
2568
  cookies: CookieTypes | None = None,
@@ -2535,15 +2570,16 @@ class OrcaClient(Client):
2535
2570
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2536
2571
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2537
2572
  extensions: RequestExtensions | None = None,
2538
- ) -> EvaluationResponseRegressionMetrics:
2573
+ ) -> None:
2574
+ """Deletes the org and all associated resources"""
2539
2575
  pass
2540
2576
 
2541
2577
  @overload
2542
- def GET(
2578
+ def DELETE(
2543
2579
  self,
2544
- path: Literal["/task/{task_id}"],
2580
+ path: Literal["/memoryset/{name_or_id}"],
2545
2581
  *,
2546
- params: GetTaskByTaskIdParams,
2582
+ params: DeleteMemorysetByNameOrIdParams,
2547
2583
  parse_as: Literal["json"] = "json",
2548
2584
  headers: HeaderTypes | None = None,
2549
2585
  cookies: CookieTypes | None = None,
@@ -2551,15 +2587,15 @@ class OrcaClient(Client):
2551
2587
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2552
2588
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2553
2589
  extensions: RequestExtensions | None = None,
2554
- ) -> Task:
2590
+ ) -> None:
2555
2591
  pass
2556
2592
 
2557
2593
  @overload
2558
- def GET(
2594
+ def DELETE(
2559
2595
  self,
2560
- path: Literal["/task/{task_id}/status"],
2596
+ path: Literal["/memoryset/{name_or_id}/memory/{memory_id}"],
2561
2597
  *,
2562
- params: GetTaskByTaskIdStatusParams,
2598
+ params: DeleteMemorysetByNameOrIdMemoryByMemoryIdParams,
2563
2599
  parse_as: Literal["json"] = "json",
2564
2600
  headers: HeaderTypes | None = None,
2565
2601
  cookies: CookieTypes | None = None,
@@ -2567,15 +2603,15 @@ class OrcaClient(Client):
2567
2603
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2568
2604
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2569
2605
  extensions: RequestExtensions | None = None,
2570
- ) -> TaskStatusInfo:
2606
+ ) -> None:
2571
2607
  pass
2572
2608
 
2573
2609
  @overload
2574
- def GET(
2610
+ def DELETE(
2575
2611
  self,
2576
- path: Literal["/task"],
2612
+ path: Literal["/finetuned_embedding_model/{name_or_id}"],
2577
2613
  *,
2578
- params: GetTaskParams,
2614
+ params: DeleteFinetunedEmbeddingModelByNameOrIdParams,
2579
2615
  parse_as: Literal["json"] = "json",
2580
2616
  headers: HeaderTypes | None = None,
2581
2617
  cookies: CookieTypes | None = None,
@@ -2583,15 +2619,16 @@ class OrcaClient(Client):
2583
2619
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2584
2620
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2585
2621
  extensions: RequestExtensions | None = None,
2586
- ) -> PaginatedTask:
2622
+ ) -> None:
2623
+ """Delete a finetuned embedding model by name or ID."""
2587
2624
  pass
2588
2625
 
2589
2626
  @overload
2590
- def GET(
2627
+ def DELETE(
2591
2628
  self,
2592
- path: Literal["/telemetry/prediction/{prediction_id}"],
2629
+ path: Literal["/datasource/{name_or_id}"],
2593
2630
  *,
2594
- params: GetTelemetryPredictionByPredictionIdParams,
2631
+ params: DeleteDatasourceByNameOrIdParams,
2595
2632
  parse_as: Literal["json"] = "json",
2596
2633
  headers: HeaderTypes | None = None,
2597
2634
  cookies: CookieTypes | None = None,
@@ -2599,33 +2636,32 @@ class OrcaClient(Client):
2599
2636
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2600
2637
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2601
2638
  extensions: RequestExtensions | None = None,
2602
- ) -> LabelPredictionWithMemoriesAndFeedback | ScorePredictionWithMemoriesAndFeedback:
2603
- """Get a specific prediction by ID."""
2639
+ ) -> None:
2640
+ """Delete a datasource by name or ID."""
2604
2641
  pass
2605
2642
 
2606
2643
  @overload
2607
- def GET(
2644
+ def DELETE(
2608
2645
  self,
2609
- path: Literal["/telemetry/prediction/{prediction_id}/explanation"],
2646
+ path: Literal["/classification_model/{name_or_id}"],
2610
2647
  *,
2611
- params: GetTelemetryPredictionByPredictionIdExplanationParams,
2612
- parse_as: Literal["text"],
2648
+ params: DeleteClassificationModelByNameOrIdParams,
2649
+ parse_as: Literal["json"] = "json",
2613
2650
  headers: HeaderTypes | None = None,
2614
2651
  cookies: CookieTypes | None = None,
2615
2652
  auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2616
2653
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2617
2654
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2618
2655
  extensions: RequestExtensions | None = None,
2619
- ) -> str:
2620
- """Get explanation for a prediction, optionally streaming the response."""
2656
+ ) -> None:
2621
2657
  pass
2622
2658
 
2623
2659
  @overload
2624
- def GET(
2660
+ def DELETE(
2625
2661
  self,
2626
- path: Literal["/telemetry/prediction/{prediction_id}/action"],
2662
+ path: Literal["/classification_model/{model_name_or_id}/evaluation/{task_id}"],
2627
2663
  *,
2628
- params: GetTelemetryPredictionByPredictionIdActionParams,
2664
+ params: DeleteClassificationModelByModelNameOrIdEvaluationByTaskIdParams,
2629
2665
  parse_as: Literal["json"] = "json",
2630
2666
  headers: HeaderTypes | None = None,
2631
2667
  cookies: CookieTypes | None = None,
@@ -2633,16 +2669,15 @@ class OrcaClient(Client):
2633
2669
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2634
2670
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2635
2671
  extensions: RequestExtensions | None = None,
2636
- ) -> ActionRecommendation:
2637
- """Get action recommendation for improving a specific prediction."""
2672
+ ) -> None:
2638
2673
  pass
2639
2674
 
2640
2675
  @overload
2641
- def GET(
2676
+ def DELETE(
2642
2677
  self,
2643
- path: Literal["/telemetry/prediction/{prediction_id}/memory_suggestions"],
2678
+ path: Literal["/regression_model/{name_or_id}"],
2644
2679
  *,
2645
- params: GetTelemetryPredictionByPredictionIdMemorySuggestionsParams,
2680
+ params: DeleteRegressionModelByNameOrIdParams,
2646
2681
  parse_as: Literal["json"] = "json",
2647
2682
  headers: HeaderTypes | None = None,
2648
2683
  cookies: CookieTypes | None = None,
@@ -2650,21 +2685,15 @@ class OrcaClient(Client):
2650
2685
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2651
2686
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2652
2687
  extensions: RequestExtensions | None = None,
2653
- ) -> AddMemoryRecommendations:
2654
- """
2655
- Generate synthetic memory suggestions to improve a specific prediction.
2656
-
2657
- The returned suggestions have labels as string representations of integer indices
2658
- corresponding to the memoryset's label_names.
2659
- """
2688
+ ) -> None:
2660
2689
  pass
2661
2690
 
2662
2691
  @overload
2663
- def GET(
2692
+ def DELETE(
2664
2693
  self,
2665
- path: Literal["/telemetry/feedback_category"],
2694
+ path: Literal["/regression_model/{model_name_or_id}/evaluation/{task_id}"],
2666
2695
  *,
2667
- params: None = None,
2696
+ params: DeleteRegressionModelByModelNameOrIdEvaluationByTaskIdParams,
2668
2697
  parse_as: Literal["json"] = "json",
2669
2698
  headers: HeaderTypes | None = None,
2670
2699
  cookies: CookieTypes | None = None,
@@ -2672,16 +2701,15 @@ class OrcaClient(Client):
2672
2701
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2673
2702
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2674
2703
  extensions: RequestExtensions | None = None,
2675
- ) -> list[PredictionFeedbackCategory]:
2676
- """List all feedback categories for the organization."""
2704
+ ) -> None:
2677
2705
  pass
2678
2706
 
2679
2707
  @overload
2680
- def GET(
2708
+ def DELETE(
2681
2709
  self,
2682
- path: Literal["/telemetry/feedback_category/{name_or_id}"],
2710
+ path: Literal["/task/{task_id}/abort"],
2683
2711
  *,
2684
- params: GetTelemetryFeedbackCategoryByNameOrIdParams,
2712
+ params: DeleteTaskByTaskIdAbortParams,
2685
2713
  parse_as: Literal["json"] = "json",
2686
2714
  headers: HeaderTypes | None = None,
2687
2715
  cookies: CookieTypes | None = None,
@@ -2689,16 +2717,15 @@ class OrcaClient(Client):
2689
2717
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2690
2718
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2691
2719
  extensions: RequestExtensions | None = None,
2692
- ) -> PredictionFeedbackCategory:
2693
- """Get a feedback category by name or ID."""
2720
+ ) -> None:
2694
2721
  pass
2695
2722
 
2696
2723
  @overload
2697
- def GET(
2724
+ def DELETE(
2698
2725
  self,
2699
- path: Literal["/agents/bootstrap_classification_model/{task_id}"],
2726
+ path: Literal["/telemetry/feedback_category/{name_or_id}"],
2700
2727
  *,
2701
- params: GetAgentsBootstrapClassificationModelByTaskIdParams,
2728
+ params: DeleteTelemetryFeedbackCategoryByNameOrIdParams,
2702
2729
  parse_as: Literal["json"] = "json",
2703
2730
  headers: HeaderTypes | None = None,
2704
2731
  cookies: CookieTypes | None = None,
@@ -2706,11 +2733,11 @@ class OrcaClient(Client):
2706
2733
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2707
2734
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2708
2735
  extensions: RequestExtensions | None = None,
2709
- ) -> BootstrapClassificationModelResponse:
2710
- """Get the status of a bootstrap classification model task"""
2736
+ ) -> None:
2737
+ """Delete a feedback category and all associated feedback records."""
2711
2738
  pass
2712
2739
 
2713
- def GET(
2740
+ def DELETE(
2714
2741
  self,
2715
2742
  path: str,
2716
2743
  *,
@@ -2724,7 +2751,7 @@ class OrcaClient(Client):
2724
2751
  extensions: RequestExtensions | None = None,
2725
2752
  ) -> Any:
2726
2753
  path_params, query_params = self._parse_params(params or {}, path)
2727
- res = self.get(
2754
+ res = self.delete(
2728
2755
  path.format(**path_params),
2729
2756
  params=query_params,
2730
2757
  headers=headers,
@@ -2733,7 +2760,8 @@ class OrcaClient(Client):
2733
2760
  follow_redirects=follow_redirects,
2734
2761
  timeout=timeout,
2735
2762
  extensions=extensions,
2736
- ).raise_for_status()
2763
+ )
2764
+ res.raise_for_status()
2737
2765
  return (
2738
2766
  None
2739
2767
  if res.status_code == 204
@@ -3059,27 +3087,6 @@ class OrcaClient(Client):
3059
3087
  """
3060
3088
  pass
3061
3089
 
3062
- @overload
3063
- def POST(
3064
- self,
3065
- path: Literal["/datasource/{name_or_id}/embedding_evaluation"],
3066
- *,
3067
- params: PostDatasourceByNameOrIdEmbeddingEvaluationParams,
3068
- json: DatasourceEmbeddingEvaluationsRequest,
3069
- data: None = None,
3070
- files: None = None,
3071
- content: None = None,
3072
- parse_as: Literal["json"] = "json",
3073
- headers: HeaderTypes | None = None,
3074
- cookies: CookieTypes | None = None,
3075
- auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
3076
- follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
3077
- timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
3078
- extensions: RequestExtensions | None = None,
3079
- ) -> DatasourceEmbeddingEvaluationsResponse:
3080
- """Create an embedding evaluation task for a datasource."""
3081
- pass
3082
-
3083
3090
  @overload
3084
3091
  def POST(
3085
3092
  self,
@@ -3414,7 +3421,8 @@ class OrcaClient(Client):
3414
3421
  follow_redirects=follow_redirects,
3415
3422
  timeout=timeout,
3416
3423
  extensions=extensions,
3417
- ).raise_for_status()
3424
+ )
3425
+ res.raise_for_status()
3418
3426
  return (
3419
3427
  None
3420
3428
  if res.status_code == 204
@@ -3494,7 +3502,8 @@ class OrcaClient(Client):
3494
3502
  follow_redirects=follow_redirects,
3495
3503
  timeout=timeout,
3496
3504
  extensions=extensions,
3497
- ).raise_for_status()
3505
+ )
3506
+ res.raise_for_status()
3498
3507
  return (
3499
3508
  None
3500
3509
  if res.status_code == 204
@@ -3653,95 +3662,126 @@ class OrcaClient(Client):
3653
3662
  follow_redirects=follow_redirects,
3654
3663
  timeout=timeout,
3655
3664
  extensions=extensions,
3656
- ).raise_for_status()
3665
+ )
3666
+ res.raise_for_status()
3657
3667
  return (
3658
3668
  None
3659
3669
  if res.status_code == 204
3660
3670
  else res.json() if parse_as == "json" else res.text if parse_as == "text" else res.content
3661
3671
  )
3662
3672
 
3663
- @property
3664
- def base_url(self) -> URL:
3665
- # lazy init base_url from environment variable
3666
- if str(self._base_url) == "":
3667
- self.base_url = os.environ.get("ORCA_API_URL", "https://api.orcadb.ai/")
3668
- return self._base_url
3673
+ @staticmethod
3674
+ def _raise_error_for_response(response: Response) -> None:
3675
+ if response.status_code == 401:
3676
+ raise ValueError("Invalid API key")
3677
+ # elif response.status_code == 402:
3678
+ # res = cast(QuotaExceededErrorResponse, json.loads(response.read().decode(response.encoding or "utf-8")))
3679
+ # raise RuntimeError(
3680
+ # f"{res['quota_type'].replace('_', ' ').title()} limit reached ({res['current']}/{res['quota_limit']})"
3681
+ # )
3682
+ elif response.status_code == 403:
3683
+ raise PermissionError(json.loads(response.read().decode(response.encoding or "utf-8"))["reason"])
3684
+ elif response.status_code == 404:
3685
+ res = cast(NotFoundErrorResponse, json.loads(response.read().decode(response.encoding or "utf-8")))
3686
+ if res["resource"] is not None:
3687
+ raise LookupError(f"The {res['resource']} you are looking for does not exist")
3688
+ else:
3689
+ raise RuntimeError(f"Unknown API route: {response.url}")
3690
+ elif response.status_code == 405:
3691
+ raise RuntimeError(f"Unknown method {response.request.method} for API route: {response.url}")
3692
+ elif response.status_code == 409:
3693
+ res = cast(
3694
+ ConstraintViolationErrorResponse, json.loads(response.read().decode(response.encoding or "utf-8"))
3695
+ )
3696
+ raise RuntimeError(res["constraint"])
3697
+ elif response.status_code == 422:
3698
+ res = cast(InvalidInputErrorResponse, json.loads(response.read().decode(response.encoding or "utf-8")))
3699
+ issues = [f"{issue['loc'][-1]}: {issue['msg']}" for issue in res["validation_issues"]]
3700
+ raise ValueError("Invalid input:\n\t" + "\n\t".join(issues))
3701
+ elif response.status_code == 500:
3702
+ res = cast(InternalServerErrorResponse, json.loads(response.read().decode(response.encoding or "utf-8")))
3703
+ raise RuntimeError(f"Unexpected server error: {res['message']}")
3704
+ elif response.status_code == 503:
3705
+ raise RuntimeError("Orca API is currently unavailable, please try again later")
3706
+ elif response.status_code >= 400:
3707
+ raise RuntimeError(f"Unexpected status code: {response.status_code}")
3708
+
3709
+ @staticmethod
3710
+ def _instrument_request(request: Request) -> None:
3711
+ request.headers["X-Request-ID"] = str(uuid.uuid4())
3712
+
3713
+ def __init__(
3714
+ self,
3715
+ *,
3716
+ api_key: str | None = None,
3717
+ base_url: URL | str = "",
3718
+ headers: HeaderTypes | None = None,
3719
+ transport: BaseTransport | None = None,
3720
+ timeout: TimeoutTypes | None = None,
3721
+ limits: Limits | None = None,
3722
+ max_redirects: int = 20,
3723
+ event_hooks: None | (Mapping[str, list[Callable[..., Any]]]) = None,
3724
+ http1: bool = True,
3725
+ http2: bool = False,
3726
+ proxy: str | URL | Proxy | None = None,
3727
+ log_level: int = logging.WARNING,
3728
+ ) -> None:
3729
+ """
3730
+ Initialize an OrcaAPI httpx client
3669
3731
 
3670
- @base_url.setter
3671
- def base_url(self, url: URL | str) -> None:
3672
- Client.base_url.__set__(self, url)
3732
+ Params:
3733
+ api_key: API key to use for authentication, will default to ORCA_API_KEY if not set.
3734
+ base_url: URL of the OrcaAPI, will default to ORCA_API_URL or the cloud API URL if not set.
3735
+ """
3736
+ logging.getLogger("httpx").setLevel(log_level)
3737
+ logging.getLogger("httpcore").setLevel(log_level)
3738
+ super().__init__(
3739
+ headers={"Api-Key": api_key or os.environ.get("ORCA_API_KEY", "")} | dict(Headers(headers or {}).items()),
3740
+ http1=http1,
3741
+ http2=http2,
3742
+ proxy=proxy,
3743
+ timeout=timeout or Timeout(connect=3, read=20, write=10, pool=5),
3744
+ follow_redirects=True,
3745
+ limits=limits or Limits(max_connections=100, max_keepalive_connections=20),
3746
+ max_redirects=max_redirects,
3747
+ event_hooks=event_hooks
3748
+ or {"request": [self._instrument_request], "response": [self._raise_error_for_response]},
3749
+ base_url=base_url or os.environ.get("ORCA_API_URL", "https://api.orcadb.ai/"),
3750
+ transport=transport
3751
+ or RetryTransport(
3752
+ transport=HTTPTransport(),
3753
+ retry=Retry(
3754
+ total=5,
3755
+ backoff_factor=0.5,
3756
+ allowed_methods=["GET", "POST", "PUT", "PATCH", "DELETE"],
3757
+ status_forcelist=[429, 500, 502, 503, 504],
3758
+ ),
3759
+ ),
3760
+ )
3673
3761
 
3674
3762
  @property
3675
- def headers(self) -> Headers:
3676
- # lazy init headers from environment variable
3677
- if not self._headers.get("Api-Key"):
3678
- Client.headers.__set__(self, Headers({"Api-Key": os.environ.get("ORCA_API_KEY", "")}))
3679
- return self._headers
3680
-
3681
- @headers.setter
3682
- def headers(self, headers: HeaderTypes) -> None:
3683
- Client.headers.__set__(self, headers)
3684
-
3685
-
3686
- def _read_json_response(response: Response) -> dict[str, Any]:
3687
- content = response.read()
3688
- text = content.decode(response.encoding or "utf-8")
3689
- return json.loads(text)
3690
-
3691
-
3692
- def _raise_error_for_response(response: Response) -> None:
3693
- if response.status_code == 401:
3694
- raise ValueError("Invalid API key")
3695
- # elif response.status_code == 402:
3696
- # res = cast(QuotaExceededErrorResponse, _read_json_response(response))
3697
- # raise RuntimeError(
3698
- # f"{res['quota_type'].replace('_', ' ').title()} limit reached ({res['current']}/{res['quota_limit']})"
3699
- # )
3700
- elif response.status_code == 403:
3701
- raise PermissionError(_read_json_response(response)["reason"])
3702
- elif response.status_code == 404:
3703
- res = cast(NotFoundErrorResponse, _read_json_response(response))
3704
- if res["resource"] is not None:
3705
- raise LookupError(f"The {res['resource']} you are looking for does not exist")
3706
- else:
3707
- raise RuntimeError(f"Unknown API route: {response.url}")
3708
- elif response.status_code == 405:
3709
- raise RuntimeError(f"Unknown method {response.request.method} for API route: {response.url}")
3710
- elif response.status_code == 409:
3711
- res = cast(ConstraintViolationErrorResponse, _read_json_response(response))
3712
- raise RuntimeError(res["constraint"])
3713
- elif response.status_code == 422:
3714
- res = cast(InvalidInputErrorResponse, _read_json_response(response))
3715
- issues = [f"{issue['loc'][-1]}: {issue['msg']}" for issue in res["validation_issues"]]
3716
- raise ValueError("Invalid input:\n\t" + "\n\t".join(issues))
3717
- elif response.status_code == 500:
3718
- res = cast(InternalServerErrorResponse, _read_json_response(response))
3719
- raise RuntimeError(f"Unexpected server error: {res['message']}")
3720
- elif response.status_code == 503:
3721
- raise RuntimeError("Orca API is currently unavailable, please try again later")
3722
- elif response.status_code >= 400:
3723
- raise RuntimeError(f"Unexpected status code: {response.status_code}")
3724
-
3725
-
3726
- def _instrument_request(request: Request) -> None:
3727
- request.headers["X-Request-ID"] = str(uuid.uuid4())
3728
-
3729
-
3730
- logging.getLogger("httpx").setLevel(logging.WARNING)
3731
- logging.getLogger("httpcore").setLevel(logging.ERROR)
3732
-
3733
- orca_api = OrcaClient(
3734
- transport=RetryTransport(
3735
- transport=HTTPTransport(),
3736
- retry=Retry(
3737
- total=5,
3738
- backoff_factor=0.5,
3739
- allowed_methods=["GET", "POST", "PUT", "PATCH", "DELETE"],
3740
- status_forcelist=[429, 500, 502, 503, 504],
3741
- ),
3742
- ),
3743
- event_hooks={"request": [_instrument_request], "response": [_raise_error_for_response]},
3744
- follow_redirects=True,
3745
- timeout=Timeout(connect=3, read=20, write=10, pool=5),
3746
- )
3747
- """Typed client for the Orca API"""
3763
+ def api_key(self) -> str:
3764
+ return self.headers["Api-Key"]
3765
+
3766
+ @api_key.setter
3767
+ def api_key(self, api_key: str) -> None:
3768
+ self.headers.update(Headers({"Api-Key": api_key}))
3769
+
3770
+ client_ctx = ContextVar[Self | None]("orca_client", default=None)
3771
+ default_client: Self | None = None
3772
+
3773
+ @contextmanager
3774
+ def use(self) -> Generator[None, None, None]:
3775
+ """Context manager to inject this client into any OrcaSDK methods"""
3776
+ token = self.client_ctx.set(self)
3777
+ try:
3778
+ yield
3779
+ finally:
3780
+ self.client_ctx.reset(token)
3781
+
3782
+ @classmethod
3783
+ def _resolve_client(cls, client: Self | None = None) -> Self:
3784
+ client = client or cls.client_ctx.get() or cls.default_client
3785
+ if not client:
3786
+ client = cls.default_client = cls()
3787
+ return client