Skip to main content

Query

Run bioinformatics queries through the AI agent. Supports synchronous and streaming modes.

POST/v1/queryScope: query

Synchronous query — waits for the agent to finish and returns the full response.

Request Body

FieldTypeRequiredDescription
promptstringYesThe bioinformatics query or instruction
conversation_idstringNoSession ID to continue a previous conversation
workspace_idstringNo*Required if key is scoped to specific workspaces
response = client.query.run(
    "Find BRCA1 variants associated with breast cancer",
    workspace_id="ws_abc123",
)
print(response.answer)
POST/v1/query/streamScope: query

Streaming query — returns Server-Sent Events as the agent processes the request. Same request body as /v1/query.

SSE Event Types

typeDescription
statusProcessing status update (e.g., "Searching databases...")
contentText content to display to the user
tool_callA tool was invoked by the agent
doneStream is complete — no more events
errorAn error occurred during processing
for chunk in client.query.stream("Run BLAST for ATGCGTAACCGTAA"):
    if chunk.type == "status":
        print(f"[{chunk.status}]")
    elif chunk.type == "content":
        print(chunk.content, end="", flush=True)
    elif chunk.type == "done":
        print("\nComplete.")