luanpoppe
feat: adicionando funcionalidade de múltiplos pdfs
b700f35
raw
history blame
907 Bytes
from rest_framework import serializers
from endpoint_teste.models import EndpointTesteModel
class EndpointTesteSerializer(serializers.ModelSerializer):
class Meta:
model = EndpointTesteModel
fields = "__all__"
class TesteSerializer(serializers.Serializer):
history_chat = serializers.ListField(read_only=True, required=False)
system_prompt = serializers.CharField(required=True)
user_message = serializers.CharField(required=True)
pdf_url = serializers.CharField(required=False)
class PDFUploadSerializer(serializers.Serializer):
# file = serializers.FileField()
files = serializers.ListField(child=serializers.FileField(), required=True)
system_prompt = serializers.CharField(required=True)
user_message = serializers.CharField(required=True)
model = serializers.CharField(required=False)
embedding = serializers.CharField(required=False)