UNPKG

@plust/datasleuth

Version:

Build LLM-powered research pipelines and output structured data.

40 lines (39 loc) 1.36 kB
/** * Core pipeline execution engine * * This module provides the infrastructure for executing research pipelines. * It handles step execution, error management, retries, timeouts, and state management * throughout the research process. * * @module core/pipeline */ import { ResearchState, ResearchStep, PipelineConfig, ResearchResult } from '../types/pipeline.js'; import { z } from 'zod'; /** * Creates the initial state object for a research pipeline * * @param query - The research query string * @param outputSchema - A Zod schema that defines the expected output structure * @returns A fresh ResearchState object initialized with the provided query and schema * * @example * ```typescript * import { z } from 'zod'; * import { createInitialState } from '@plust/datasleuth'; * * const outputSchema = z.object({ * summary: z.string(), * findings: z.array(z.string()) * }); * * const initialState = createInitialState( * "What are the latest advancements in renewable energy?", * outputSchema * ); * ``` */ export declare function createInitialState(query: string, outputSchema: z.ZodType<ResearchResult>): ResearchState; /** * Main pipeline execution function */ export declare function executePipeline(initialState: ResearchState, steps: ResearchStep[], config?: Partial<PipelineConfig>): Promise<ResearchState>;