futurehouse-client 0.3.14__py3-none-any.whl → 0.3.15.dev15__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 +6 -1
- futurehouse_client/models/app.py +29 -3
- {futurehouse_client-0.3.14.dist-info → futurehouse_client-0.3.15.dev15.dist-info}/METADATA +1 -1
- {futurehouse_client-0.3.14.dist-info → futurehouse_client-0.3.15.dev15.dist-info}/RECORD +6 -6
- {futurehouse_client-0.3.14.dist-info → futurehouse_client-0.3.15.dev15.dist-info}/WHEEL +0 -0
- {futurehouse_client-0.3.14.dist-info → futurehouse_client-0.3.15.dev15.dist-info}/top_level.txt +0 -0
@@ -26,6 +26,7 @@ from httpx import (
|
|
26
26
|
ReadTimeout,
|
27
27
|
RemoteProtocolError,
|
28
28
|
)
|
29
|
+
from ldp.agent import AgentConfig
|
29
30
|
from pydantic import BaseModel, ConfigDict, model_validator
|
30
31
|
from requests.exceptions import RequestException, Timeout
|
31
32
|
from tenacity import (
|
@@ -575,7 +576,11 @@ class RestClient:
|
|
575
576
|
)
|
576
577
|
logger.debug(f"Sending files: {[f[1][0] for f in files]}")
|
577
578
|
data = {
|
578
|
-
"agent":
|
579
|
+
"agent": (
|
580
|
+
config.agent.model_dump_json()
|
581
|
+
if isinstance(config.agent, AgentConfig)
|
582
|
+
else config.agent
|
583
|
+
),
|
579
584
|
"job_name": config.job_name,
|
580
585
|
"organization": selected_org,
|
581
586
|
"environment": config.environment,
|
futurehouse_client/models/app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import json
|
1
2
|
import os
|
2
3
|
import re
|
3
4
|
from enum import StrEnum, auto
|
@@ -401,10 +402,10 @@ class JobDeploymentConfig(BaseModel):
|
|
401
402
|
description="The python version your docker image should build with.",
|
402
403
|
)
|
403
404
|
|
404
|
-
agent: Agent | str = Field(
|
405
|
+
agent: Agent | AgentConfig | str = Field(
|
405
406
|
default="ldp.agent.SimpleAgent",
|
406
407
|
description="Your desired agent path, should be a module reference and a fully qualified name. "
|
407
|
-
"example: ldp.agent.SimpleAgent",
|
408
|
+
"example: ldp.agent.SimpleAgent or by instantiating AgentConfig to further customize the agent.",
|
408
409
|
)
|
409
410
|
|
410
411
|
requires_aviary_internal: bool = Field(
|
@@ -531,7 +532,12 @@ class JobDeploymentConfig(BaseModel):
|
|
531
532
|
|
532
533
|
@field_validator("agent")
|
533
534
|
@classmethod
|
534
|
-
def
|
535
|
+
def validate_agent(
|
536
|
+
cls, value: str | Agent | AgentConfig
|
537
|
+
) -> str | Agent | AgentConfig:
|
538
|
+
if isinstance(value, AgentConfig):
|
539
|
+
return value
|
540
|
+
|
535
541
|
if isinstance(value, Agent):
|
536
542
|
return value
|
537
543
|
|
@@ -584,6 +590,13 @@ class RuntimeConfig(BaseModel):
|
|
584
590
|
"agent selected during Crow deployment in the JobDeploymentConfig object."
|
585
591
|
),
|
586
592
|
)
|
593
|
+
environment_config: dict[str, Any] | None = Field(
|
594
|
+
default=None,
|
595
|
+
description=(
|
596
|
+
"Kwargs to be passed to the environment constructor at runtime. "
|
597
|
+
"Not all environments support this functionality."
|
598
|
+
),
|
599
|
+
)
|
587
600
|
continued_job_id: UUID | None = Field(
|
588
601
|
default=None,
|
589
602
|
description="Optional job identifier for a continued job",
|
@@ -606,6 +619,19 @@ class RuntimeConfig(BaseModel):
|
|
606
619
|
raise ValueError(f"Invalid agent path format: {value}")
|
607
620
|
return value
|
608
621
|
|
622
|
+
@field_validator("environment_config")
|
623
|
+
@classmethod
|
624
|
+
def validate_environment_config(
|
625
|
+
cls, value: dict[str, Any] | None
|
626
|
+
) -> dict[str, Any] | None:
|
627
|
+
if value is None:
|
628
|
+
return None
|
629
|
+
try:
|
630
|
+
json.dumps(value)
|
631
|
+
except (TypeError, OverflowError) as err:
|
632
|
+
raise ValueError("Environment config must be JSON serializable") from err
|
633
|
+
return value
|
634
|
+
|
609
635
|
|
610
636
|
class TaskRequest(BaseModel):
|
611
637
|
task_id: UUID | None = Field(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: futurehouse-client
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.15.dev15
|
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
|
Classifier: Operating System :: OS Independent
|
@@ -1,15 +1,15 @@
|
|
1
1
|
futurehouse_client/__init__.py,sha256=ddxO7JE97c6bt7LjNglZZ2Ql8bYCGI9laSFeh9MP6VU,344
|
2
2
|
futurehouse_client/clients/__init__.py,sha256=tFWqwIAY5PvwfOVsCje4imjTpf6xXNRMh_UHIKVI1_0,320
|
3
3
|
futurehouse_client/clients/job_client.py,sha256=yBFKDNcFnuZDNgoK2d5037rbuzQ7TlSK6MmklEKV8EA,11056
|
4
|
-
futurehouse_client/clients/rest_client.py,sha256=
|
4
|
+
futurehouse_client/clients/rest_client.py,sha256=dJCVIC3kya32aiopgbbxWASIQeLdSx_N7I3Qx1ojaZM,26152
|
5
5
|
futurehouse_client/models/__init__.py,sha256=ta3jFLM_LsDz1rKDmx8rja8sT7WtSKoFvMgLF0yFpvA,342
|
6
|
-
futurehouse_client/models/app.py,sha256=
|
6
|
+
futurehouse_client/models/app.py,sha256=yfZ9tyw4VATVAfYrU7aTdCNPSljLEho09_nIbh8oZDY,23174
|
7
7
|
futurehouse_client/models/client.py,sha256=n4HD0KStKLm6Ek9nL9ylP-bkK10yzAaD1uIDF83Qp_A,1828
|
8
8
|
futurehouse_client/models/rest.py,sha256=W-wNFTN7HALYFFphw-RQYRMm6_TSa1cl4T-mZ1msk90,393
|
9
9
|
futurehouse_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
futurehouse_client/utils/module_utils.py,sha256=aFyd-X-pDARXz9GWpn8SSViUVYdSbuy9vSkrzcVIaGI,4955
|
11
11
|
futurehouse_client/utils/monitoring.py,sha256=UjRlufe67kI3VxRHOd5fLtJmlCbVA2Wqwpd4uZhXkQM,8728
|
12
|
-
futurehouse_client-0.3.
|
13
|
-
futurehouse_client-0.3.
|
14
|
-
futurehouse_client-0.3.
|
15
|
-
futurehouse_client-0.3.
|
12
|
+
futurehouse_client-0.3.15.dev15.dist-info/METADATA,sha256=exsvwQgSFOReYW5xOUAl1eOVIuyl2aQ77Fb9wKtGaCE,8144
|
13
|
+
futurehouse_client-0.3.15.dev15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
14
|
+
futurehouse_client-0.3.15.dev15.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
|
15
|
+
futurehouse_client-0.3.15.dev15.dist-info/RECORD,,
|
File without changes
|
{futurehouse_client-0.3.14.dist-info → futurehouse_client-0.3.15.dev15.dist-info}/top_level.txt
RENAMED
File without changes
|