All files / api/src/connectors/evaluations/conversation-completeness types.ts

100% Statements 15/15
100% Branches 0/0
100% Functions 0/0
100% Lines 15/15

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 401x                                   1x 1x 1x       1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x          
import z from 'zod';
 
export interface ConversationCompletenessResult {
  score: number;
  reasoning: string;
  metadata?: Record<string, unknown>;
}
 
export interface ConversationCompletenessAverageResult {
  average_score: number;
  total_logs: number;
  passed_count: number;
  failed_count: number;
  threshold_used: number;
  evaluation_run_id: string;
}
 
// AI-modifiable parameters - none needed, evaluation works automatically
export const ConversationCompletenessEvaluationAIParameters = z
  .object({})
  .strict();
 
// Full parameters including user-modifiable settings
// Note: model is configured via evaluation.model_id, not in parameters
export const ConversationCompletenessEvaluationParameters =
  ConversationCompletenessEvaluationAIParameters.extend({
    threshold: z.number().min(0).max(1).default(0.7),
    temperature: z.number().min(0).max(2).default(0.1),
    max_tokens: z.number().int().positive().default(1000),
    include_reason: z.boolean().default(true),
    strict_mode: z.boolean().default(false),
    async_mode: z.boolean().default(false),
    verbose_mode: z.boolean().default(false),
    batch_size: z.number().int().positive().default(10),
  });
 
export type ConversationCompletenessEvaluationParameters = z.infer<
  typeof ConversationCompletenessEvaluationParameters
>;