import { BaseClient } from '../base-client'; import { ScorerTypes, ValidateCodeScorerResponse, RegisteredScorerTaskResultResponse, ValidateRegisteredScorerResult, CreateScorerRequest, ScorerResponse, ListScorersResponse, BaseScorerVersionResponse, CreateLlmScorerVersionRequest, DeleteScorerResponse } from '../../types/scorer.types'; import { StepType } from '../../types/logging/step.types'; export declare class ScorerService extends BaseClient { constructor(apiUrl: string, token: string); /** * Retrieves a list of scorers, optionally filtered by scorer type. * * @param type - (Optional) The type of scorer to filter by. * @returns A promise that resolves to an array of {@link Scorer} objects. */ getScorers: (options?: { type?: ScorerTypes; names?: string[]; }) => Promise; /** * Retrieves a page of scorers with pagination support. */ getScorersPage: (options?: { name?: string; names?: string[]; types?: ScorerTypes[]; startingToken?: number; limit?: number; }) => Promise; /** * Retrieves a page of scorers filtered by label. * Uses ScorerLabelFilter with optional strict mode and case sensitivity. * * @param options.labels - Labels to search for. * @param options.strict - When false, also matches by scorer name as fallback. * @param options.caseSensitive - Whether label matching is case-sensitive. * @param options.startingToken - Pagination starting token. * @param options.limit - Maximum results per page. */ getScorersPageByLabels: (options: { labels: string[]; strict?: boolean; caseSensitive?: boolean; startingToken?: number; limit?: number; }) => Promise; /** * Retrieves a page of scorers filtered by ID. * Uses ScorerIDFilter. * * @param options.ids - Scorer IDs to search for. * @param options.startingToken - Pagination starting token. * @param options.limit - Maximum results per page. */ getScorersPageByIds: (options: { ids: string[]; startingToken?: number; limit?: number; }) => Promise; /** * Retrieves a specific version of a scorer by its ID and version number. * * @param scorerId - The unique identifier of the scorer. * @param version - The version number of the scorer to retrieve. * @returns A promise that resolves to the requested {@link BaseScorerVersionResponse}. */ getScorerVersion: (scorerId: string, version: number) => Promise; /** * Creates a new scorer with the specified parameters. * @param options - The scorer creation options. * @param options.name - The name of the scorer. * @param options.scorerType - The type of the scorer. * @param options.description - (Optional) A description for the scorer. * @param options.tags - (Optional) Tags to associate with the scorer. * @param options.defaults - (Optional) Default settings for the scorer. Required for LLM scorers. * @param options.modelType - (Optional) The model type for the scorer. * @param options.defaultVersionId - (Optional) The default version ID for the scorer. * @param options.scoreableNodeTypes - (Optional) The node types that can be scored. * @param options.outputType - (Optional) The output type for the scorer. * @param options.inputType - (Optional) The input type for the scorer. * @returns A promise that resolves to the created scorer. */ createScorer: (options: CreateScorerRequest) => Promise; /** * Creates a new LLM scorer version for a given scorer. * * @param scorerId - The unique identifier of the scorer. * @param instructions - Instructions for the scorer version. * @param chainPollTemplate - The chain poll template for the scorer version. * @param userPrompt - (Optional) The user prompt for the scorer version. * @param scoreableNodeTypes - (Optional) The node level for the scorer version. Defaults to ['llm']. * @param cotEnabled - (Optional) Whether chain of thought is enabled. Defaults to * @param modelName - (Optional) The model name to use. * @param numJudges - (Optional) The number of judges to use. * @param outputType - (Optional) The output type for the scorer version. * @returns A promise that resolves to the created {@link ScorerVersion}. */ createLLMScorerVersion: (scorerId: string, options: CreateLlmScorerVersionRequest) => Promise; /** * Deletes a scorer by its unique identifier. * * @param id - The unique identifier of the scorer to delete. * @returns A promise that resolves when the scorer is deleted. */ deleteScorer: (id: string) => Promise; createCodeScorerVersion: (scorerId: string, codeContent: string, validationResult?: string) => Promise; /** * Validates code scorer content by submitting it for validation. * * @param codeContent - The Python code content to validate. * @param scoreableNodeTypes - The node types that this scorer can score. * @returns A promise that resolves to the validation task ID. */ validateCodeScorer: (codeContent: string, scoreableNodeTypes: StepType[], requiredScorers?: string[]) => Promise; /** * Gets the result of a code scorer validation task. * * @param taskId - The ID of the validation task. * @returns A promise that resolves to the validation result. */ getCodeScorerValidationResult: (taskId: string) => Promise; /** * Validates code scorer and waits for the result. * Polls the validation endpoint at specified intervals until complete or timeout. * * @param codeContent - The Python code content to validate. * @param scoreableNodeTypes - The node types that this scorer can score. * @param timeoutMs - Maximum time to wait for validation (default: 60000ms). * @param pollIntervalMs - Interval between polling attempts (default: 1000ms). * @returns A promise that resolves to the validation result. * @throws Error if validation fails or times out. */ validateCodeScorerAndWait: (codeContent: string, scoreableNodeTypes: StepType[], timeoutMs?: number, pollIntervalMs?: number, requiredScorers?: string[]) => Promise; }