### Quickstart EdisonClient Usage Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Initialize EdisonClient with an API key and run a task until completion. This is a basic example for getting started with the client. ```python from edison_client import EdisonClient, JobNames client = EdisonClient( api_key="your_api_key", ) task_data = { "name": JobNames.LITERATURE, "query": "Which neglected diseases had a treatment developed by artificial intelligence?", } task_response = client.run_tasks_until_done(task_data) ``` -------------------------------- ### Install edison-client Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Install the edison-client library using uv pip. ```bash uv pip install edison-client ``` -------------------------------- ### Install edison-client Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Install the edison-client library using pip. This is the only dependency required for the tutorial. ```bash pip install edison-client ``` -------------------------------- ### Creating a Task Source: https://github.com/future-house/edison-client-docs/blob/main/README.md This example shows how to create a task using the `create_task` method, which returns a task ID. This ID can then be used to continue a job. ```APIDOC ## Creating a Task ### Description This method creates a new task and returns its unique identifier. This ID can be used to reference the task for future operations, such as task continuation. ### Method `create_task` ### Parameters #### Request Body - **task_data** (dict) - Required - A dictionary containing the task details. - **name** (str) - Required - Name of the job to execute (e.g., `JobNames.LITERATURE`). - **query** (str) - Required - The query or task to be executed. - **runtime_config** (dict) - Optional - Runtime parameters for the job. - **continued_job_id** (str) - Optional - If provided, this task will continue a previous job. ### Response #### Success Response (str) - **task_id** (str) - The unique identifier for the created task. ### Request Example ```python from edison_client import EdisonClient, JobNames client = EdisonClient(api_key="your_api_key") task_data = {"name": JobNames.LITERATURE, "query": "How many species of birds are there?"} task_id = client.create_task(task_data) ``` ``` -------------------------------- ### Running Tasks Until Done Source: https://github.com/future-house/edison-client-docs/blob/main/README.md This example demonstrates how to run a task using the `run_tasks_until_done` method with a `TaskRequest`. It shows how to specify the job name and query, and how to access the answer from the `TaskResponse`. ```APIDOC ## Running Tasks Until Done ### Description This method runs a task until it is completed and returns the result. It accepts a `TaskRequest` object which defines the job to be executed. ### Method `run_tasks_until_done` ### Parameters #### Request Body - **task_request** (TaskRequest) - Required - An object containing the task details. - **id** (UUID) - Optional - Job identifier. A UUID will be generated if not provided. - **name** (str) - Required - Name of the job to execute (e.g., `JobNames.PRECEDENT`). - **query** (str) - Required - The query or task to be executed. - **runtime_config** (RuntimeConfig) - Optional - Runtime parameters for the job. - **continued_job_id** (str) - Optional - If provided, this task will continue a previous job. - **verbose** (bool) - Optional - If true, more detailed data will be returned. ### Response #### Success Response (TaskResponse) - **answer** (str) - The answer to the query. - **formatted_answer** (str) - The answer formatted with references. - **has_successful_answer** (bool) - Flag indicating if a good answer was found. #### Success Response (TaskResponseVerbose) - **agent_state** (dict) - All agent states during task progress. - **environment_frame** (dict) - All environment data, including contexts and metadata. - **metadata** (dict) - Extra metadata about the query. ### Request Example ```python from edison_client import EdisonClient, JobNames from edison_client.models.app import TaskRequest client = EdisonClient(api_key="your_api_key") task_response = client.run_tasks_until_done( TaskRequest( name=JobNames.PRECEDENT, query="Has anyone tested therapeutic exerkines in humans or NHPs?", ) ) print(task_response.answer) ``` ### Response Example (Success) ```json { "answer": "Yes, therapeutic exerkines have been tested in humans and NHPs.", "formatted_answer": "Yes, therapeutic exerkines have been tested in humans and NHPs. [1]", "has_successful_answer": true } ``` ### Response Example (Verbose) ```json { "agent_state": { ... }, "environment_frame": { ... }, "metadata": { ... } } ``` ``` -------------------------------- ### Task Continuation Source: https://github.com/future-house/edison-client-docs/blob/main/README.md This example illustrates how to continue a previous task by using the `continued_job_id` within the `runtime_config` when submitting a new task request. ```APIDOC ## Task Continuation ### Description Edison platform allows for follow-up questions to a previous task. This is achieved by referencing the previous task's ID within the `runtime_config` of a new task. ### Method `run_tasks_until_done` (with `runtime_config.continued_job_id`) ### Parameters #### Request Body - **task_data** (dict) - Required - A dictionary containing the task details for continuation. - **name** (str) - Required - Name of the job to execute (e.g., `JobNames.LITERATURE`). - **query** (str) - Required - The follow-up query. - **runtime_config** (dict) - Required - Runtime parameters for the job. - **continued_job_id** (str) - Required - The ID of the previous task to continue. ### Response #### Success Response (TaskResponse) - **answer** (str) - Answer to the follow-up query. ### Request Example ```python from edison_client import EdisonClient, JobNames client = EdisonClient(api_key="your_api_key") task_data = {"name": JobNames.LITERATURE, "query": "How many species of birds are there?"} task_id = client.create_task(task_data) continued_task_data = { "name": JobNames.LITERATURE, "query": "From the previous answer, specifically, how many species of crows are there?", "runtime_config": {"continued_job_id": task_id}, } task_result = client.run_tasks_until_done(continued_task_data) ``` ``` -------------------------------- ### Submit Asynchronous Task with Edison Client Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Use this snippet to create a task without waiting for immediate results. Initialize the client with your API key, define task data, create the task to get a task ID, and then you can proceed with other operations before checking the task status. ```python from edison_client import EdisonClient client = EdisonClient( api_key="your_api_key", ) task_data = {"name": JobNames.LITERATURE, "query": "How many species of birds are there?"} task_id = client.create_task(task_data) # move on to do other things task_status = client.get_task(task_id) ``` -------------------------------- ### Continue a previous job Source: https://github.com/future-house/edison-client-docs/blob/main/docs/client_notebook.md Allows asking follow-up questions to a previous job by passing the 'continued_job_id' in the runtime configuration. This example first submits a task and then uses its 'task_id' to continue the conversation. ```python task_data = TaskRequest( name=JobNames.LITERATURE, query="How many species of birds are there?" ) responses = client.run_tasks_until_done(task_data) task_response = responses[0] print(f"First job status: {task_response.status}") print(f"First job answer: \n{task_response.formatted_answer}") ``` ```python continued_job_data = { "name": JobNames.LITERATURE, "query": ( "From the previous answer, specifically, how many species of crows are there?" ), "runtime_config": {"continued_job_id": task_response.task_id}, } responses = client.run_tasks_until_done(continued_job_data) continued_task_response = responses[0] print(f"Continued job status: {continued_task_response.status}") print(f"Continued job answer: \n{continued_task_response.formatted_answer}") ``` -------------------------------- ### Create and Continue a Task Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Demonstrates how to create an initial task and then submit a follow-up question referencing the original task's ID. This allows for conversational interactions. ```python from edison_client import EdisonClient, JobNames client = EdisonClient( api_key="your_api_key", ) task_data = {"name": JobNames.LITERATURE, "query": "How many species of birds are there?"} task_id = client.create_task(task_data) continued_task_data = { "name": JobNames.LITERATURE, "query": "From the previous answer, specifically, how many species of crows are there?", "runtime_config": {"continued_job_id": task_id}, } task_result = client.run_tasks_until_done(continued_task_data) ``` -------------------------------- ### Instantiate Edison Client Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Initialize the EdisonClient with your API key. Ensure you replace the placeholder with your actual API key. ```python # Instantiate the Edison client with your API key created via the platform EDISON_API_KEY = "" # Add your API key here client = EdisonClient(api_key=EDISON_API_KEY) ``` -------------------------------- ### Initialize EdisonClient Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Instantiate the EdisonClient by providing your Edison Scientific platform API key. This client is used for all interactions with the platform. ```python from edison_client import EdisonClient client = EdisonClient( api_key="your_api_key", ) ``` -------------------------------- ### EdisonClient Initialization Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Instantiate the EdisonClient by providing your API key. This client is used to interact with the Edison Scientific platform. ```APIDOC ## EdisonClient Initialization ### Description To create an `EdisonClient`, you need to pass an Edison Scientific platform api key. ### Code ```python from edison_client import EdisonClient client = EdisonClient( api_key="your_api_key", ) ``` ``` -------------------------------- ### Instantiate Edison Client Source: https://github.com/future-house/edison-client-docs/blob/main/docs/client_notebook.ipynb Instantiates the Edison client. It uses the EDISON_PLATFORM_API_KEY environment variable by default for authentication. You can also provide the API key directly using the 'api_key' parameter. ```python client = EdisonClient( api_key=os.getenv("EDISON_PLATFORM_API_KEY", "your-api-key"), ) ``` -------------------------------- ### Import necessary libraries Source: https://github.com/future-house/edison-client-docs/blob/main/docs/client_notebook.ipynb Imports the required components from the edison_client library and the standard os library. ```python import os from edison_client import ( EdisonClient, JobNames, TaskRequest, ) from edison_client.models import RuntimeConfig from ldp.agent import AgentConfig ``` -------------------------------- ### Create Analysis Task Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.md Initiates an analysis task with specified parameters. The task runs on the Edison platform and a progress URL is provided. ```python task_data = TaskRequest( name=JobNames.ANALYSIS, query=USER_QUERY, runtime_config=RuntimeConfig( max_steps=MAX_STEPS, environment_config={ "language": LANGUAGE, "prompting_config": { k: v for k, v in _SYSTEM_PROMPT_CONFIG.items() if v }, # See above for documentation "data_storage_uris": [ f"data_entry:{directory_upload_response.data_storage.id}" ], "additional_tools": None, # See above for options }, ), ) trajectory_id = client.create_task(task_data) print( f"Task running on platform, you can view progress live at:https://platform.edisonscientific.com/trajectories/{trajectory_id}" ) ``` -------------------------------- ### Import necessary libraries Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Import the required classes and modules from the edison-client library for setting up and running analysis tasks. ```python import time from edison_client import EdisonClient from edison_client.models import RuntimeConfig, TaskRequest from edison_client.models.app import JobNames ``` -------------------------------- ### Continue a job with a follow-up question Source: https://github.com/future-house/edison-client-docs/blob/main/docs/client_notebook.ipynb Submits a new task that continues a previous job by referencing its task ID in the 'runtime_config'. This allows for conversational interactions. ```python task_data = TaskRequest( name=JobNames.LITERATURE, query="How many species of birds are there?" ) responses = client.run_tasks_until_done(task_data) task_response = responses[0] print(f"First job status: {task_response.status}") print(f"First job answer: \n{task_response.formatted_answer}") ``` ```python continued_job_data = { "name": JobNames.LITERATURE, "query": "From the previous answer, specifically, how many species of crows are there?", "runtime_config": {"continued_job_id": task_response.task_id}, } responses = client.run_tasks_until_done(continued_job_data) continued_task_response = responses[0] print(f"Continued job status: {continued_task_response.status}") print(f"Continued job answer: \n{continued_task_response.formatted_answer}") ``` -------------------------------- ### Submit a task with runtime configuration Source: https://github.com/future-house/edison-client-docs/blob/main/docs/client_notebook.ipynb Submits a task with a custom runtime configuration, including agent settings and a maximum number of steps. The 'runtime_config' parameter allows fine-tuning the agent's behavior. ```python agent = AgentConfig( agent_type="SimpleAgent", agent_kwargs={ "model": "gpt-4o", "temperature": 0.0, }, ) task_data = TaskRequest( name=JobNames.LITERATURE, query="How many moons does earth have?", runtime_config=RuntimeConfig(agent=agent, max_steps=10), ) responses = client.run_tasks_until_done(task_data) task_response = responses[0] print(f"Job status: {task_response.status}") print(f"Job answer: \n{task_response.formatted_answer}") ``` -------------------------------- ### Upload a directory Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Upload an entire directory to the Edison data storage service. Set `as_collection=True` to treat the uploaded content as a collection. ```python # Uploading a directory to the data storage service directory_upload_response = await client.astore_file_content( name="Demo file entry for a whole directory", file_path="./datasets", # ADD DATASET FOLDER PATH HERE description="This is a directory that will be be analysed by Edison Analysis", as_collection=True, ) ``` -------------------------------- ### Download Task Artifacts Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Iterate through the output data and download each artifact. Handles both local file downloads and raw content retrieval. ```python for output_file in output_data: download_response = await client.afetch_data_from_storage( data_storage_id=output_file["entry_id"]) # Note there are two potential outcomes here. One where the client downloads # the file to your local filesystem if it's above ~10MB. The second is where # it will return a RawFetchResponse object which contains the raw content. print(download_response) ``` -------------------------------- ### Run Tasks Until Done with TaskRequest Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Submits a task using TaskRequest and waits for it to complete. Ensure the EdisonClient is initialized with an API key. ```python from edison_client import EdisonClient, JobNames from edison_client.models.app import TaskRequest client = EdisonClient( api_key="your_api_key", ) task_response = client.run_tasks_until_done( TaskRequest( name=JobNames.PRECEDENT, query="Has anyone tested therapeutic exerkines in humans or NHPs?", ) ) print(task_response.answer) ``` -------------------------------- ### Run Tasks Until Done with Verbose Output Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Submits a task and retrieves verbose output, including agent state and environment data. This is useful for detailed debugging and analysis. ```python from edison_client import EdisonClient, JobNames from edison_client.models.app import TaskRequest client = EdisonClient( api_key="your_api_key", ) task_response = client.run_tasks_until_done( TaskRequest( name=JobNames.PRECEDENT, query="Has anyone tested therapeutic exerkines in humans or NHPs?", ), verbose=True, ) print(task_response.environment_frame) ``` -------------------------------- ### Configure Task Parameters Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Define the parameters for your Edison Analysis task, including the user query, language, maximum steps, and system prompt configurations. ```python # Define your task USER_QUERY = "Teach me something new about crows." # The actual query you want Edison Analysis` to run SYSTEM_PROMPT = "" # By setting this, you will replace the system prompt entirely. SYSTEM_PROMPT_ADDITIONAL_GUIDELINES = ( "Make all figures in dark mode." # This will be appended to the system prompt ) _SYSTEM_PROMPT_CONFIG = { "system_prompt": SYSTEM_PROMPT, "system_prompt_additional_guidelines": SYSTEM_PROMPT_ADDITIONAL_GUIDELINES, } LANGUAGE = "PYTHON" # Choose between "R" and "PYTHON" MAX_STEPS = 30 # You can change this to impose a limit on the number of steps the agent can take ``` -------------------------------- ### Download Task Artifacts Asynchronously Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.md Iterates through the output data and asynchronously fetches artifacts from storage. Handles both local file downloads and raw content retrieval. ```python for output_file in output_data: download_response = await client.afetch_data_from_storage( data_storage_id=output_file["entry_id"] ) # Note there are two potential outcomes here. One where the client downloads # the file to your local filesystem if it's above ~10MB. The second is where # it will return a RawFetchResponse object which contains the raw content. print(download_response) ``` -------------------------------- ### create_task Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Creates a new task on the Edison platform with the provided task request. This is a synchronous operation. ```APIDOC ## create_task(TaskRequest) ### Description Creates a new task on the Edison platform based on the provided task request. This is a synchronous operation. ### Method `create_task` ### Parameters #### TaskRequest - **name** (string) - Required - The name of the job to run. - **query** (string) - Required - The query to be processed by the task. ### Request Example ```json { "name": "JobNames.LITERATURE", "query": "Which neglected diseases had a treatment developed by artificial intelligence?" } ``` ### Response #### Success Response (200) - **task_id** (string) - The unique identifier of the created task. ``` -------------------------------- ### Create Edison Analysis Task Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Create a new analysis task using the Edison client. This involves constructing a TaskRequest object with the defined query, runtime configuration, and data storage URIs. ```python # Create a task task_data = TaskRequest( name=JobNames.ANALYSIS, query=USER_QUERY, runtime_config=RuntimeConfig( max_steps=MAX_STEPS, environment_config={ "language": LANGUAGE, "prompting_config": { k: v for k, v in _SYSTEM_PROMPT_CONFIG.items() if v }, # See above for documentation "data_storage_uris": [ f"data_entry:{directory_upload_response.data_storage.id}" ], "additional_tools": None, # See above for options }, ), ) trajectory_id = client.create_task(task_data) print( f"Task running on platform, you can view progress live at:https://platform.edisonscientific.com/trajectories/{trajectory_id}" ) ``` -------------------------------- ### acreate_task Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Asynchronously creates a new task on the Edison platform with the provided task request. This is an asynchronous operation. ```APIDOC ## await acreate_task(TaskRequest) ### Description Asynchronously creates a new task on the Edison platform based on the provided task request. This is an asynchronous operation. ### Method `acreate_task` ### Parameters #### TaskRequest - **name** (string) - Required - The name of the job to run. - **query** (string) - Required - The query to be processed by the task. ### Request Example ```json { "name": "JobNames.LITERATURE", "query": "Which neglected diseases had a treatment developed by artificial intelligence?" } ``` ### Response #### Success Response (200) - **task_id** (string) - The unique identifier of the created task. ``` -------------------------------- ### Submit Batch Tasks Asynchronously with EdisonClient Source: https://github.com/future-house/edison-client-docs/blob/main/README.md This asynchronous method allows submitting multiple tasks in a batch. It returns a list of responses, one for each submitted task. This is efficient for running related queries concurrently. ```python import asyncio from edison_client import EdisonClient, JobNames async def main(): client = EdisonClient( api_key="your_api_key", ) task_data = [{ "name": JobNames.PRECEDENT, "query": "Has anyone tested therapeutic exerkines in humans or NHPs?", }, { "name": JobNames.LITERATURE, "query": "Are there any clinically validated therapeutic exerkines for humans?", } ] task_responses = await client.arun_tasks_until_done(task_data) print(task_responses[0].answer) print(task_responses[1].answer) return task_id ``` -------------------------------- ### run_tasks_until_done Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Submits a task request to the Edison platform and waits for its completion. This is a synchronous operation. ```APIDOC ## run_tasks_until_done(TaskRequest) ### Description This method runs a task request and waits until the task is completed. It's a synchronous operation. ### Method `run_tasks_until_done` ### Parameters #### TaskRequest - **name** (string) - Required - The name of the job to run. - **query** (string) - Required - The query to be processed by the task. ### Request Example ```json { "name": "JobNames.LITERATURE", "query": "Which neglected diseases had a treatment developed by artificial intelligence?" } ``` ### Response #### Success Response (200) - **task_response** (object) - The response from the completed task. ``` -------------------------------- ### Submit a Single Task Asynchronously with EdisonClient Source: https://github.com/future-house/edison-client-docs/blob/main/README.md This asynchronous method allows for non-blocking task submission. It's suitable for applications that need to remain responsive during task execution. Use `asyncio.run` to execute the main async function. ```python import asyncio from edison_client import EdisonClient, JobNames async def main(): client = EdisonClient( api_key="your_api_key", ) task_data = { "name": JobNames.PRECEDENT, "query": "Has anyone tested therapeutic exerkines in humans or NHPs?", } task_response = await client.arun_tasks_until_done(task_data) print(task_response.answer) return task_id # For Python 3.7+ if __name__ == "__main__": task_id = asyncio.run(main()) ``` -------------------------------- ### Submit a task and wait for completion Source: https://github.com/future-house/edison-client-docs/blob/main/docs/client_notebook.ipynb Submits a task to a specified job and waits for its completion. The 'run_tasks_until_done' method returns a list of TaskResponse objects. ```python task_data = TaskRequest( name=JobNames.from_string("literature"), query="What is the molecule known to have the greatest solubility in water?", ) responses = client.run_tasks_until_done(task_data) task_response = responses[0] print(f"Job status: {task_response.status}") print(f"Job answer: \n{task_response.formatted_answer}") ``` -------------------------------- ### Upload a single file Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Upload a single file to the Edison data storage service. Provide a name, file path, and description for the data entry. ```python # Uploading a single file to the data storage service single_file_upload_response = await client.astore_file_content( name="Demo file entry for a single file", file_path="./datasets/brain_size_data.csv", # ADD DATASET PATH HERE description="This is a test file that will be be analysed by Edison Analysis", ) ``` -------------------------------- ### Submit a Single Task with EdisonClient Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Use this method to submit a single task to a job. Ensure you have your API key configured. The JobNames enum helps select the correct task type. ```python from edison_client import EdisonClient, JobNames client = EdisonClient( api_key="your_api_key", ) task_data = { "name": JobNames.PRECEDENT, "query": "Has anyone tested therapeutic exerkines in humans or NHPs?", } task_response = client.run_tasks_until_done(task_data) print(task_response.answer) ``` -------------------------------- ### Structure Complex Queries with Numbered Steps Source: https://github.com/future-house/edison-client-docs/blob/main/docs/phoenix_guidelines.md Break down complex, multi-part queries into logically structured, numbered steps. This helps Edison Molecules create an effective execution plan and ensures all components of the query are addressed systematically. ```text (1) Analyze aspirin (SMILES: `CC(=O)OC1=CC=CC=C1C(=O)O`) for ADMET properties. (2) Search ChEMBL for similar anti-inflammatory compounds. (3) Perform safety assessments on the top 5 candidates. (4) Propose modifications to improve solubility while maintaining efficacy. ``` ```text I need you to give me information about caffeine. Follow these steps: (1) Calculate molecular properties (logP, logS, QED) for SMILES `CN1C=NC2=C1C(=O)N(C(=O)N2C)C`. (2) Design a retrosynthesis route. (3) Predict biological activity targets. ``` ```text (1) Search ChEMBL for approved diabetes drugs targeting INSR. (2) Analyze their binding affinities and ADMET properties. (3) Propose 5 novel small molecule candidates with improved properties. ``` -------------------------------- ### Use Reaction SMILES for Synthesis Prediction Source: https://github.com/future-house/edison-client-docs/blob/main/docs/phoenix_guidelines.md Employ reaction SMILES in the format `reactants>reagents>products` for predicting reaction outcomes and designing synthesis routes. This ensures clear communication of chemical transformations. ```text Predict the product of the reaction with reaction SMILES: `CCO.CC(=O)O>>CC(=O)OC`. Calculate the reaction enthalpy. ``` ```text Design a synthesis route for ethyl acetate using reaction SMILES: `CCO.CC(=O)O>>CC(=O)OC` with appropriate catalysts and conditions. ``` -------------------------------- ### Access Task Output Data Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Extract the output data from the task's environment frame. This data contains information about generated artifacts. ```python output_data = job_result.environment_frame["state"]["info"]["output_data"] print(output_data) ``` -------------------------------- ### arun_tasks_until_done Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Asynchronously submits a task request to the Edison platform and waits for its completion. This is an asynchronous operation. ```APIDOC ## await arun_tasks_until_done(TaskRequest) ### Description This method asynchronously runs a task request and waits until the task is completed. It's an asynchronous operation. ### Method `arun_tasks_until_done` ### Parameters #### TaskRequest - **name** (string) - Required - The name of the job to run. - **query** (string) - Required - The query to be processed by the task. ### Request Example ```json { "name": "JobNames.LITERATURE", "query": "Which neglected diseases had a treatment developed by artificial intelligence?" } ``` ### Response #### Success Response (200) - **task_response** (object) - The response from the completed task. ``` -------------------------------- ### Monitor Task Status and Retrieve Results Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.md Polls the task status periodically until completion. Raises an error if the task fails. Retrieves verbose task results upon successful completion. ```python # Jobs take on average 3-10 minutes to complete # We also have inbuilt support for polling, asynchronous tasks and other utilities documented here: # https://edisonscientific.gitbook.io/edison-cookbook/edison-client status = "in progress" while status in {"in progress", "queued"}: status = client.get_task(trajectory_id).status time.sleep(15) if status == "failed": raise RuntimeError("Task failed") job_result = client.get_task(trajectory_id, verbose=True) answer = job_result.environment_frame["state"]["state"]["answer"] print(f"The agent's answer to your research question is: {answer}") ``` -------------------------------- ### Retrieve Task Result Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Retrieve the detailed result of a completed task and extract the agent's answer. ```python job_result = client.get_task(trajectory_id, verbose=True) answer = job_result.environment_frame["state"]["state"]["answer"] print(f"The agent's answer to your research question is: {answer}") ``` -------------------------------- ### Request Specific Outputs for Molecular Analysis Source: https://github.com/future-house/edison-client-docs/blob/main/docs/phoenix_guidelines.md Clearly state the desired outputs, such as ADMET properties, GHS classification, or synthesis routes. This helps Edison Molecules select the appropriate tools and provide actionable results. ```text What are the ADMET properties for `CN1C=NC2=C1C(=O)N(C(=O)N2C)C`? Also, what are its GHS classification and LD50 value? ``` ```text Perform a safety assessment for the molecule with SMILES `CC(=O)OC1=CC=CC=C1C(=O)O`, including GHS classification, LD50 value, chemical weapons screening, and toxicity predictions. ``` ```text I need a synthesis route, ADMET property predictions, and a safety assessment for the target molecule with SMILES `CC(=O)OC1=CC=CC=C1C(=O)O`. ``` -------------------------------- ### get_task Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Retrieves the status and result of a specific task using its ID. This is a synchronous operation. ```APIDOC ## get_task(task_id) ### Description Retrieves the status and result of a specific task using its unique identifier. This is a synchronous operation. ### Method `get_task` ### Parameters #### Path Parameters - **task_id** (string) - Required - The unique identifier of the task. ### Response #### Success Response (200) - **task_data** (object) - The data associated with the task. ``` -------------------------------- ### Job Completion Time Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Note that Edison Analysis jobs typically take between 3 to 10 minutes to complete. ```python # Jobs take on average 3-10 minutes to complete ``` -------------------------------- ### Specify Molecular Inputs with SMILES or CAS Source: https://github.com/future-house/edison-client-docs/blob/main/docs/phoenix_guidelines.md When querying about molecules, provide explicit identifiers like SMILES strings or CAS numbers to reduce ambiguity. This ensures Edison Molecules can accurately identify the target molecule(s). ```text What are the ADMET properties for aspirin (SMILES: `CC(=O)OC1=CC=CC=C1C(=O)O` or CAS: 50-78-2)? ``` ```text List the functional groups available in ascorbic acid (SMILES: `C([C@@H]([C@@H]1C(=C(C(=O)O1)O)O)O)O`). ``` ```text Search for molecules similar to acetaminophen (SMILES: `CC(=O)NC1=CC=C(C=C1)O`) in the ChEMBL database. ``` -------------------------------- ### aget_task Source: https://github.com/future-house/edison-client-docs/blob/main/README.md Asynchronously retrieves the status and result of a specific task using its ID. This is an asynchronous operation. ```APIDOC ## await aget_task(task_id) ### Description Asynchronously retrieves the status and result of a specific task using its unique identifier. This is an asynchronous operation. ### Method `aget_task` ### Parameters #### Path Parameters - **task_id** (string) - Required - The unique identifier of the task. ### Response #### Success Response (200) - **task_data** (object) - The data associated with the task. ``` -------------------------------- ### Request Specific Chemical Properties Source: https://github.com/future-house/edison-client-docs/blob/main/docs/phoenix_guidelines.md When requesting molecular properties, use standard property names and provide the molecule's SMILES string. This ensures accurate calculation and retrieval of desired chemical data. ```text Calculate ADMET properties (specifically human intestinal absorption, blood-brain barrier permeability, and cytochrome P450 inhibition) for the molecule with SMILES `C1=CC(=C(C=C1C2=C(C(=O)C3=C(C=C(C=C3O2)O)O)O)O)O`. ``` -------------------------------- ### Poll Task Status Source: https://github.com/future-house/edison-client-docs/blob/main/docs/edison_analysis_tutorial.ipynb Poll the status of a task until it is no longer in progress or queued. Raises an error if the task fails. ```python status = "in progress" while status in {"in progress", "queued"}: status = client.get_task(trajectory_id).status time.sleep(15) if status == "failed": raise RuntimeError("Task failed") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.