historico
This commit is contained in:
@@ -51,14 +51,19 @@ IMPORTANTE - RESPOSTAS COMPLETAS:
|
||||
});
|
||||
|
||||
// PASSO 3 — BUSCAR MEMÓRIA DA CONVERSA NA Cloud Firestore
|
||||
final conversationHistory = await ChatMemoryService.getRecentMessages(
|
||||
limit: 20,
|
||||
);
|
||||
for (final msg in conversationHistory) {
|
||||
messages.add({
|
||||
'role': msg['role'] as String,
|
||||
'content': msg['content'] as String,
|
||||
});
|
||||
final conversationId = ChatMemoryService.currentConversationId;
|
||||
if (conversationId != null) {
|
||||
final conversationHistory =
|
||||
await ChatMemoryService.getConversationMessages(
|
||||
conversationId: conversationId,
|
||||
limit: 20,
|
||||
);
|
||||
for (final msg in conversationHistory) {
|
||||
messages.add({
|
||||
'role': msg['role'] as String,
|
||||
'content': msg['content'] as String,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// PASSO 4 — BUSCAR PDFs DO PROFESSOR NO Firebase Storage (RAG CHUNK RETRIEVAL)
|
||||
@@ -905,14 +910,19 @@ IMPORTANTE - RESPOSTAS COMPLETAS:
|
||||
});
|
||||
|
||||
// PASSO 3 — BUSCAR MEMÓRIA DA CONVERSA NA Cloud Firestore (máx 4 para poupar heap)
|
||||
final conversationHistory = await ChatMemoryService.getRecentMessages(
|
||||
limit: 4,
|
||||
);
|
||||
for (final msg in conversationHistory) {
|
||||
messages.add({
|
||||
'role': msg['role'] as String,
|
||||
'content': msg['content'] as String,
|
||||
});
|
||||
final conversationId = ChatMemoryService.currentConversationId;
|
||||
if (conversationId != null) {
|
||||
final conversationHistory =
|
||||
await ChatMemoryService.getConversationMessages(
|
||||
conversationId: conversationId,
|
||||
limit: 4,
|
||||
);
|
||||
for (final msg in conversationHistory) {
|
||||
messages.add({
|
||||
'role': msg['role'] as String,
|
||||
'content': msg['content'] as String,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Log de confirmação de ordem do histórico
|
||||
|
||||
Reference in New Issue
Block a user