The research configuration object
Input for the research function
The research query
Schema defining the output structure
Optional
steps?: ResearchStep[]Optional custom pipeline steps
Optional
config?: Partial<PipelineConfig>Optional configuration for the pipeline
Optional
defaultLLM?: LanguageModelV1Default language model to use for LLM-dependent steps
Optional
defaultSearchProvider?: anyDefault search provider to use for search-dependent steps
The research results matching the structure defined by outputSchema
import { research } from '@plust/datasleuth';
import { z } from 'zod';
import { openai } from '@ai-sdk/openai';
import { google } from '@plust/search-sdk';
// Define your output schema
const outputSchema = z.object({
summary: z.string(),
keyFindings: z.array(z.string()),
sources: z.array(z.string().url())
});
// Configure your search provider
const searchProvider = google.configure({
apiKey: process.env.GOOGLE_API_KEY,
cx: process.env.GOOGLE_CX
});
// Execute research
const results = await research({
query: "Latest advancements in quantum computing",
outputSchema,
defaultLLM: openai('gpt-4o'),
defaultSearchProvider: searchProvider
});
Main research function - the primary API for the @plust/datasleuth package
This function orchestrates the entire research process from query to results. It takes a research query, an output schema for validation, and optional configuration parameters to customize the research process.