orca-sdk 0.0.102__py3-none-any.whl → 0.0.103__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/_utils/auth.py CHANGED
@@ -53,7 +53,7 @@ def _delete_org(org_id: str) -> None:
53
53
  def _authenticate_local_api(org_id: str = _DEFAULT_ORG_ID, api_key_name: str = "local") -> None:
54
54
  """Connect to the local API at http://localhost:1584/ and authenticate with a new API key"""
55
55
  _delete_api_key(org_id, api_key_name, if_not_exists="ignore")
56
- OrcaCredentials.set_base_url("http://localhost:1584")
56
+ OrcaCredentials.set_api_url("http://localhost:1584")
57
57
  OrcaCredentials.set_api_key(_create_api_key(org_id, api_key_name))
58
58
  logging.info(f"Authenticated against local API at 'http://localhost:1584' with '{api_key_name}' API key")
59
59
 
@@ -3,7 +3,7 @@ from uuid import uuid4
3
3
 
4
4
  import numpy as np
5
5
  import pytest
6
- from datasets.arrow_dataset import Dataset
6
+ from datasets import Dataset
7
7
 
8
8
  from .classification_model import ClassificationMetrics, ClassificationModel
9
9
  from .conftest import skip_in_ci
orca_sdk/client.py CHANGED
@@ -36,6 +36,10 @@ class AddMemorySuggestion(TypedDict):
36
36
  label_name: str
37
37
 
38
38
 
39
+ class AliveResponse(TypedDict):
40
+ ok: bool
41
+
42
+
39
43
  class ApiKeyMetadata(TypedDict):
40
44
  id: str
41
45
  org_id: str
@@ -201,6 +205,14 @@ class GetMemoriesRequest(TypedDict):
201
205
  memory_ids: list[str]
202
206
 
203
207
 
208
+ class HealthyResponse(TypedDict):
209
+ ok: bool
210
+ checks: dict[str, bool]
211
+ durations: dict[str, int]
212
+ draining: bool
213
+ config: dict[str, str | float | int | bool | None]
214
+
215
+
204
216
  class InternalServerErrorResponse(TypedDict):
205
217
  status_code: NotRequired[int]
206
218
  message: str
@@ -282,6 +294,7 @@ class MemorysetClassPatternsMetrics(TypedDict):
282
294
  variance_spread: float
283
295
  mean_uniformity: float
284
296
  variance_uniformity: float
297
+ updated_at: str
285
298
 
286
299
 
287
300
  class MemorysetClusterAnalysisConfig(TypedDict):
@@ -299,6 +312,7 @@ class MemorysetClusterMetrics(TypedDict):
299
312
  cluster_metrics: list[ClusterMetrics]
300
313
  num_outliers: int
301
314
  num_clusters: int
315
+ updated_at: str
302
316
 
303
317
 
304
318
  class MemorysetConceptAnalysisConfig(TypedDict):
@@ -321,6 +335,7 @@ class MemorysetDuplicateAnalysisConfig(TypedDict):
321
335
  class MemorysetDuplicateMetrics(TypedDict):
322
336
  num_duplicates: int
323
337
  num_potential_duplicates: int
338
+ updated_at: str
324
339
 
325
340
 
326
341
  class MemorysetLabelAnalysisConfig(TypedDict):
@@ -334,6 +349,7 @@ class MemorysetLabelMetrics(TypedDict):
334
349
  mean_neighbor_label_entropy: float
335
350
  mean_neighbor_predicted_label_ambiguity: float
336
351
  num_potential_mislabels: int
352
+ updated_at: str
337
353
 
338
354
 
339
355
  class MemorysetNeighborAnalysisConfig(TypedDict):
@@ -343,6 +359,7 @@ class MemorysetNeighborAnalysisConfig(TypedDict):
343
359
 
344
360
  class MemorysetNeighborMetrics(TypedDict):
345
361
  lookup_score_metrics: dict[str, LookupScoreMetrics]
362
+ updated_at: str
346
363
 
347
364
 
348
365
  class MemorysetProjectionAnalysisConfig(TypedDict):
@@ -351,7 +368,7 @@ class MemorysetProjectionAnalysisConfig(TypedDict):
351
368
 
352
369
 
353
370
  class MemorysetProjectionMetrics(TypedDict):
354
- pass
371
+ updated_at: str
355
372
 
356
373
 
357
374
  class MemorysetUpdate(TypedDict):
@@ -359,6 +376,7 @@ class MemorysetUpdate(TypedDict):
359
376
  description: NotRequired[str | None]
360
377
  name: NotRequired[str]
361
378
  notes: NotRequired[str | None]
379
+ hidden: NotRequired[bool]
362
380
 
363
381
 
364
382
  class NotFoundErrorResponse(TypedDict):
@@ -477,6 +495,11 @@ class ROCCurve(TypedDict):
477
495
  true_positive_rates: list[float]
478
496
 
479
497
 
498
+ class ReadyResponse(TypedDict):
499
+ ok: bool
500
+ draining: bool
501
+
502
+
480
503
  class RegressionEvaluationRequest(TypedDict):
481
504
  datasource_name_or_id: str
482
505
  memoryset_override_name_or_id: NotRequired[str | None]
@@ -639,7 +662,7 @@ class SubConceptMetrics(TypedDict):
639
662
  memory_count: int
640
663
 
641
664
 
642
- TaskStatus = Literal["INITIALIZED", "DISPATCHED", "PROCESSING", "COMPLETED", "FAILED", "ABORTING", "ABORTED"]
665
+ TaskStatus = Literal["INITIALIZED", "DISPATCHED", "WAITING", "PROCESSING", "COMPLETED", "FAILED", "ABORTING", "ABORTED"]
643
666
 
644
667
 
645
668
  class TaskStatusInfo(TypedDict):
@@ -697,6 +720,7 @@ class DeleteAuthApiKeyByNameOrIdParams(TypedDict):
697
720
 
698
721
  class GetMemorysetParams(TypedDict):
699
722
  type: NotRequired[MemoryType | None]
723
+ show_hidden: NotRequired[bool | None]
700
724
 
701
725
 
702
726
  class PostMemorysetByNameOrIdCloneParams(TypedDict):
@@ -1149,6 +1173,7 @@ class CreateMemorysetRequest(TypedDict):
1149
1173
  index_type: NotRequired[Literal["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "DISKANN"]]
1150
1174
  index_params: NotRequired[dict[str, int | float | str]]
1151
1175
  prompt: NotRequired[str]
1176
+ hidden: NotRequired[bool]
1152
1177
 
1153
1178
 
1154
1179
  class CreateRegressionModelRequest(TypedDict):
@@ -1410,6 +1435,7 @@ class MemorysetAnalysisRequest(TypedDict):
1410
1435
  class MemorysetConceptMetrics(TypedDict):
1411
1436
  concepts: list[ConceptMetrics]
1412
1437
  num_outliers: int
1438
+ updated_at: str
1413
1439
 
1414
1440
 
1415
1441
  class MemorysetMetrics(TypedDict):
@@ -1514,6 +1540,7 @@ class MemorysetMetadata(TypedDict):
1514
1540
  database_uri: str | None
1515
1541
  document_prompt_override: str | None
1516
1542
  query_prompt_override: str | None
1543
+ hidden: bool
1517
1544
 
1518
1545
 
1519
1546
  class PaginatedTask(TypedDict):
@@ -1565,7 +1592,7 @@ class OrcaClient(Client):
1565
1592
  @overload
1566
1593
  def GET(
1567
1594
  self,
1568
- path: Literal["/"],
1595
+ path: Literal["/check/alive"],
1569
1596
  *,
1570
1597
  params: None = None,
1571
1598
  parse_as: Literal["json"] = "json",
@@ -1575,13 +1602,13 @@ class OrcaClient(Client):
1575
1602
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1576
1603
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1577
1604
  extensions: RequestExtensions | None = None,
1578
- ) -> Any:
1605
+ ) -> AliveResponse:
1579
1606
  pass
1580
1607
 
1581
1608
  @overload
1582
1609
  def GET(
1583
1610
  self,
1584
- path: Literal["/check/alive"],
1611
+ path: Literal["/check/ready"],
1585
1612
  *,
1586
1613
  params: None = None,
1587
1614
  parse_as: Literal["json"] = "json",
@@ -1591,13 +1618,13 @@ class OrcaClient(Client):
1591
1618
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1592
1619
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1593
1620
  extensions: RequestExtensions | None = None,
1594
- ) -> Any:
1621
+ ) -> ReadyResponse:
1595
1622
  pass
1596
1623
 
1597
1624
  @overload
1598
1625
  def GET(
1599
1626
  self,
1600
- path: Literal["/check/ready"],
1627
+ path: Literal["/gpu/check/healthy"],
1601
1628
  *,
1602
1629
  params: None = None,
1603
1630
  parse_as: Literal["json"] = "json",
@@ -1607,7 +1634,87 @@ class OrcaClient(Client):
1607
1634
  follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1608
1635
  timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1609
1636
  extensions: RequestExtensions | None = None,
1610
- ) -> Any:
1637
+ ) -> HealthyResponse:
1638
+ pass
1639
+
1640
+ @overload
1641
+ def GET(
1642
+ self,
1643
+ path: Literal["/check/healthy"],
1644
+ *,
1645
+ params: None = None,
1646
+ parse_as: Literal["json"] = "json",
1647
+ headers: HeaderTypes | None = None,
1648
+ cookies: CookieTypes | None = None,
1649
+ auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1650
+ follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1651
+ timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1652
+ extensions: RequestExtensions | None = None,
1653
+ ) -> HealthyResponse:
1654
+ pass
1655
+
1656
+ @overload
1657
+ def GET(
1658
+ self,
1659
+ path: Literal["/gpu/config"],
1660
+ *,
1661
+ params: None = None,
1662
+ parse_as: Literal["json"] = "json",
1663
+ headers: HeaderTypes | None = None,
1664
+ cookies: CookieTypes | None = None,
1665
+ auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1666
+ follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1667
+ timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1668
+ extensions: RequestExtensions | None = None,
1669
+ ) -> dict[str, str | float | int | bool | None]:
1670
+ pass
1671
+
1672
+ @overload
1673
+ def GET(
1674
+ self,
1675
+ path: Literal["/config"],
1676
+ *,
1677
+ params: None = None,
1678
+ parse_as: Literal["json"] = "json",
1679
+ headers: HeaderTypes | None = None,
1680
+ cookies: CookieTypes | None = None,
1681
+ auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1682
+ follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1683
+ timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1684
+ extensions: RequestExtensions | None = None,
1685
+ ) -> dict[str, str | float | int | bool | None]:
1686
+ pass
1687
+
1688
+ @overload
1689
+ def GET(
1690
+ self,
1691
+ path: Literal["/gpu/"],
1692
+ *,
1693
+ params: None = None,
1694
+ parse_as: Literal["text"],
1695
+ headers: HeaderTypes | None = None,
1696
+ cookies: CookieTypes | None = None,
1697
+ auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1698
+ follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1699
+ timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1700
+ extensions: RequestExtensions | None = None,
1701
+ ) -> str:
1702
+ pass
1703
+
1704
+ @overload
1705
+ def GET(
1706
+ self,
1707
+ path: Literal["/"],
1708
+ *,
1709
+ params: None = None,
1710
+ parse_as: Literal["text"],
1711
+ headers: HeaderTypes | None = None,
1712
+ cookies: CookieTypes | None = None,
1713
+ auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1714
+ follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
1715
+ timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
1716
+ extensions: RequestExtensions | None = None,
1717
+ ) -> str:
1611
1718
  pass
1612
1719
 
1613
1720
  @overload
@@ -2345,54 +2452,6 @@ class OrcaClient(Client):
2345
2452
  """Get the status of a bootstrap classification model task"""
2346
2453
  pass
2347
2454
 
2348
- @overload
2349
- def GET(
2350
- self,
2351
- path: Literal["/gpu/"],
2352
- *,
2353
- params: None = None,
2354
- parse_as: Literal["json"] = "json",
2355
- headers: HeaderTypes | None = None,
2356
- cookies: CookieTypes | None = None,
2357
- auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2358
- follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2359
- timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2360
- extensions: RequestExtensions | None = None,
2361
- ) -> Any:
2362
- pass
2363
-
2364
- @overload
2365
- def GET(
2366
- self,
2367
- path: Literal["/gpu/check/alive"],
2368
- *,
2369
- params: None = None,
2370
- parse_as: Literal["json"] = "json",
2371
- headers: HeaderTypes | None = None,
2372
- cookies: CookieTypes | None = None,
2373
- auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2374
- follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2375
- timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2376
- extensions: RequestExtensions | None = None,
2377
- ) -> Any:
2378
- pass
2379
-
2380
- @overload
2381
- def GET(
2382
- self,
2383
- path: Literal["/gpu/check/ready"],
2384
- *,
2385
- params: None = None,
2386
- parse_as: Literal["json"] = "json",
2387
- headers: HeaderTypes | None = None,
2388
- cookies: CookieTypes | None = None,
2389
- auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2390
- follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
2391
- timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
2392
- extensions: RequestExtensions | None = None,
2393
- ) -> Any:
2394
- pass
2395
-
2396
2455
  def GET(
2397
2456
  self,
2398
2457
  path: str,
orca_sdk/conftest.py CHANGED
@@ -24,7 +24,7 @@ os.environ["ORCA_SAVE_TELEMETRY_SYNCHRONOUSLY"] = "true"
24
24
 
25
25
  def skip_in_prod(reason: str):
26
26
  """Custom decorator to skip tests when running against production API"""
27
- PROD_API_URLs = ["https://api.orcadb.ai", "https://api.dev.orcadb.ai"]
27
+ PROD_API_URLs = ["https://api.orcadb.ai", "https://api.staging.orcadb.ai"]
28
28
  return pytest.mark.skipif(
29
29
  os.environ["ORCA_API_URL"] in PROD_API_URLs,
30
30
  reason=reason,
@@ -45,7 +45,7 @@ def _create_org_id():
45
45
 
46
46
 
47
47
  @pytest.fixture()
48
- def base_url_reset():
48
+ def api_url_reset():
49
49
  original_base_url = orca_api.base_url
50
50
  yield
51
51
  orca_api.base_url = original_base_url
orca_sdk/credentials.py CHANGED
@@ -35,11 +35,33 @@ class OrcaCredentials:
35
35
  """
36
36
 
37
37
  @staticmethod
38
- def get_api_url() -> str:
38
+ def is_authenticated() -> bool:
39
39
  """
40
- Get the Orca API base URL that is currently being used
40
+ Check if you are authenticated to interact with the Orca API
41
+
42
+ Returns:
43
+ True if you are authenticated, False otherwise
41
44
  """
42
- return str(orca_api.base_url)
45
+ try:
46
+ return orca_api.GET("/auth")
47
+ except ValueError as e:
48
+ if "Invalid API key" in str(e):
49
+ return False
50
+ raise e
51
+
52
+ @staticmethod
53
+ def is_healthy() -> bool:
54
+ """
55
+ Check whether the API is healthy
56
+
57
+ Returns:
58
+ True if the API is healthy, False otherwise
59
+ """
60
+ try:
61
+ orca_api.GET("/check/healthy")
62
+ except Exception:
63
+ return False
64
+ return True
43
65
 
44
66
  @staticmethod
45
67
  def list_api_keys() -> list[ApiKeyInfo]:
@@ -58,21 +80,6 @@ class OrcaCredentials:
58
80
  for api_key in orca_api.GET("/auth/api_key")
59
81
  ]
60
82
 
61
- @staticmethod
62
- def is_authenticated() -> bool:
63
- """
64
- Check if you are authenticated to interact with the Orca API
65
-
66
- Returns:
67
- True if you are authenticated, False otherwise
68
- """
69
- try:
70
- return orca_api.GET("/auth")
71
- except ValueError as e:
72
- if "Invalid API key" in str(e):
73
- return False
74
- raise e
75
-
76
83
  @staticmethod
77
84
  def create_api_key(name: str, scopes: set[Scope] = {"ADMINISTER"}) -> str:
78
85
  """
@@ -104,20 +111,6 @@ class OrcaCredentials:
104
111
  """
105
112
  orca_api.DELETE("/auth/api_key/{name_or_id}", params={"name_or_id": name})
106
113
 
107
- @staticmethod
108
- def set_headers(headers: dict[str, str]):
109
- """
110
- Add or override default HTTP headers for all Orca API requests.
111
-
112
- Params:
113
- headers: Mapping of header names to their string values
114
-
115
- Notes:
116
- New keys are merged into the existing headers, this will overwrite headers with the
117
- same name, but leave other headers untouched.
118
- """
119
- orca_api.headers.update(Headers(headers))
120
-
121
114
  @staticmethod
122
115
  def set_api_key(api_key: str, check_validity: bool = True):
123
116
  """
@@ -133,17 +126,24 @@ class OrcaCredentials:
133
126
  Raises:
134
127
  ValueError: if the API key is invalid and `check_validity` is True
135
128
  """
136
- OrcaCredentials.set_headers({"Api-Key": api_key})
129
+ OrcaCredentials.set_api_headers({"Api-Key": api_key})
137
130
  if check_validity:
138
131
  orca_api.GET("/auth")
139
132
 
140
133
  @staticmethod
141
- def set_base_url(base_url: str, check_validity: bool = True):
134
+ def get_api_url() -> str:
135
+ """
136
+ Get the base URL of the Orca API that is currently being used
137
+ """
138
+ return str(orca_api.base_url)
139
+
140
+ @staticmethod
141
+ def set_api_url(url: str, check_validity: bool = True):
142
142
  """
143
143
  Set the base URL for the Orca API
144
144
 
145
145
  Args:
146
- base_url: The base URL to set
146
+ url: The base URL to set
147
147
  check_validity: Whether to check if there is an API running at the given base URL
148
148
 
149
149
  Raises:
@@ -152,27 +152,26 @@ class OrcaCredentials:
152
152
  # check if the base url is reachable before setting it
153
153
  if check_validity:
154
154
  try:
155
- httpx.get(base_url, timeout=1)
155
+ httpx.get(url, timeout=1)
156
156
  except ConnectError as e:
157
- raise ValueError(f"No API found at {base_url}") from e
157
+ raise ValueError(f"No API found at {url}") from e
158
158
 
159
- orca_api.base_url = base_url
159
+ orca_api.base_url = url
160
160
 
161
161
  # check if the api passes the health check
162
162
  if check_validity:
163
- orca_api.GET("/")
163
+ OrcaCredentials.is_healthy()
164
164
 
165
165
  @staticmethod
166
- def is_healthy() -> bool:
166
+ def set_api_headers(headers: dict[str, str]):
167
167
  """
168
- Check whether the API is healthy
168
+ Add or override default HTTP headers for all Orca API requests.
169
169
 
170
- Returns:
171
- True if the API is healthy, False otherwise
170
+ Params:
171
+ headers: Mapping of header names to their string values
172
+
173
+ Notes:
174
+ New keys are merged into the existing headers, this will overwrite headers with the
175
+ same name, but leave other headers untouched.
172
176
  """
173
- try:
174
- orca_api.GET("/")
175
- orca_api.GET("/gpu/")
176
- except Exception:
177
- return False
178
- return True
177
+ orca_api.headers.update(Headers(headers))
@@ -38,20 +38,20 @@ def test_set_invalid_api_key(api_key):
38
38
  assert not OrcaCredentials.is_authenticated()
39
39
 
40
40
 
41
- def test_set_base_url(base_url_reset):
42
- OrcaCredentials.set_base_url("http://api.orcadb.ai")
41
+ def test_set_api_url(api_url_reset):
42
+ OrcaCredentials.set_api_url("http://api.orcadb.ai")
43
43
  assert str(orca_api.base_url) == "http://api.orcadb.ai"
44
44
 
45
45
 
46
46
  def test_set_invalid_base_url():
47
47
  with pytest.raises(ValueError, match="No API found at http://localhost:1582"):
48
- OrcaCredentials.set_base_url("http://localhost:1582")
48
+ OrcaCredentials.set_api_url("http://localhost:1582")
49
49
 
50
50
 
51
51
  def test_is_healthy():
52
52
  assert OrcaCredentials.is_healthy()
53
53
 
54
54
 
55
- def test_is_healthy_false(base_url_reset):
56
- OrcaCredentials.set_base_url("http://localhost:1582", check_validity=False)
55
+ def test_is_healthy_false(api_url_reset):
56
+ OrcaCredentials.set_api_url("http://localhost:1582", check_validity=False)
57
57
  assert not OrcaCredentials.is_healthy()
orca_sdk/job.py CHANGED
@@ -7,7 +7,7 @@ from typing import Callable, Generic, TypedDict, TypeVar, cast
7
7
 
8
8
  from tqdm.auto import tqdm
9
9
 
10
- from .client import TaskStatus, orca_api
10
+ from .client import orca_api
11
11
 
12
12
 
13
13
  class JobConfig(TypedDict):
@@ -26,6 +26,9 @@ class Status(Enum):
26
26
  DISPATCHED = "DISPATCHED"
27
27
  """The job has been queued and is waiting to be processed"""
28
28
 
29
+ WAITING = "WAITING"
30
+ """The job is waiting for dependencies to complete"""
31
+
29
32
  PROCESSING = "PROCESSING"
30
33
  """The job is being processed"""
31
34
 
orca_sdk/memoryset.py CHANGED
@@ -21,7 +21,9 @@ from .client import (
21
21
  FilterItem,
22
22
  )
23
23
  from .client import LabeledMemory as LabeledMemoryResponse
24
- from .client import LabeledMemoryInsert
24
+ from .client import (
25
+ LabeledMemoryInsert,
26
+ )
25
27
  from .client import LabeledMemoryLookup as LabeledMemoryLookupResponse
26
28
  from .client import (
27
29
  LabeledMemoryUpdate,
@@ -35,7 +37,9 @@ from .client import (
35
37
  MemoryType,
36
38
  )
37
39
  from .client import ScoredMemory as ScoredMemoryResponse
38
- from .client import ScoredMemoryInsert
40
+ from .client import (
41
+ ScoredMemoryInsert,
42
+ )
39
43
  from .client import ScoredMemoryLookup as ScoredMemoryLookupResponse
40
44
  from .client import (
41
45
  ScoredMemoryUpdate,
@@ -645,6 +649,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
645
649
  embedding_model: EmbeddingModelBase
646
650
  index_type: IndexType
647
651
  index_params: dict[str, Any]
652
+ hidden: bool
648
653
 
649
654
  def __init__(self, metadata: MemorysetMetadata):
650
655
  # for internal use only, do not document
@@ -665,6 +670,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
665
670
  self.index_type = metadata["index_type"]
666
671
  self.index_params = metadata["index_params"]
667
672
  self.memory_type = metadata["memory_type"]
673
+ self.hidden = metadata["hidden"]
668
674
 
669
675
  def __eq__(self, other) -> bool:
670
676
  return isinstance(other, MemorysetBase) and self.id == other.id
@@ -699,6 +705,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
699
705
  index_params: dict[str, Any] = {},
700
706
  if_exists: CreateMode = "error",
701
707
  background: Literal[True],
708
+ hidden: bool = False,
702
709
  ) -> Job[Self]:
703
710
  pass
704
711
 
@@ -723,6 +730,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
723
730
  index_params: dict[str, Any] = {},
724
731
  if_exists: CreateMode = "error",
725
732
  background: Literal[False] = False,
733
+ hidden: bool = False,
726
734
  ) -> Self:
727
735
  pass
728
736
 
@@ -746,6 +754,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
746
754
  index_params: dict[str, Any] = {},
747
755
  if_exists: CreateMode = "error",
748
756
  background: bool = False,
757
+ hidden: bool = False,
749
758
  ) -> Self | Job[Self]:
750
759
  """
751
760
  Create a new memoryset in the OrcaCloud
@@ -783,6 +792,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
783
792
  if_exists: What to do if a memoryset with the same name already exists, defaults to
784
793
  `"error"`. Other option is `"open"` to open the existing memoryset.
785
794
  background: Whether to run the operation none blocking and return a job handle
795
+ hidden: Whether the memoryset should be hidden
786
796
 
787
797
  Returns:
788
798
  Handle to the new memoryset in the OrcaCloud
@@ -820,6 +830,7 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
820
830
  "remove_duplicates": remove_duplicates,
821
831
  "index_type": index_type,
822
832
  "index_params": index_params,
833
+ "hidden": hidden,
823
834
  }
824
835
  if prompt is not None:
825
836
  payload["prompt"] = prompt
@@ -1272,14 +1283,20 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
1272
1283
  return False
1273
1284
 
1274
1285
  @classmethod
1275
- def all(cls) -> list[Self]:
1286
+ def all(cls, show_hidden: bool = False) -> list[Self]:
1276
1287
  """
1277
1288
  Get a list of handles to all memorysets in the OrcaCloud
1278
1289
 
1290
+ Params:
1291
+ show_hidden: Whether to include hidden memorysets in results, defaults to `False`
1292
+
1279
1293
  Returns:
1280
1294
  List of handles to all memorysets in the OrcaCloud
1281
1295
  """
1282
- return [cls(metadata) for metadata in orca_api.GET("/memoryset", params={"type": cls.memory_type})]
1296
+ return [
1297
+ cls(metadata)
1298
+ for metadata in orca_api.GET("/memoryset", params={"type": cls.memory_type, "show_hidden": show_hidden})
1299
+ ]
1283
1300
 
1284
1301
  @classmethod
1285
1302
  def drop(cls, name_or_id: str, if_not_exists: DropMode = "error"):
@@ -1301,7 +1318,14 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
1301
1318
  if if_not_exists == "error":
1302
1319
  raise
1303
1320
 
1304
- def set(self, *, name: str = UNSET, description: str | None = UNSET, label_names: list[str] = UNSET):
1321
+ def set(
1322
+ self,
1323
+ *,
1324
+ name: str = UNSET,
1325
+ description: str | None = UNSET,
1326
+ label_names: list[str] = UNSET,
1327
+ hidden: bool = UNSET,
1328
+ ):
1305
1329
  """
1306
1330
  Update editable attributes of the memoryset
1307
1331
 
@@ -1320,6 +1344,8 @@ class MemorysetBase(Generic[MemoryT, MemoryLookupT], ABC):
1320
1344
  payload["description"] = description
1321
1345
  if label_names is not UNSET:
1322
1346
  payload["label_names"] = label_names
1347
+ if hidden is not UNSET:
1348
+ payload["hidden"] = hidden
1323
1349
 
1324
1350
  orca_api.PATCH("/memoryset/{name_or_id}", params={"name_or_id": self.id}, json=payload)
1325
1351
  self.refresh()
@@ -122,6 +122,26 @@ def test_all_memorysets(readonly_memoryset: LabeledMemoryset):
122
122
  assert any(memoryset.name == readonly_memoryset.name for memoryset in memorysets)
123
123
 
124
124
 
125
+ def test_all_memorysets_hidden(
126
+ readonly_memoryset: LabeledMemoryset,
127
+ ):
128
+ # Create a hidden memoryset
129
+ hidden_memoryset = LabeledMemoryset.clone(readonly_memoryset, "test_hidden_memoryset")
130
+ hidden_memoryset.set(hidden=True)
131
+
132
+ # Test that show_hidden=False excludes hidden memorysets
133
+ visible_memorysets = LabeledMemoryset.all(show_hidden=False)
134
+ assert len(visible_memorysets) > 0
135
+ assert readonly_memoryset in visible_memorysets
136
+ assert hidden_memoryset not in visible_memorysets
137
+
138
+ # Test that show_hidden=True includes hidden memorysets
139
+ all_memorysets = LabeledMemoryset.all(show_hidden=True)
140
+ assert len(all_memorysets) == len(visible_memorysets) + 1
141
+ assert readonly_memoryset in all_memorysets
142
+ assert hidden_memoryset in all_memorysets
143
+
144
+
125
145
  def test_all_memorysets_unauthenticated(unauthenticated):
126
146
  with pytest.raises(ValueError, match="Invalid API key"):
127
147
  LabeledMemoryset.all()
@@ -167,6 +187,9 @@ def test_update_memoryset_attributes(writable_memoryset: LabeledMemoryset):
167
187
  writable_memoryset.set(label_names=["New label 1", "New label 2"])
168
188
  assert writable_memoryset.label_names == ["New label 1", "New label 2"]
169
189
 
190
+ writable_memoryset.set(hidden=True)
191
+ assert writable_memoryset.hidden is True
192
+
170
193
 
171
194
  def test_search(readonly_memoryset: LabeledMemoryset):
172
195
  memory_lookups = readonly_memoryset.search(["i love soup", "cats are cute"])
@@ -1,24 +1,25 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: orca_sdk
3
- Version: 0.0.102
3
+ Version: 0.0.103
4
4
  Summary: SDK for interacting with Orca Services
5
5
  License: Apache-2.0
6
6
  Author: Orca DB Inc.
7
7
  Author-email: dev-rel@orcadb.ai
8
- Requires-Python: >=3.11,<4.0
8
+ Requires-Python: >=3.11,<3.14
9
9
  Classifier: License :: OSI Approved :: Apache Software License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.11
12
12
  Classifier: Programming Language :: Python :: 3.12
13
13
  Classifier: Programming Language :: Python :: 3.13
14
14
  Requires-Dist: datasets (>=3.1.0,<4.0.0)
15
- Requires-Dist: gradio (==5.13.0)
16
- Requires-Dist: httpx (>=0.20.0,<0.29.0)
15
+ Requires-Dist: gradio (>=5.44.1,<6.0.0)
16
+ Requires-Dist: httpx (>=0.28.1,<0.29.0)
17
+ Requires-Dist: numpy (>=2.1.0,<3.0.0)
17
18
  Requires-Dist: pandas (>=2.2.3,<3.0.0)
18
19
  Requires-Dist: pyarrow (>=18.0.0,<19.0.0)
19
20
  Requires-Dist: python-dotenv (>=1.1.0,<2.0.0)
20
21
  Requires-Dist: scikit-learn (>=1.6.1,<2.0.0)
21
- Requires-Dist: torch (>=2.5.1,<3.0.0)
22
+ Requires-Dist: torch (>=2.8.0,<3.0.0)
22
23
  Description-Content-Type: text/markdown
23
24
 
24
25
  <!--
@@ -5,7 +5,7 @@ orca_sdk/_shared/metrics_test.py,sha256=3wD1e2WE_wGtWBQ0E2gML6J3LCcbQBMezxvhDM94
5
5
  orca_sdk/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  orca_sdk/_utils/analysis_ui.py,sha256=nT-M_YcNRCVPQzvuqYNFKnNHhYkADYBvq1GlIUePrWw,9232
7
7
  orca_sdk/_utils/analysis_ui_style.css,sha256=q_ba_-_KtgztepHg829zLzypaxKayl7ySC1-oYDzV3k,836
8
- orca_sdk/_utils/auth.py,sha256=58Gaa4KA9iy7WP-hMZT4PI6x5lkpctFbbJ6Piwu1ZS4,2484
8
+ orca_sdk/_utils/auth.py,sha256=Yf39jucuAkrM-TbTsLm_iRgLbLEcAIRzlHrCqgy8RiM,2483
9
9
  orca_sdk/_utils/auth_test.py,sha256=ygVWv1Ex53LaxIP7p2hzPHl8l9qYyBD5IGmEFJMps6s,1056
10
10
  orca_sdk/_utils/common.py,sha256=wUm2pNDWytEecC5WiDWd02-yCZw3Akx0bIutG4lHsFA,805
11
11
  orca_sdk/_utils/data_parsing.py,sha256=gkAwWEC8qRt3vRUObe7n7Pr0azOayNwc2yFY04WFp7E,5220
@@ -18,23 +18,23 @@ orca_sdk/_utils/tqdm_file_reader.py,sha256=Lw7Cg1UgNuRUoN6jjqZb-IlV00H-kbRcrZLdu
18
18
  orca_sdk/_utils/value_parser.py,sha256=c3qMABCCDQcIjn9N1orYYnlRwDW9JWdGwW_2TDZPLdI,1286
19
19
  orca_sdk/_utils/value_parser_test.py,sha256=OybsiC-Obi32RRi9NIuwrVBRAnlyPMV1xVAaevSrb7M,1079
20
20
  orca_sdk/classification_model.py,sha256=SUiUgv_o3UUngpz3Le_L6DsijhjXVEB3yo84hrD1MX4,31172
21
- orca_sdk/classification_model_test.py,sha256=WganVoP-0vw1cqiVWJ2vXyGi4lwYp_hbZHultpxvFqk,19536
22
- orca_sdk/client.py,sha256=Q2tjK-CeNnX0dgK-oZPzElgEK3wkxXC1q5YK85mZcqE,120338
23
- orca_sdk/conftest.py,sha256=LHA46gDU_D0T_ogS6XOVQvGDDMD01nVZFWVcBYDConc,8885
24
- orca_sdk/credentials.py,sha256=G_jdeC-1j6oL6VtHnRHL-LxvLXnL-KH2CDCB2iQ9POY,5084
25
- orca_sdk/credentials_test.py,sha256=whUweSJIEws6C8Bku-5V31Dv9hD1mFDDW7X2cCsB6g0,1629
21
+ orca_sdk/classification_model_test.py,sha256=VlmHJ5CYzyGLDn-6hVqTkqoH7mBIgyzFiNOse0olYl4,19522
22
+ orca_sdk/client.py,sha256=Iw0zHKe9kWvtSS-xv-J1LgDDWwNbrxCSg8LqtBcGmiE,122073
23
+ orca_sdk/conftest.py,sha256=vTw-gkWpTutMU0GdNNwtqAEAEcyPrT5hCogghK4jtTY,8888
24
+ orca_sdk/credentials.py,sha256=YuWipb5r1R_uPRe0nrm8mbbrfrXKFimgFOxny9bzAbI,5063
25
+ orca_sdk/credentials_test.py,sha256=ZIIZtfv507UyIIgLhnECWn6KS5NjbfHMdT31f8k0zJM,1623
26
26
  orca_sdk/datasource.py,sha256=6wARRq-eNDJVSBABdVzn41z7s69xasTsqbozaVAsf9U,20263
27
27
  orca_sdk/datasource_test.py,sha256=wENPourrJvQN-uJJPaJI9EDuof6wVw3GirOhbrY4sFI,11564
28
28
  orca_sdk/embedding_model.py,sha256=FBuMDYKS8x6iyhSHtNO8TI2pCi6yYDycirKw3hqaGAc,26043
29
29
  orca_sdk/embedding_model_test.py,sha256=1aELyCuIzxSxUg7Z4tYtNOd8-hV5hFb-gsZTNh712OQ,7765
30
- orca_sdk/job.py,sha256=wWJPkkQbkNu_ylBtZN4AscU00VwWTfqlSmysRBUlivw,12787
30
+ orca_sdk/job.py,sha256=yHmHgm5vf2DHJlvAGgA2o1mNbKs3yoJ5RMeUpPSwl7E,12858
31
31
  orca_sdk/job_test.py,sha256=r4zCyCuJ8eVN-O6_IUSakmSBn64rY7oBmlNtb5RNsi0,3919
32
- orca_sdk/memoryset.py,sha256=aeceFH6WpIt3hVXnpjLGr7cdj5lPy_PeT3ZxR8fdhKA,85585
33
- orca_sdk/memoryset_test.py,sha256=14WG6u_adVmm6CSn2dM5lEfQYxybwh3s9Q7RBeTuoPE,20486
32
+ orca_sdk/memoryset.py,sha256=QIwW1kAWh_wtFHvjX2SvNMuLUBoFYK8tgsaaPXgtoQA,86188
33
+ orca_sdk/memoryset_test.py,sha256=0Al--P2jDwhlxFpTgL0piDPCrKtxZNvaYjzPugw4yAk,21361
34
34
  orca_sdk/regression_model.py,sha256=je2g1BmoPCuouv5iWqDolja90F2w2vD6TooXA8KjL7c,24552
35
35
  orca_sdk/regression_model_test.py,sha256=8LDhtQeh52grZQ2Xd0ju1MQvb_hwosY_ORDDE3wS2LA,14570
36
36
  orca_sdk/telemetry.py,sha256=qTEPkOlqjxsPaS-HR5Jh5ZnIvuF58aIy5OpzA-wQkAE,25713
37
37
  orca_sdk/telemetry_test.py,sha256=eT66C5lFdNg-pQdo2I__BP7Tn5fTc9aTkVo9ZhWwhU0,5519
38
- orca_sdk-0.0.102.dist-info/METADATA,sha256=dfe9GFGNjzso6R73Y-uVqyRgvFxvJZRIOsCgVvPpnn8,3665
39
- orca_sdk-0.0.102.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
40
- orca_sdk-0.0.102.dist-info/RECORD,,
38
+ orca_sdk-0.0.103.dist-info/METADATA,sha256=eXig9FBe1OKfMNVm30rrJIUzhvGLw5AaHj1gMKupqbE,3711
39
+ orca_sdk-0.0.103.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
40
+ orca_sdk-0.0.103.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any