futurehouse-client 0.4.1__py3-none-any.whl → 0.4.2.dev11__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.
@@ -1746,22 +1746,19 @@ class RestClient:
1746
1746
  wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
1747
1747
  retry=retry_if_connection_error,
1748
1748
  )
1749
- def get_project_by_name(self, name: str) -> UUID:
1749
+ def get_project_by_name(self, name: str, limit: int = 2) -> UUID | list[UUID]:
1750
1750
  """Get a project UUID by name.
1751
1751
 
1752
1752
  Args:
1753
1753
  name: The name of the project to find
1754
+ limit: Maximum number of projects to return
1754
1755
 
1755
1756
  Returns:
1756
- UUID of the project as a string
1757
-
1758
- Raises:
1759
- ProjectError: If no project is found, multiple projects are found, or there's an error
1757
+ UUID of the project as a string or a list of UUIDs if multiple projects are found
1760
1758
  """
1761
1759
  try:
1762
- # Get projects filtered by name (backend now filters by name and owner)
1763
1760
  response = self.client.get(
1764
- "/v0.1/projects", params={"limit": 2, "name": name}
1761
+ "/v0.1/projects", params={"limit": limit, "name": name}
1765
1762
  )
1766
1763
  response.raise_for_status()
1767
1764
  projects = response.json()
@@ -1774,32 +1771,33 @@ class RestClient:
1774
1771
  if len(projects) == 0:
1775
1772
  raise ProjectError(f"No project found with name '{name}'")
1776
1773
  if len(projects) > 1:
1777
- raise ProjectError(
1774
+ logger.warning(
1778
1775
  f"Multiple projects found with name '{name}'. Found {len(projects)} projects."
1779
1776
  )
1780
1777
 
1781
- return UUID(projects[0]["id"])
1778
+ ids = [UUID(project["id"]) for project in projects]
1779
+ return ids[0] if len(ids) == 1 else ids
1782
1780
 
1783
1781
  @retry(
1784
1782
  stop=stop_after_attempt(MAX_RETRY_ATTEMPTS),
1785
1783
  wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
1786
1784
  retry=retry_if_connection_error,
1787
1785
  )
1788
- async def aget_project_by_name(self, name: str) -> UUID:
1786
+ async def aget_project_by_name(
1787
+ self, name: str, limit: int = 2
1788
+ ) -> UUID | list[UUID]:
1789
1789
  """Asynchronously get a project UUID by name.
1790
1790
 
1791
1791
  Args:
1792
1792
  name: The name of the project to find
1793
+ limit: Maximum number of projects to return
1793
1794
 
1794
1795
  Returns:
1795
- UUID of the project as a string
1796
-
1797
- Raises:
1798
- ProjectError: If no project is found, multiple projects are found, or there's an error
1796
+ UUID of the project as a string or a list of UUIDs if multiple projects are found
1799
1797
  """
1800
1798
  try:
1801
1799
  response = await self.async_client.get(
1802
- "/v0.1/projects", params={"limit": 2, "name": name}
1800
+ "/v0.1/projects", params={"limit": limit, "name": name}
1803
1801
  )
1804
1802
  response.raise_for_status()
1805
1803
  projects = response.json()
@@ -1808,11 +1806,12 @@ class RestClient:
1808
1806
  if len(projects) == 0:
1809
1807
  raise ProjectError(f"No project found with name '{name}'")
1810
1808
  if len(projects) > 1:
1811
- raise ProjectError(
1809
+ logger.warning(
1812
1810
  f"Multiple projects found with name '{name}'. Found {len(projects)} projects."
1813
1811
  )
1814
1812
 
1815
- return UUID(projects[0]["id"])
1813
+ ids = [UUID(project["id"]) for project in projects]
1814
+ return ids[0] if len(ids) == 1 else ids
1816
1815
 
1817
1816
  @retry(
1818
1817
  stop=stop_after_attempt(MAX_RETRY_ATTEMPTS),
@@ -27,17 +27,13 @@ class InitialState(BaseState):
27
27
 
28
28
  class ASVState(BaseState, Generic[T]):
29
29
  action: OpResult[T] = Field()
30
- next_state: Any = Field()
30
+ next_agent_state: Any = Field()
31
31
  value: float = Field()
32
32
 
33
33
  @field_serializer("action")
34
34
  def serialize_action(self, action: OpResult[T]) -> dict:
35
35
  return action.to_dict()
36
36
 
37
- @field_serializer("next_state")
38
- def serialize_next_state(self, state: Any) -> str:
39
- return str(state)
40
-
41
37
 
42
38
  class EnvResetState(BaseState):
43
39
  observations: list[Message] = Field()
@@ -1,7 +1,14 @@
1
1
  # file generated by setuptools-scm
2
2
  # don't change, don't track in version control
3
3
 
4
- __all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
4
+ __all__ = [
5
+ "__version__",
6
+ "__version_tuple__",
7
+ "version",
8
+ "version_tuple",
9
+ "__commit_id__",
10
+ "commit_id",
11
+ ]
5
12
 
6
13
  TYPE_CHECKING = False
7
14
  if TYPE_CHECKING:
@@ -9,13 +16,19 @@ if TYPE_CHECKING:
9
16
  from typing import Union
10
17
 
11
18
  VERSION_TUPLE = Tuple[Union[int, str], ...]
19
+ COMMIT_ID = Union[str, None]
12
20
  else:
13
21
  VERSION_TUPLE = object
22
+ COMMIT_ID = object
14
23
 
15
24
  version: str
16
25
  __version__: str
17
26
  __version_tuple__: VERSION_TUPLE
18
27
  version_tuple: VERSION_TUPLE
28
+ commit_id: COMMIT_ID
29
+ __commit_id__: COMMIT_ID
19
30
 
20
- __version__ = version = '0.4.1'
21
- __version_tuple__ = version_tuple = (0, 4, 1)
31
+ __version__ = version = '0.4.2.dev11'
32
+ __version_tuple__ = version_tuple = (0, 4, 2, 'dev11')
33
+
34
+ __commit_id__ = commit_id = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: futurehouse-client
3
- Version: 0.4.1
3
+ Version: 0.4.2.dev11
4
4
  Summary: A client for interacting with endpoints of the FutureHouse service.
5
5
  Author-email: FutureHouse technical staff <hello@futurehouse.org>
6
6
  License: Apache License
@@ -1,12 +1,12 @@
1
1
  futurehouse_client/__init__.py,sha256=PvFTkocA-hobsWoDEBEdrUgLIbuVbDs_0nvMdImJmHk,707
2
2
  futurehouse_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- futurehouse_client/version.py,sha256=yF2DwGUoQKNnLhAbpZX8kCQKjw77EZzhRk7_OTftets,511
3
+ futurehouse_client/version.py,sha256=c_JzNS0ouORBU9NbAiOBOJBqK2VWGvvGLFYyQtq8WEs,719
4
4
  futurehouse_client/clients/__init__.py,sha256=-HXNj-XJ3LRO5XM6MZ709iPs29YpApss0Q2YYg1qMZw,280
5
5
  futurehouse_client/clients/job_client.py,sha256=D51_qTxya6g5Wfg_ZfJdP031TV_YDJeXkGMiYAJ1qRc,11962
6
- futurehouse_client/clients/rest_client.py,sha256=NyK6-YDcvswWcRmvMjUWvvfuE4eYMmI0bWM4Qnkgr8Y,99684
6
+ futurehouse_client/clients/rest_client.py,sha256=OsdskJ1OT8SdDJQHG4bbt2_sVZMpHMtbG_x78cdV8ac,99790
7
7
  futurehouse_client/models/__init__.py,sha256=kQ4R7VEuRxO0IQEW_sk9CndBL7zzl8rUKI24ddyYLM0,647
8
8
  futurehouse_client/models/app.py,sha256=UUg17I3zk6cH_7mrdojHGYvQfm_SeDkuUxsPlRyIYz0,31895
9
- futurehouse_client/models/client.py,sha256=n4HD0KStKLm6Ek9nL9ylP-bkK10yzAaD1uIDF83Qp_A,1828
9
+ futurehouse_client/models/client.py,sha256=WFD1ddR0O7nD1ErqcJ-kt_miIW22KP6IDOSkaSdVZ8M,1716
10
10
  futurehouse_client/models/rest.py,sha256=ybelLsyTsKYud7DYUCF0sFF6u81bl8WmS_wWAnbX-0M,3382
11
11
  futurehouse_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  futurehouse_client/utils/auth.py,sha256=tgWELjKfg8eWme_qdcRmc8TjQN9DVZuHHaVXZNHLchk,2960
@@ -14,8 +14,8 @@ futurehouse_client/utils/general.py,sha256=A_rtTiYW30ELGEZlWCIArO7q1nEmqi8hUlmBR
14
14
  futurehouse_client/utils/module_utils.py,sha256=aFyd-X-pDARXz9GWpn8SSViUVYdSbuy9vSkrzcVIaGI,4955
15
15
  futurehouse_client/utils/monitoring.py,sha256=UjRlufe67kI3VxRHOd5fLtJmlCbVA2Wqwpd4uZhXkQM,8728
16
16
  futurehouse_client/utils/world_model_tools.py,sha256=Ctiy-EfK7EXrjmKO_nI6V5VhOJyHKWc0sKwa8Q0HAAo,2292
17
- futurehouse_client-0.4.1.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
18
- futurehouse_client-0.4.1.dist-info/METADATA,sha256=ucpuTCGRrKqqgXT8KEhy9XNLT1_e3LQdtPK-IcEKB0g,26797
19
- futurehouse_client-0.4.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- futurehouse_client-0.4.1.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
21
- futurehouse_client-0.4.1.dist-info/RECORD,,
17
+ futurehouse_client-0.4.2.dev11.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
18
+ futurehouse_client-0.4.2.dev11.dist-info/METADATA,sha256=xb_dj1oOZU-vjhdpMUnRrlLzbqfkaJCA-ZNa4PUE2LQ,26803
19
+ futurehouse_client-0.4.2.dev11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ futurehouse_client-0.4.2.dev11.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
21
+ futurehouse_client-0.4.2.dev11.dist-info/RECORD,,