Generate a Private Deep Research on a pipeline
📢 Note: The API and Deep Research are currently in Beta.
After creating a pipeline, you can generate a Private Deep Research on it.
Generate the Deep Research
Make sure to include the code and imports from the Getting Started page.
First, we need to retrieve the pipeline id. If you created the pipeline via the API, you should have the id in the response. Otherwise you can list the pipelines and get the id from there. From the platform, you can navigate into the pipeline page and check the id in the browser url.
- Python
- Node.js
pipelines_api = v.PipelinesApi(api)
response = pipelines.start_deep_research(org, pipeline_id, v.StartDeepResearchRequest(
# make sure to include a relevant prompt here
query="What is the meaning of life?",
# optionally enable additional search on the web
web_search=False,
))
research_id = response.research_id
const pipelineId = "your-pipeline-id";
const response = await pipelinesApi.startDeepResearch({
organization: org,
pipeline: pipelineId,
startDeepResearchRequest: {
// make sure to include a relevant prompt here
query: "Generate a report on financial status of company XX",
// optionally enable additional search on the web
webSearch: false
}
});
const researchId = response.researchId;
Get the Deep Research result
Make sure to include the code and imports from the Getting Started page.
Now we need to poll the Deep Research API to get the result.
- Python
- Node.js
while True:
response = pipelines.get_deep_research_result(org, pipeline_id, research_id)
if response.ready:
if response.data.success:
print(response.data.markdown)
else:
print("Deep Research failed: ", response.data.error)
break
print("not ready")
while (true) {
const result = await pipelinesApi.getDeepResearchResult({
organization: org,
pipeline: pipelineId,
researchId: researchId
})
if (result.ready) {
if (result.data.success) {
console.log(result.data.markdown)
} else {
console.log("Deep Research failed: ", result.data.error)
}
break
} else {
console.log("not ready")
}
}