@plust/datasleuth - v0.2.0
    Preparing search index...

    Function analyze

    • Creates an analysis step for the research pipeline

      This function creates a step that analyzes research data using AI to extract insights, identify patterns, and provide recommendations based on the specified focus area. The step will process available data from previous steps, such as extracted content and fact-checked statements.

      Parameters

      • options: AnalyzeOptions

        Configuration options for the analysis step

        Options for the analysis step

        • focus: string

          Focus area for analysis (e.g., 'market-trends', 'technical-details')

        • Optionalllm?: LanguageModelV1

          Model to use for analysis (from the AI SDK)

        • Optionaltemperature?: number

          Temperature for the LLM (0.0 to 1.0)

        • Optionaldepth?: "basic" | "detailed" | "comprehensive"

          Depth of analysis ('basic', 'detailed', 'comprehensive')

        • OptionalincludeEvidence?: boolean

          Whether to include supporting evidence in the analysis

        • OptionalincludeRecommendations?: boolean

          Whether to include recommendations in the analysis

        • OptionalincludeInResults?: boolean

          Whether to add the analysis to the final results

        • OptionalcustomPrompt?: string

          Custom prompt for analysis

        • OptionalallowEmptyContent?: boolean

          Whether to proceed if no content is available

        • OptionalmaxContentSize?: number

          Maximum content size for analysis (in characters)

        • Optionalretry?: { maxRetries?: number; baseDelay?: number }

          Retry configuration for LLM calls

          • OptionalmaxRetries?: number

            Maximum number of retries

          • OptionalbaseDelay?: number

            Base delay between retries in ms

      Returns ResearchStep

      A configured analysis step for the research pipeline

      import { research, analyze } from '@plust/datasleuth';
      import { openai } from '@ai-sdk/openai';

      const results = await research({
      query: "Impact of AI on healthcare",
      steps: [
      // Other steps...
      analyze({
      focus: 'ethical-considerations',
      llm: openai('gpt-4o'),
      depth: 'comprehensive',
      includeRecommendations: true
      })
      ],
      outputSchema: outputSchema
      });