futurehouse-client 0.3.20.dev55__py3-none-any.whl → 0.3.20.dev63__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.
@@ -169,7 +169,7 @@ class RestClient:
169
169
  self.base_url = service_uri or stage.value
170
170
  self.stage = stage
171
171
  self.auth_type = auth_type
172
- self.api_key = api_key
172
+ self.api_key = api_key or os.environ.get("FUTUREHOUSE_API_KEY")
173
173
  self._clients: dict[str, Client | AsyncClient] = {}
174
174
  self.headers = headers or {}
175
175
  self.jwt = jwt
@@ -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.dev55'
21
- __version_tuple__ = version_tuple = (0, 3, 20, 'dev55')
20
+ __version__ = version = '0.3.20.dev63'
21
+ __version_tuple__ = version_tuple = (0, 3, 20, 'dev63')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: futurehouse-client
3
- Version: 0.3.20.dev55
3
+ Version: 0.3.20.dev63
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
@@ -274,20 +274,19 @@ uv pip install futurehouse-client
274
274
 
275
275
  ```python
276
276
  from futurehouse_client import FutureHouseClient, JobNames
277
- from pathlib import Path
278
- from aviary.core import DummyEnv
279
- import ldp
280
277
 
281
- client = FutureHouseClient(
282
- api_key="your_api_key",
283
- )
278
+ # Set your API key to FUTUREHOUSE_API_KEY environment variable,
279
+ # or pass it as a string literal to the api_key parameter
280
+ client = FutureHouseClient()
284
281
 
285
282
  task_data = {
286
283
  "name": JobNames.CROW,
287
- "query": "Which neglected diseases had a treatment developed by artificial intelligence?",
284
+ "query": (
285
+ "Which neglected diseases had a treatment developed"
286
+ " by artificial intelligence?"
287
+ ),
288
288
  }
289
-
290
- task_response = client.run_tasks_until_done(task_data)
289
+ (task_response,) = client.run_tasks_until_done(task_data)
291
290
  ```
292
291
 
293
292
  A quickstart example can be found in the [client_notebook.ipynb](https://futurehouse.gitbook.io/futurehouse-cookbook/futurehouse-client/docs/client_notebook) file, where we show how to submit and retrieve a job task, pass runtime configuration to the agent, and ask follow-up questions to the previous job.
@@ -304,9 +303,10 @@ To create a `FutureHouseClient`, you need to pass an FutureHouse platform api ke
304
303
  ```python
305
304
  from futurehouse_client import FutureHouseClient
306
305
 
307
- client = FutureHouseClient(
308
- api_key="your_api_key",
309
- )
306
+ # Set your API key to FUTUREHOUSE_API_KEY environment variable
307
+ client = FutureHouseClient()
308
+ # Or pass it as a string literal to the api_key parameter
309
+ client = FutureHouseClient(api_key="your_api_key")
310
310
  ```
311
311
 
312
312
  ## Authentication
@@ -333,17 +333,13 @@ Using `JobNames`, the task submission looks like this:
333
333
  ```python
334
334
  from futurehouse_client import FutureHouseClient, JobNames
335
335
 
336
- client = FutureHouseClient(
337
- api_key="your_api_key",
338
- )
336
+ client = FutureHouseClient()
339
337
 
340
338
  task_data = {
341
339
  "name": JobNames.OWL,
342
340
  "query": "Has anyone tested therapeutic exerkines in humans or NHPs?",
343
341
  }
344
-
345
- task_response = client.run_tasks_until_done(task_data)
346
-
342
+ (task_response,) = client.run_tasks_until_done(task_data)
347
343
  print(task_response.answer)
348
344
  ```
349
345
 
@@ -363,8 +359,7 @@ async def main():
363
359
  "name": JobNames.OWL,
364
360
  "query": "Has anyone tested therapeutic exerkines in humans or NHPs?",
365
361
  }
366
-
367
- task_response = await client.arun_tasks_until_done(task_data)
362
+ (task_response,) = await client.arun_tasks_until_done(task_data)
368
363
  print(task_response.answer)
369
364
  return task_id
370
365
 
@@ -382,9 +377,7 @@ from futurehouse_client import FutureHouseClient, JobNames
382
377
 
383
378
 
384
379
  async def main():
385
- client = FutureHouseClient(
386
- api_key="your_api_key",
387
- )
380
+ client = FutureHouseClient()
388
381
 
389
382
  task_data = [
390
383
  {
@@ -393,10 +386,12 @@ async def main():
393
386
  },
394
387
  {
395
388
  "name": JobNames.CROW,
396
- "query": "Are there any clinically validated therapeutic exerkines for humans?",
389
+ "query": (
390
+ "Are there any clinically validated"
391
+ " therapeutic exerkines for humans?"
392
+ ),
397
393
  },
398
394
  ]
399
-
400
395
  task_responses = await client.arun_tasks_until_done(task_data)
401
396
  print(task_responses[0].answer)
402
397
  print(task_responses[1].answer)
@@ -423,17 +418,14 @@ if __name__ == "__main__":
423
418
  from futurehouse_client import FutureHouseClient, JobNames
424
419
  from futurehouse_client.models.app import TaskRequest
425
420
 
426
- client = FutureHouseClient(
427
- api_key="your_api_key",
428
- )
421
+ client = FutureHouseClient()
429
422
 
430
- task_response = client.run_tasks_until_done(
423
+ (task_response,) = client.run_tasks_until_done(
431
424
  TaskRequest(
432
425
  name=JobNames.OWL,
433
426
  query="Has anyone tested therapeutic exerkines in humans or NHPs?",
434
427
  )
435
428
  )
436
-
437
429
  print(task_response.answer)
438
430
  ```
439
431
 
@@ -455,14 +447,13 @@ client = FutureHouseClient(
455
447
  api_key="your_api_key",
456
448
  )
457
449
 
458
- task_response = client.run_tasks_until_done(
450
+ (task_response,) = client.run_tasks_until_done(
459
451
  TaskRequest(
460
452
  name=JobNames.OWL,
461
453
  query="Has anyone tested therapeutic exerkines in humans or NHPs?",
462
454
  ),
463
455
  verbose=True,
464
456
  )
465
-
466
457
  print(task_response.environment_frame)
467
458
  ```
468
459
 
@@ -487,17 +478,21 @@ client = FutureHouseClient(
487
478
  api_key="your_api_key",
488
479
  )
489
480
 
490
- task_data = {"name": JobNames.CROW, "query": "How many species of birds are there?"}
491
-
481
+ task_data = {
482
+ "name": JobNames.CROW,
483
+ "query": "How many species of birds are there?",
484
+ }
492
485
  task_id = client.create_task(task_data)
493
486
 
494
487
  continued_task_data = {
495
488
  "name": JobNames.CROW,
496
- "query": "From the previous answer, specifically,how many species of crows are there?",
489
+ "query": (
490
+ "From the previous answer,"
491
+ " specifically, how many species of crows are there?"
492
+ ),
497
493
  "runtime_config": {"continued_task_id": task_id},
498
494
  }
499
-
500
- task_result = client.run_tasks_until_done(continued_task_data)
495
+ (task_response,) = client.run_tasks_until_done(continued_task_data)
501
496
  ```
502
497
 
503
498
  ## Asynchronous tasks
@@ -505,14 +500,14 @@ task_result = client.run_tasks_until_done(continued_task_data)
505
500
  Sometimes you may want to submit many jobs, while querying results at a later time. In this way you can do other things while waiting for a response. The platform API supports this as well rather than waiting for a result.
506
501
 
507
502
  ```python
508
- from futurehouse_client import FutureHouseClient
509
-
510
- client = FutureHouseClient(
511
- api_key="your_api_key",
512
- )
503
+ from futurehouse_client import FutureHouseClient, JobNames
513
504
 
514
- task_data = {"name": JobNames.CROW, "query": "How many species of birds are there?"}
505
+ client = FutureHouseClient()
515
506
 
507
+ task_data = {
508
+ "name": JobNames.CROW,
509
+ "query": "How many species of birds are there?",
510
+ }
516
511
  task_id = client.create_task(task_data)
517
512
 
518
513
  # move on to do other things
@@ -1,9 +1,9 @@
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=R0N9IlSoJfca-REsgOruf0uQwzcxQP-poQaa9iM3N3g,528
3
+ futurehouse_client/version.py,sha256=isTppsUF5LzE3BUYjhyccnSnZwGsbVa_dNrIiEiEViQ,528
4
4
  futurehouse_client/clients/__init__.py,sha256=-HXNj-XJ3LRO5XM6MZ709iPs29YpApss0Q2YYg1qMZw,280
5
5
  futurehouse_client/clients/job_client.py,sha256=JgB5IUAyCmnhGRsYc3bgKldA-lkM1JLwHRwwUeOCdus,11944
6
- futurehouse_client/clients/rest_client.py,sha256=XHHofNT-tOhS-jyLiAloUUnj6AiZh1hF5Fb8SeV6SNE,61513
6
+ futurehouse_client/clients/rest_client.py,sha256=fltCx1kCSZKLD-2QNPmK2PbXPa0q0zW9Q3837xS_6TQ,61554
7
7
  futurehouse_client/models/__init__.py,sha256=5x-f9AoM1hGzJBEHcHAXSt7tPeImST5oZLuMdwp0mXc,554
8
8
  futurehouse_client/models/app.py,sha256=fIWATuetex9GuNzGAWQz-9Dc63ifEFl-Mv-UN7nGSfA,28948
9
9
  futurehouse_client/models/client.py,sha256=n4HD0KStKLm6Ek9nL9ylP-bkK10yzAaD1uIDF83Qp_A,1828
@@ -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.dev55.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
17
- futurehouse_client-0.3.20.dev55.dist-info/METADATA,sha256=3E-5Yu1s0Oo3PFcGHd4gts5HnDyqB2yDL7VRpaOyyGw,25926
18
- futurehouse_client-0.3.20.dev55.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- futurehouse_client-0.3.20.dev55.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
20
- futurehouse_client-0.3.20.dev55.dist-info/RECORD,,
16
+ futurehouse_client-0.3.20.dev63.dist-info/licenses/LICENSE,sha256=oQ9ZHjUi-_6GfP3gs14FlPb0OlGwE1QCCKFGnJ4LD2I,11341
17
+ futurehouse_client-0.3.20.dev63.dist-info/METADATA,sha256=4hmqtHLV-eHTN3l8vXmtIW4L6TFAkBDymbjyg7_rBJQ,26117
18
+ futurehouse_client-0.3.20.dev63.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ futurehouse_client-0.3.20.dev63.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
20
+ futurehouse_client-0.3.20.dev63.dist-info/RECORD,,