futurehouse-client 0.0.4__py3-none-any.whl → 0.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: futurehouse-client
3
- Version: 0.0.4
3
+ Version: 0.0.5
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
@@ -38,101 +38,76 @@ Requires-Dist: setuptools_scm; extra == "dev"
38
38
 
39
39
  # FutureHouse Platform API Documentation
40
40
 
41
- Documentation and tutorials for crow-client, a client for interacting with endpoints of the FutureHouse crow service.
42
-
43
- > FutureHouse's mascot is the crow. Therefore, some objects are named after the crow as a homage.
41
+ Documentation and tutorials for futurehouse-client, a client for interacting with endpoints of the FutureHouse platform.
44
42
 
45
43
  <!--TOC-->
46
44
 
47
45
  - [Installation](#installation)
48
46
  - [Quickstart](#quickstart)
49
47
  - [Functionalities](#functionalities)
50
- - [Stages](#stages)
51
48
  - [Authentication](#authentication)
52
- - [Job submission](#job-submission)
53
- - [Job Continuation](#job-continuation)
54
- - [Job retrieval](#job-retrieval)
49
+ - [Task submission](#task-submission)
50
+ - [Task Continuation](#task-continuation)
51
+ - [Task retrieval](#task-retrieval)
55
52
 
56
53
  <!--TOC-->
57
54
 
58
55
  ## Installation
59
56
 
60
57
  ```bash
61
- uv pip install crow-client
58
+ uv pip install futurehouse-client
62
59
  ```
63
60
 
64
61
  ## Quickstart
65
62
 
66
63
  ```python
67
- from crow_client import CrowClient, JobNames
64
+ from futurehouse_client import FutureHouseClient, JobNames
68
65
  from pathlib import Path
69
66
  from aviary.core import DummyEnv
70
67
  import ldp
71
68
 
72
- client = CrowClient(
73
- stage=Stage.PROD,
74
- auth_type=AuthType.API_KEY,
69
+ client = FutureHouseClient(
75
70
  api_key="your_api_key",
76
71
  )
77
72
 
78
- job_data = {
73
+ task_data = {
79
74
  "name": JobNames.CROW,
80
- "query": "Has anyone tested therapeutic exerkines in humans or NHPs?",
75
+ "query": "Which neglected diseases had a treatment developed by artificial intelligence?",
81
76
  }
82
77
 
83
- job_run_id = client.create_job(job_data)
78
+ task_run_id = client.create_task(task_data)
84
79
 
85
- job_status = client.get_job(job_run_id)
80
+ task_status = client.get_task(task_run_id)
86
81
  ```
87
82
 
88
- A quickstart example can be found in the [crow_client_notebook.ipynb](./docs/crow_client_notebook.ipynb) 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.
83
+ A quickstart example can be found in the [client_notebook.ipynb](https://github.com/Future-House/futurehouse-client-docs/blob/main/docs/client_notebook.ipynb) 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.
89
84
 
90
85
  ## Functionalities
91
86
 
92
- Crow-client implements a RestClient (called `CrowClient`) with the following functionalities:
87
+ FutureHouse client implements a RestClient (called `FutureHouseClient`) with the following functionalities:
93
88
 
94
- - [Authentication](#authtype): `auth_client`
95
- - [Job submission](#job-submission): `create_job(JobRequest)`
96
- - [Job status](#job-status): `get_job(job_id)`
97
-
98
- To create a `CrowClient`, you need to pass the following parameters:
99
- | Parameter | Type | Default | Description |
100
- | --- | --- | --- | --- |
101
- | stage | Stage | Stage.DEV | Where the job will be submitted? |
102
- | organization | str \| None | None | Which organization to use? |
103
- | auth_type | AuthType | AuthType.API_KEY | Which authentication method to use? |
104
- | api_key | str \| None | None | The API key to use for authentication, if using auth_type=AuthType.API_KEY. |
89
+ - [Task submission](#task-submission): `create_task(TaskRequest)`
90
+ - [Task status](#task-status): `get_task(task_id)`
105
91
 
106
- To instantiate a Client, we can use the following code:
92
+ To create a `FutureHouseClient`, you need to pass an FutureHouse platform api key (see [Authentication](#authentication)):
107
93
 
108
94
  ```python
109
- from crow_client import CrowClient
110
- from crow_client.models import Stage, AuthType
95
+ from futurehouse_client import FutureHouseClient
111
96
 
112
- client = CrowClient(
113
- stage=Stage.PROD,
114
- organization="your_organization",
115
- auth_type=AuthType.API_KEY,
97
+ client = FutureHouseClient(
116
98
  api_key="your_api_key",
117
99
  )
118
100
  ```
119
101
 
120
- ### Stages
121
-
122
- The stage is where your job will be submitted. This parameter can be one of the following:
123
- | Name | Description |
124
- | --- | --- |
125
- | Stage.DEV | Development environment at https://dev.api.platform.futurehouse.org |
126
- | Stage.PROD | Production environment at https://api.platform.futurehouse.org |
127
-
128
102
  ## Authentication
129
103
 
130
- In order to use the `CrowClient`, you need to authenticate yourself. Authentication is done by providing an API key, which can be obtained directly from your [profile page in the FutureHouse platform](https://platform.futurehouse.org/profile).
104
+ In order to use the `FutureHouseClient`, you need to authenticate yourself. Authentication is done by providing an API key, which can be obtained directly from your [profile page in the FutureHouse platform](https://platform.futurehouse.org/profile).
131
105
 
132
- ## Job submission
106
+ ## Task submission
133
107
 
134
- `CrowClient` can be used to submit jobs to the FutureHouse platform. Using a `CrowClient` instance, you can submit jobs to the platform by calling the `create_job` method, which receives a `JobRequest` (or a dictionary with `kwargs`) and returns the job id.
135
- Aiming to make the submission of jobs as simple as possible, we have created a `JobNames` enum that contains the available job types.
108
+ In the futurehouse platform, we define the deployed combination of an agent and an environment as a `job`. To invoke a job, we need to submit a `task` (also called a `query`) to it.
109
+ `FutureHouseClient` can be used to submit tasks/queries to available jobs in the FutureHouse platform. Using a `FutureHouseClient` instance, you can submit tasks to the platform by calling the `create_task` method, which receives a `TaskRequest` (or a dictionary with `kwargs`) and returns the task id.
110
+ Aiming to make the submission of tasks as simple as possible, we have created a `JobNames` `enum` that contains the available task types.
136
111
 
137
112
  The available supported jobs are:
138
113
  | Alias | Job Name | Task type | Description |
@@ -143,27 +118,24 @@ The available supported jobs are:
143
118
  | `JobNames.DUMMY` | `job-futurehouse-dummy` | Dummy Task | This is a dummy task. Mainly for testing purposes. |
144
119
 
145
120
  Using `JobNames`, the client automatically adapts the job name to the current stage.
146
- The job submission looks like this:
121
+ The task submission looks like this:
147
122
 
148
123
  ```python
149
- from crow_client import CrowClient, JobNames
150
- from crow_client.models import AuthType, Stage
124
+ from futurehouse_client import FutureHouseClient, JobNames
151
125
 
152
- client = CrowClient(
153
- stage=Stage.PROD,
154
- auth_type=AuthType.API_KEY,
126
+ client = FutureHouseClient(
155
127
  api_key="your_api_key",
156
128
  )
157
129
 
158
- job_data = {
159
- "name": JobNames.CROW,
130
+ task_data = {
131
+ "name": JobNames.OWL,
160
132
  "query": "Has anyone tested therapeutic exerkines in humans or NHPs?",
161
133
  }
162
134
 
163
- job_id = client.create_job(job_data)
135
+ task_id = client.create_task(task_data)
164
136
  ```
165
137
 
166
- `JobRequest` has the following fields:
138
+ `TaskRequest` has the following fields:
167
139
 
168
140
  | Field | Type | Description |
169
141
  | -------------- | ------------- | ------------------------------------------------------------------------------------------------------------------- |
@@ -175,51 +147,46 @@ job_id = client.create_job(job_data)
175
147
  `runtime_config` can receive a `AgentConfig` object with the desired kwargs. Check the available `AgentConfig` fields in the [LDP documentation](https://github.com/Future-House/ldp/blob/main/src/ldp/agent/agent.py#L87). Besides the `AgentConfig` object, we can also pass `timeout` and `max_steps` to limit the execution time and the number of steps the agent can take.
176
148
  Other especialised configurations are also available but are outside the scope of this documentation.
177
149
 
178
- ## Job Continuation
150
+ ## Task Continuation
179
151
 
180
- Once a job is submitted and the answer is returned, FutureHouse platform allow you to ask follow-up questions to the previous job.
152
+ Once a task is submitted and the answer is returned, FutureHouse platform allow you to ask follow-up questions to the previous task.
181
153
  It is also possible through the platform API.
182
- To accomplish that, we can use the `runtime_config` we discussed in the [Job submission](#job-submission) section.
154
+ To accomplish that, we can use the `runtime_config` we discussed in the [Task submission](#task-submission) section.
183
155
 
184
156
  ```python
185
- from crow_client import CrowClient, JobNames
186
- from crow_client.models import AuthType, Stage
157
+ from futurehouse_client import FutureHouseClient, JobNames
187
158
 
188
- client = CrowClient(
189
- stage=Stage.PROD,
190
- auth_type=AuthType.API_KEY,
159
+ client = FutureHouseClient(
191
160
  api_key="your_api_key",
192
161
  )
193
162
 
194
- job_data = {"name": JobNames.CROW, "query": "How many species of birds are there?"}
163
+ task_data = {"name": JobNames.CROW, "query": "How many species of birds are there?"}
195
164
 
196
- job_id = client.create_job(job_data)
165
+ task_id = client.create_task(task_data)
197
166
 
198
- continued_job_data = {
167
+ continued_task_data = {
199
168
  "name": JobNames.CROW,
200
169
  "query": "From the previous answer, specifically,how many species of crows are there?",
201
- "runtime_config": {"continued_job_id": job_id},
170
+ "runtime_config": {"continued_task_id": task_id},
202
171
  }
203
172
 
204
- continued_job_id = client.create_job(continued_job_data)
173
+ continued_task_id = client.create_task(continued_task_data)
205
174
  ```
206
175
 
207
- ## Job retrieval
176
+ ## Task retrieval
208
177
 
209
- Once a job is submitted, you can retrieve it by calling the `get_job` method, which receives a job id and returns a `JobResponse` object.
178
+ Once a task is submitted, you can retrieve it by calling the `get_task` method, which receives a task id and returns a `TaskResponse` object.
210
179
 
211
180
  ```python
212
- from crow_client import CrowClient
213
- from crow_client.models import AuthType
181
+ from futurehouse_client import FutureHouseClient
214
182
 
215
- client = CrowClient(
216
- auth_type=AuthType.API_KEY,
183
+ client = FutureHouseClient(
217
184
  api_key="your_api_key",
218
185
  )
219
186
 
220
- job_id = "job_id"
187
+ task_id = "task_id"
221
188
 
222
- job_status = client.get_job(job_id)
189
+ task_status = client.get_task(task_id)
223
190
  ```
224
191
 
225
- `job_status` contains information about the job. For instance, its `status`, `task`, `environment_name` and `agent_name`, and other fields specific to the job.
192
+ `task_status` contains information about the task. For instance, its `status`, `task`, `environment_name` and `agent_name`, and other fields specific to the job.
@@ -8,7 +8,7 @@ futurehouse_client/models/client.py,sha256=n4HD0KStKLm6Ek9nL9ylP-bkK10yzAaD1uIDF
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
- futurehouse_client-0.0.4.dist-info/METADATA,sha256=mb918ca4LdaKsctNjrzswLkfq-NAfD0s6CmjWqyvo3I,8898
12
- futurehouse_client-0.0.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
- futurehouse_client-0.0.4.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
14
- futurehouse_client-0.0.4.dist-info/RECORD,,
11
+ futurehouse_client-0.0.5.dist-info/METADATA,sha256=2OxntdouInoOXVuPlmVmKkIwZ7g4E_rilBDZ0HCkobU,8056
12
+ futurehouse_client-0.0.5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
+ futurehouse_client-0.0.5.dist-info/top_level.txt,sha256=TRuLUCt_qBnggdFHCX4O_BoCu1j2X43lKfIZC-ElwWY,19
14
+ futurehouse_client-0.0.5.dist-info/RECORD,,