/** * Research API Client * Functions for interacting with the multi-agent research pipeline */ import { apiClient } from './client' import type { ResearchRequest, ResearchProgress, ResearchResult, ResearchSummary } from '../types/research' /** * Start a new research task (async) */ export async function startResearch(request: ResearchRequest): Promise { const response = await apiClient.post('/research/start', request) return response.data } /** * Get the status of a research task */ export async function getResearchStatus(taskId: string): Promise { const response = await apiClient.get(`/research/status/${taskId}`) return response.data } /** * Get the result of a completed research task */ export async function getResearchResult(taskId: string): Promise { const response = await apiClient.get(`/research/result/${taskId}`) return response.data } /** * Get history of research tasks */ export async function getResearchHistory(limit = 20, offset = 0): Promise { const response = await apiClient.get('/research/history', { params: { limit, offset } }) return response.data } /** * Run a synchronous (quick) research task */ export async function quickResearch(request: ResearchRequest): Promise { const response = await apiClient.post('/research/quick', request) return response.data } /** * Delete a research task */ export async function deleteResearch(taskId: string): Promise { await apiClient.delete(`/research/${taskId}`) }