from rest_framework import serializers
from .models import TranscriptionTask

class TranscriptionTaskSerializer(serializers.ModelSerializer):
    class Meta:
        model = TranscriptionTask
        fields = ['id', 'file_url', 'task_id', 'status', 'transcription', 'summary', 'error_message', 'created_at', 'updated_at', 'score', 'evaluation']
        read_only_fields = ['id', 'file_url', 'task_id', 'status', 'transcription', 'summary', 'error_message', 'created_at', 'updated_at', 'score', 'evaluation']

class TranscriptionUploadSerializer(serializers.Serializer):
    file = serializers.FileField(help_text="上传的音频文件")
