evalution
    Preparing search index...

    Interface SDKAdapter

    Adapter that provides values and execution for a particular AI SDK.

    Pass an instance of this to FilePromptProvider via the sdk option.

    Each SDKAdapter implementation should be paired with a companion package (named by SDKAdapter.promptsHelperImport) that exports a prompts function satisfying the PromptsHelper type. That function is the user-facing entry point for defining prompts that work with Evalution. It accepts a PromptsHelperOptions and a factory that can optionally receive SDK-specific parameters. The factory should return a record of prompt functions. Prompt functions should return a configuration that enables OpenTelemetry reporting, if possible, with the attributes returned by getPromptSpanAttributes.

    interface SDKAdapter {
        promptsHelperImport: string;
        denormalizeUpdates(
            updates: NormalizedPromptUpdates,
            currentValues?: Record<string, PropValue>,
        ): Record<string, ModelPropValue | null>;
        executeConfig(config: any, options?: ExecuteConfigOptions): Promise<void>;
        getModelCatalog(): Promise<ModelCatalog>;
        getModelParameters(rootDir: string): PropDefinition[];
        normalizePrompt(prompt: ParsedPrompt): NormalizedPrompt;
        setupTraceIngestion?(): Promise<TraceIngestor | undefined>;
    }

    Implemented by

    Index

    Properties

    promptsHelperImport: string

    The package that exports the prompts() helper used in new prompt files (e.g. '@evalution/vercel-ai-sdk'). Used by PromptFileType.newPromptSkeleton.

    Methods

    • Executes a prompt config object.

      Parameters

      • config: any

        The config object returned by the prompt function.

      • Optionaloptions: ExecuteConfigOptions

        Optional execution options (trace id, prompt identity).

      Returns Promise<void>

    • Returns the list of model parameters that can be edited in the playground UI for projects rooted at rootDir. Typically extracted from the SDK's published TypeScript type definitions.

      Parameters

      • rootDir: string

        Absolute path to the project root.

      Returns PropDefinition[]

    • Called once, during server startup, before any prompt config is built, to perform whatever setup this SDK's tracing mechanism needs (e.g. registering a native telemetry integration, or standing up an OpenTelemetry pipeline).

      If this SDK's tracing is built on OpenTelemetry, its implementation of this method should call setupGlobalOTelPipeline, which ensures the global pipeline is only set up once, even if other SDK adapters also call it.

      Optional — adapters with no tracing support may omit it.

      Returns Promise<TraceIngestor | undefined>

      An ingestor to which TraceSinks should be added, or undefined if tracing cannot be set up.