futurehouse-client 0.3.20.dev200__py3-none-any.whl → 0.3.20.dev208__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.
- futurehouse_client/clients/rest_client.py +75 -2
- futurehouse_client/models/app.py +2 -1
- futurehouse_client/version.py +2 -2
- {futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/METADATA +1 -1
- {futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/RECORD +8 -8
- {futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/WHEEL +0 -0
- {futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/licenses/LICENSE +0 -0
- {futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/top_level.txt +0 -0
@@ -1568,6 +1568,79 @@ class RestClient:
|
|
1568
1568
|
f"An unexpected error occurred during world model creation: {e}"
|
1569
1569
|
) from e
|
1570
1570
|
|
1571
|
+
@retry(
|
1572
|
+
stop=stop_after_attempt(MAX_RETRY_ATTEMPTS),
|
1573
|
+
wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
|
1574
|
+
retry=retry_if_connection_error,
|
1575
|
+
)
|
1576
|
+
def get_project_by_name(self, name: str) -> UUID:
|
1577
|
+
"""Get a project UUID by name.
|
1578
|
+
|
1579
|
+
Args:
|
1580
|
+
name: The name of the project to find
|
1581
|
+
|
1582
|
+
Returns:
|
1583
|
+
UUID of the project as a string
|
1584
|
+
|
1585
|
+
Raises:
|
1586
|
+
ProjectError: If no project is found, multiple projects are found, or there's an error
|
1587
|
+
"""
|
1588
|
+
try:
|
1589
|
+
# Get projects filtered by name (backend now filters by name and owner)
|
1590
|
+
response = self.client.get(
|
1591
|
+
"/v0.1/projects", params={"limit": 2, "name": name}
|
1592
|
+
)
|
1593
|
+
response.raise_for_status()
|
1594
|
+
projects = response.json()
|
1595
|
+
except HTTPStatusError as e:
|
1596
|
+
raise ProjectError(
|
1597
|
+
f"Error getting project by name: {e.response.status_code} - {e.response.text}"
|
1598
|
+
) from e
|
1599
|
+
except Exception as e:
|
1600
|
+
raise ProjectError(f"Error getting project by name: {e}") from e
|
1601
|
+
if len(projects) == 0:
|
1602
|
+
raise ProjectError(f"No project found with name '{name}'")
|
1603
|
+
if len(projects) > 1:
|
1604
|
+
raise ProjectError(
|
1605
|
+
f"Multiple projects found with name '{name}'. Found {len(projects)} projects."
|
1606
|
+
)
|
1607
|
+
|
1608
|
+
return UUID(projects[0]["id"])
|
1609
|
+
|
1610
|
+
@retry(
|
1611
|
+
stop=stop_after_attempt(MAX_RETRY_ATTEMPTS),
|
1612
|
+
wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
|
1613
|
+
retry=retry_if_connection_error,
|
1614
|
+
)
|
1615
|
+
async def aget_project_by_name(self, name: str) -> UUID:
|
1616
|
+
"""Asynchronously get a project UUID by name.
|
1617
|
+
|
1618
|
+
Args:
|
1619
|
+
name: The name of the project to find
|
1620
|
+
|
1621
|
+
Returns:
|
1622
|
+
UUID of the project as a string
|
1623
|
+
|
1624
|
+
Raises:
|
1625
|
+
ProjectError: If no project is found, multiple projects are found, or there's an error
|
1626
|
+
"""
|
1627
|
+
try:
|
1628
|
+
response = await self.async_client.get(
|
1629
|
+
"/v0.1/projects", params={"limit": 2, "name": name}
|
1630
|
+
)
|
1631
|
+
response.raise_for_status()
|
1632
|
+
projects = response.json()
|
1633
|
+
except Exception as e:
|
1634
|
+
raise ProjectError(f"Error getting project by name: {e}") from e
|
1635
|
+
if len(projects) == 0:
|
1636
|
+
raise ProjectError(f"No project found with name '{name}'")
|
1637
|
+
if len(projects) > 1:
|
1638
|
+
raise ProjectError(
|
1639
|
+
f"Multiple projects found with name '{name}'. Found {len(projects)} projects."
|
1640
|
+
)
|
1641
|
+
|
1642
|
+
return UUID(projects[0]["id"])
|
1643
|
+
|
1571
1644
|
@retry(
|
1572
1645
|
stop=stop_after_attempt(MAX_RETRY_ATTEMPTS),
|
1573
1646
|
wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
|
@@ -1602,7 +1675,7 @@ class RestClient:
|
|
1602
1675
|
wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
|
1603
1676
|
retry=retry_if_connection_error,
|
1604
1677
|
)
|
1605
|
-
def add_task_to_project(self, project_id:
|
1678
|
+
def add_task_to_project(self, project_id: UUID, trajectory_id: str) -> None:
|
1606
1679
|
"""Add a trajectory to a project.
|
1607
1680
|
|
1608
1681
|
Args:
|
@@ -1667,7 +1740,7 @@ class RestClient:
|
|
1667
1740
|
wait=wait_exponential(multiplier=RETRY_MULTIPLIER, max=MAX_RETRY_WAIT),
|
1668
1741
|
retry=retry_if_connection_error,
|
1669
1742
|
)
|
1670
|
-
async def aadd_task_to_project(self, project_id:
|
1743
|
+
async def aadd_task_to_project(self, project_id: UUID, trajectory_id: str) -> None:
|
1671
1744
|
"""Asynchronously add a trajectory to a project.
|
1672
1745
|
|
1673
1746
|
Args:
|
futurehouse_client/models/app.py
CHANGED
@@ -647,6 +647,8 @@ class RuntimeConfig(BaseModel):
|
|
647
647
|
|
648
648
|
|
649
649
|
class TaskRequest(BaseModel):
|
650
|
+
model_config = ConfigDict(extra="forbid")
|
651
|
+
|
650
652
|
task_id: UUID | None = Field(
|
651
653
|
default=None,
|
652
654
|
description="Optional task identifier",
|
@@ -655,7 +657,6 @@ class TaskRequest(BaseModel):
|
|
655
657
|
project_id: UUID | None = Field(
|
656
658
|
default=None,
|
657
659
|
description="Optional group identifier for the task",
|
658
|
-
alias="project_id",
|
659
660
|
)
|
660
661
|
name: "str | JobNames" = Field(
|
661
662
|
description="Name of the crow to execute eg. paperqa-crow"
|
futurehouse_client/version.py
CHANGED
@@ -17,5 +17,5 @@ __version__: str
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
18
18
|
version_tuple: VERSION_TUPLE
|
19
19
|
|
20
|
-
__version__ = version = '0.3.20.
|
21
|
-
__version_tuple__ = version_tuple = (0, 3, 20, '
|
20
|
+
__version__ = version = '0.3.20.dev208'
|
21
|
+
__version_tuple__ = version_tuple = (0, 3, 20, 'dev208')
|
{futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: futurehouse-client
|
3
|
-
Version: 0.3.20.
|
3
|
+
Version: 0.3.20.dev208
|
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
|
{futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/RECORD
RENAMED
@@ -1,11 +1,11 @@
|
|
1
1
|
futurehouse_client/__init__.py,sha256=BztM_ntbgmIEjzvnBWcvPhvLjM8xGDFCK0Upf3-nIn8,488
|
2
2
|
futurehouse_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
futurehouse_client/version.py,sha256=
|
3
|
+
futurehouse_client/version.py,sha256=Q9A-Uuc0KS3oj8dhvFHWadX__nXqTHy-htzKO30lPiU,530
|
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=
|
6
|
+
futurehouse_client/clients/rest_client.py,sha256=v5INQ9Wsb3A3U2zdLfRUP2H1hXpsZHtiZdVEav3Sv6o,69215
|
7
7
|
futurehouse_client/models/__init__.py,sha256=kQ4R7VEuRxO0IQEW_sk9CndBL7zzl8rUKI24ddyYLM0,647
|
8
|
-
futurehouse_client/models/app.py,sha256=
|
8
|
+
futurehouse_client/models/app.py,sha256=SvkXOu5Qx28_jCS84XKKepnpGyfrQUEVnxS-JGqmsaE,29128
|
9
9
|
futurehouse_client/models/client.py,sha256=n4HD0KStKLm6Ek9nL9ylP-bkK10yzAaD1uIDF83Qp_A,1828
|
10
10
|
futurehouse_client/models/rest.py,sha256=AwPMcB1ruoqaI8NIhX2ZzN8UuX6XsaQ7uzeSE8EpwKk,1573
|
11
11
|
futurehouse_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -13,8 +13,8 @@ futurehouse_client/utils/auth.py,sha256=tgWELjKfg8eWme_qdcRmc8TjQN9DVZuHHaVXZNHL
|
|
13
13
|
futurehouse_client/utils/general.py,sha256=A_rtTiYW30ELGEZlWCIArO7q1nEmqi8hUlmBRYkMQ_c,767
|
14
14
|
futurehouse_client/utils/module_utils.py,sha256=aFyd-X-pDARXz9GWpn8SSViUVYdSbuy9vSkrzcVIaGI,4955
|
15
15
|
futurehouse_client/utils/monitoring.py,sha256=UjRlufe67kI3VxRHOd5fLtJmlCbVA2Wqwpd4uZhXkQM,8728
|
16
|
-
futurehouse_client-0.3.20.
|
17
|
-
futurehouse_client-0.3.20.
|
18
|
-
futurehouse_client-0.3.20.
|
19
|
-
futurehouse_client-0.3.20.
|
20
|
-
futurehouse_client-0.3.20.
|
16
|
+
futurehouse_client-0.3.20.dev208.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
|
17
|
+
futurehouse_client-0.3.20.dev208.dist-info/METADATA,sha256=JwxHWSPvfSXwCJAtDcPlHhv5YiLOgv8YQT3OKsZbZoY,26805
|
18
|
+
futurehouse_client-0.3.20.dev208.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
19
|
+
futurehouse_client-0.3.20.dev208.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
|
20
|
+
futurehouse_client-0.3.20.dev208.dist-info/RECORD,,
|
{futurehouse_client-0.3.20.dev200.dist-info → futurehouse_client-0.3.20.dev208.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|