import { Field, ObjectType, InputType, Int, Float } from 'type-graphql' // ============================================================================ // Label Studio Prediction Generation Types // ============================================================================ /** * Label Studio prediction generation request */ @InputType({ description: 'Request to generate Label Studio predictions' }) export class GeneratePredictionRequest { @Field(type => Int, { description: 'Label Studio task ID' }) taskId: number @Field({ description: 'Image URL from task data' }) imageUrl: string @Field({ nullable: true, description: 'AI model ID to use' }) modelId?: string @Field(type => Float, { nullable: true, description: 'Confidence threshold (0-1)' }) confidenceThreshold?: number } /** * Batch prediction generation request */ @InputType({ description: 'Request to generate predictions for multiple tasks' }) export class BatchGeneratePredictionRequest { @Field(type => Int, { description: 'Label Studio project ID' }) projectId: number @Field(type => [Int], { description: 'Array of task IDs' }) taskIds: number[] @Field({ nullable: true, description: 'AI model ID to use' }) modelId?: string @Field(type => Float, { nullable: true, description: 'Confidence threshold (0-1)' }) confidenceThreshold?: number } /** * Prediction generation result */ @ObjectType({ description: 'Prediction generation result' }) export class PredictionGenerationResult { @Field(type => Int, { description: 'Task ID' }) taskId: number @Field(type => Int, { nullable: true, description: 'Created prediction ID' }) predictionId?: number @Field({ description: 'Success status' }) success: boolean @Field({ nullable: true, description: 'Error message if failed' }) error?: string @Field(type => Int, { description: 'Number of detected objects' }) objectCount: number @Field(type => Float, { nullable: true, description: 'Average confidence score' }) avgConfidence?: number } /** * Batch prediction generation result */ @ObjectType({ description: 'Batch prediction generation result' }) export class BatchPredictionResult { @Field(type => Int, { description: 'Total tasks processed' }) total: number @Field(type => Int, { description: 'Number of successful predictions' }) succeeded: number @Field(type => Int, { description: 'Number of failed predictions' }) failed: number @Field(type => [PredictionGenerationResult], { description: 'Individual results' }) results: PredictionGenerationResult[] @Field({ description: 'Model version used' }) modelVersion: string }