mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 22:13:47 +00:00
Improved the augmentation & generation of RAG (#314)
This commit is contained in:
1 parent
df01ce188e
commit
6a4a7dc0d6
23 files changed
+69
-44
No files matched your search
@@ -66,22 +66,8 @@ public sealed class AugmentationOne : IAugmentationProcess
|
||||
// Let's convert all retrieval contexts to Markdown:
|
||||
await retrievalContexts.AsMarkdown(sb, token);
|
||||
|
||||
//
|
||||
// Append the entire augmentation to the chat thread,
|
||||
// just before the user prompt:
|
||||
//
|
||||
chatThread.Blocks.Insert(chatThread.Blocks.Count - 1, new()
|
||||
{
|
||||
Role = ChatRole.RAG,
|
||||
Time = DateTimeOffset.UtcNow,
|
||||
ContentType = ContentType.TEXT,
|
||||
HideFromUser = true,
|
||||
Content = new ContentText
|
||||
{
|
||||
Text = sb.ToString(),
|
||||
}
|
||||
});
|
||||
|
||||
// Add the augmented data to the chat thread:
|
||||
chatThread.AugmentedData = sb.ToString();
|
||||
return chatThread;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user