Edison Analysis API Tutorial
This notebook provides you with an example usecase for using Edison Analysis to perform data analysis.
The only dependency you need to follow along is edison-client which you can install via pip:
pip install edison-clientWe recommend reading the edison client docs before following this tutorial.
To run a Edison Analysis job you should take the following steps:
Upload the any artifacts to the data storage service
Start an
Edison Analysisrun using the Edison client passing the data storage entry ids along with any other details in the task configUse the output of the task to obtain any data generated by the task
import time
from edison_client import EdisonClient
from edison_client.models import RuntimeConfig, TaskRequest
from edison_client.models.app import JobNames# 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)File management with Edison Analysis
Edison Analysis is designed to run data analysis on files provided by the user or caller. To provide Edison Analysis with this data, you'll need to upload it to the Edison data storage service. This service is your one stop shop for sharing, storing and updating data to be used in the Edison ecosystem.
Running Your Job
When running a Edison Analysis job there are some considerations to take with how you configure the agent. The first things to note are the core configuration settings like language, max_steps and query. In addition to these core settings you have some other options too. The key ones are listed below:
Additional tools available:
query_ensembl: query the Ensembl databaseget_convert_gene: for converting gene IDs from one type to another, for example Ensembl, Entrez, Refseq.search_web: expose exa.ai (/search) web search as a toolcrawl_web: expose exa.ai (/contents) web crawl as a toolresearch_web: expose exa.ai (/research) web research as a toolquery_literature: allowEdison Analysisto do calls toEdison Literaturefor literature searchYou can add in either user or system prompt for tool usage. For example: "Use the query_literature tool to compare your findings against published literature."
Modifying system prompt
There are two options to modify the system prompt:
Replace the existing system prompt completely using
prompting_config["system_prompt"]Append additional guideline to existing system prompt using
prompting_config["system_prompt_additional_guidelines]
Build the prompting_config dictionary then assign it to the "prompting_config" key within environment_config
Download Task Output
While the task is executing it will create some artifacts. First the notebook which is where the analysis code will be written and any other artifacts creating during the task.
Once the task has completed you may want to check the contents of the notebook or look through the artifacts generated. To obtain these artifacts, you will need to inspect the output of the agent's final environment_frame
Last updated

