futurehouse-client 0.4.3.dev3__py3-none-any.whl → 0.4.4.dev1__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.
@@ -476,7 +476,7 @@ class ProgressWrapper:
476
476
  return self.file_obj.tell()
477
477
 
478
478
 
479
- class DataStorageMethods: # pylint: disable=too-many-public-methods
479
+ class DataStorageMethods:
480
480
  """Data storage methods for RestClient.
481
481
 
482
482
  This class contains methods for interacting with the data storage API endpoints.
@@ -1638,13 +1638,13 @@ class DataStorageMethods: # pylint: disable=too-many-public-methods
1638
1638
  existing_location = DataStorageLocationPayload(
1639
1639
  storage_type=DataStorageType.LINK,
1640
1640
  content_type=DataContentType.TEXT,
1641
- location=url,
1641
+ location=str(url),
1642
1642
  metadata=link_metadata or None,
1643
1643
  )
1644
1644
 
1645
1645
  payload = DataStorageRequestPayload(
1646
1646
  name=name,
1647
- content=url,
1647
+ content=str(url),
1648
1648
  description=description,
1649
1649
  dataset_id=dataset_id,
1650
1650
  project_id=project_id,
@@ -1697,13 +1697,13 @@ class DataStorageMethods: # pylint: disable=too-many-public-methods
1697
1697
  existing_location = DataStorageLocationPayload(
1698
1698
  storage_type=DataStorageType.LINK,
1699
1699
  content_type=DataContentType.TEXT,
1700
- location=url,
1700
+ location=str(url),
1701
1701
  metadata=link_metadata or None,
1702
1702
  )
1703
1703
 
1704
1704
  payload = DataStorageRequestPayload(
1705
1705
  name=name,
1706
- content=url,
1706
+ content=str(url),
1707
1707
  description=description,
1708
1708
  dataset_id=dataset_id,
1709
1709
  project_id=project_id,
@@ -2552,6 +2552,70 @@ class DataStorageMethods: # pylint: disable=too-many-public-methods
2552
2552
  except Exception as e:
2553
2553
  raise DataStorageError(f"An unexpected error occurred: {e!r}") from e
2554
2554
 
2555
+ @retry(
2556
+ stop=stop_after_attempt(3),
2557
+ wait=wait_exponential(multiplier=1, max=10),
2558
+ retry=retry_if_connection_error,
2559
+ before_sleep=before_sleep_log(logger, logging.WARNING),
2560
+ )
2561
+ def get_data_storage_entry(self, data_storage_id: UUID) -> DataStorageResponse:
2562
+ """Get a data storage entry with all details including storage locations and metadata.
2563
+
2564
+ Args:
2565
+ data_storage_id: ID of the data storage entry to retrieve
2566
+
2567
+ Returns:
2568
+ DataStorageResponse with entry details and storage locations
2569
+
2570
+ Raises:
2571
+ DataStorageRetrievalError: If there's an error retrieving the entry
2572
+ """
2573
+ try:
2574
+ response = self.client.get(
2575
+ f"/v0.1/data-storage/data-entries/{data_storage_id}", timeout=100
2576
+ )
2577
+ response.raise_for_status()
2578
+ return DataStorageResponse.model_validate(response.json())
2579
+ except HTTPStatusError as e:
2580
+ self._handle_http_errors(e, "retrieving")
2581
+ except Exception as e:
2582
+ raise DataStorageRetrievalError(
2583
+ f"An unexpected error occurred: {e!r}"
2584
+ ) from e
2585
+
2586
+ @retry(
2587
+ stop=stop_after_attempt(3),
2588
+ wait=wait_exponential(multiplier=1, max=10),
2589
+ retry=retry_if_connection_error,
2590
+ before_sleep=before_sleep_log(logger, logging.WARNING),
2591
+ )
2592
+ async def aget_data_storage_entry(
2593
+ self, data_storage_id: UUID
2594
+ ) -> DataStorageResponse:
2595
+ """Get a data storage entry with all details including storage locations and metadata.
2596
+
2597
+ Args:
2598
+ data_storage_id: ID of the data storage entry to retrieve
2599
+
2600
+ Returns:
2601
+ DataStorageResponse with entry details and storage locations
2602
+
2603
+ Raises:
2604
+ DataStorageRetrievalError: If there's an error retrieving the entry
2605
+ """
2606
+ try:
2607
+ response = await self.async_client.get(
2608
+ f"/v0.1/data-storage/data-entries/{data_storage_id}", timeout=100
2609
+ )
2610
+ response.raise_for_status()
2611
+ return DataStorageResponse.model_validate(response.json())
2612
+ except HTTPStatusError as e:
2613
+ self._handle_http_errors(e, "retrieving")
2614
+ except Exception as e:
2615
+ raise DataStorageRetrievalError(
2616
+ f"An unexpected error occurred: {e!r}"
2617
+ ) from e
2618
+
2555
2619
  @retry(
2556
2620
  stop=stop_after_attempt(3),
2557
2621
  wait=wait_exponential(multiplier=1, max=10),
@@ -165,7 +165,6 @@ retry_if_connection_error = create_retry_if_connection_error(FileUploadError)
165
165
  DEFAULT_AGENT_TIMEOUT: int = 2400 # seconds
166
166
 
167
167
 
168
- # pylint: disable=too-many-public-methods
169
168
  class RestClient(DataStorageMethods):
170
169
  REQUEST_TIMEOUT: ClassVar[float] = 30.0 # sec - for general API calls
171
170
  FILE_UPLOAD_TIMEOUT: ClassVar[float] = 600.0 # 10 minutes - for file uploads
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.4.3.dev3'
32
- __version_tuple__ = version_tuple = (0, 4, 3, 'dev3')
31
+ __version__ = version = '0.4.4.dev1'
32
+ __version_tuple__ = version_tuple = (0, 4, 4, 'dev1')
33
33
 
34
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.3.dev3
3
+ Version: 0.4.4.dev1
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
@@ -216,7 +216,7 @@ License-File: LICENSE
216
216
  Requires-Dist: aiofiles
217
217
  Requires-Dist: cloudpickle
218
218
  Requires-Dist: fhaviary
219
- Requires-Dist: google-resumable-media[aiohttp]
219
+ Requires-Dist: google-resumable-media
220
220
  Requires-Dist: httpx
221
221
  Requires-Dist: ldp>=0.22.0
222
222
  Requires-Dist: litellm
@@ -1,10 +1,10 @@
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=_c6r7-3ldIKHE25bQ2mtbV5_BGB4bVAIxsyhTiprV-g,717
3
+ futurehouse_client/version.py,sha256=BxZgBdyE0uyvHuv-VdQ1w9gsFCUVeItMk8dKQsNmNs0,717
4
4
  futurehouse_client/clients/__init__.py,sha256=-HXNj-XJ3LRO5XM6MZ709iPs29YpApss0Q2YYg1qMZw,280
5
- futurehouse_client/clients/data_storage_methods.py,sha256=NBbJIUF3vWc7bRYhapELegpnAlB4R38mZsSDs7Y2-Tc,97165
5
+ futurehouse_client/clients/data_storage_methods.py,sha256=VESdX0J_frITd0QAjQ5UMPiqYvpToo0ooDCrS-U4uH8,99535
6
6
  futurehouse_client/clients/job_client.py,sha256=b5gpzulZpxpv9R337r3UKItnMdtd6CGlI1sV3_VQJso,13985
7
- futurehouse_client/clients/rest_client.py,sha256=Ng36P8obNW1WTRYWTqLQ0ka5tefT-r723_Kr0haT9aM,103225
7
+ futurehouse_client/clients/rest_client.py,sha256=RdyFEipvADDCHyY5XFy565IoL9-N1myJjF0G8x2wlK8,103183
8
8
  futurehouse_client/models/__init__.py,sha256=0YlzKGymbY1g4cXxnUc0BUnthTkVBf12bCZlGUcMQqk,701
9
9
  futurehouse_client/models/app.py,sha256=UUg17I3zk6cH_7mrdojHGYvQfm_SeDkuUxsPlRyIYz0,31895
10
10
  futurehouse_client/models/client.py,sha256=n4HD0KStKLm6Ek9nL9ylP-bkK10yzAaD1uIDF83Qp_A,1828
@@ -16,8 +16,8 @@ futurehouse_client/utils/general.py,sha256=PIkGLCSA3kUvc6mwR-prEB7YnMdKILOIm6cPo
16
16
  futurehouse_client/utils/module_utils.py,sha256=aFyd-X-pDARXz9GWpn8SSViUVYdSbuy9vSkrzcVIaGI,4955
17
17
  futurehouse_client/utils/monitoring.py,sha256=UjRlufe67kI3VxRHOd5fLtJmlCbVA2Wqwpd4uZhXkQM,8728
18
18
  futurehouse_client/utils/world_model_tools.py,sha256=v2krZGrco0ur2a_pcRMtnQL05SxlIoBXuJ5R1JkQNws,2921
19
- futurehouse_client-0.4.3.dev3.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
20
- futurehouse_client-0.4.3.dev3.dist-info/METADATA,sha256=0GVESlronhQMiFUHqhgZcRw9dkmIGPdkJA7m8NY_u7E,27068
21
- futurehouse_client-0.4.3.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- futurehouse_client-0.4.3.dev3.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
23
- futurehouse_client-0.4.3.dev3.dist-info/RECORD,,
19
+ futurehouse_client-0.4.4.dev1.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
20
+ futurehouse_client-0.4.4.dev1.dist-info/METADATA,sha256=ez62zZde6VSXTSkCJgP_L6JPZ3LUvzVOxZN0FI-soLk,27059
21
+ futurehouse_client-0.4.4.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ futurehouse_client-0.4.4.dev1.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
23
+ futurehouse_client-0.4.4.dev1.dist-info/RECORD,,