Spaces:
Running
Running
from rest_framework import serializers | |
from _antigos.resumos.serializer import ResumoCursorSerializer | |
from _utils.gerar_relatorio_modelo_usuario.prompts import ( | |
system_prompt_modelo, | |
system_prompt_relatorio, | |
) | |
user_message = "What are the main points of this document?" | |
class ResumoCursorCompeltoSerializer(ResumoCursorSerializer): | |
system_prompt = None | |
prompt_relatorio = serializers.CharField( | |
required=False, default=system_prompt_relatorio | |
) | |
prompt_modelo = serializers.CharField(required=False, default=system_prompt_modelo) | |
user_message = serializers.CharField(required=False, default=user_message) | |
num_chunks_retrieval = serializers.IntegerField(default=5) | |
embedding_weight = serializers.FloatField(default=0.5) | |
bm25_weight = serializers.FloatField(default=0.5) | |
context_window = serializers.IntegerField(default=3) | |
chunk_overlap = serializers.IntegerField(default=200) | |
num_k_rerank = serializers.IntegerField(default=5) | |
model_cohere_rerank = serializers.CharField( | |
required=False, default="rerank-english-v2.0" | |
) | |
more_initial_chunks_for_reranking = serializers.IntegerField(default=20) | |
claude_context_model = serializers.CharField( | |
required=False, default="claude-3-haiku-20240307" | |
) | |
gpt_temperature = serializers.FloatField(default=0) | |
id_modelo_do_usuario = serializers.IntegerField(required=True) | |
should_have_contextual_chunks = serializers.BooleanField(default=False) | |