futurehouse-client 0.3.14__tar.gz → 0.3.15.dev15__tar.gz

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.
Files changed (25) hide show
  1. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/PKG-INFO +1 -1
  2. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/clients/rest_client.py +6 -1
  3. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/models/app.py +29 -3
  4. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client.egg-info/PKG-INFO +1 -1
  5. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/LICENSE +0 -0
  6. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/README.md +0 -0
  7. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/docs/__init__.py +0 -0
  8. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/docs/client_notebook.ipynb +0 -0
  9. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/__init__.py +0 -0
  10. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/clients/__init__.py +0 -0
  11. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/clients/job_client.py +0 -0
  12. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/models/__init__.py +0 -0
  13. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/models/client.py +0 -0
  14. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/models/rest.py +0 -0
  15. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/utils/__init__.py +0 -0
  16. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/utils/module_utils.py +0 -0
  17. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client/utils/monitoring.py +0 -0
  18. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client.egg-info/SOURCES.txt +0 -0
  19. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client.egg-info/dependency_links.txt +0 -0
  20. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client.egg-info/requires.txt +0 -0
  21. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/futurehouse_client.egg-info/top_level.txt +0 -0
  22. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/pyproject.toml +0 -0
  23. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/setup.cfg +0 -0
  24. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/tests/test_rest.py +0 -0
  25. {futurehouse_client-0.3.14 → futurehouse_client-0.3.15.dev15}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: futurehouse-client
3
- Version: 0.3.14
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
@@ -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": config.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,
@@ -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 validate_agent_path(cls, value: Agent | str) -> Agent | str:
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.14
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