luanpoppe
feat: adicionando possibilidade de adicionar models do hugging face, mas deixando o chatGPT como padrão
3b3d8b9
raw
history blame
771 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()
system_prompt = serializers.CharField(required=True)
user_message = serializers.CharField(required=True)
model = serializers.CharField(required=False)