Fix Jinja Conversation Role Alternation in RAG Context History
- Merge Introduction prompt, RAG prompt and context block into one System message; - Keep the user question as the following User message; - Prevent consecutive System roles in AskWithContextAsync and AskWithContextAsEnumerable; - Update the GetContextHistory XML documentation to describe the new message layout; - Preserve the existing context retrieval and response flow. - ...
This commit is contained in:
@@ -157,9 +157,12 @@ namespace xAiApi.Providers
|
||||
}
|
||||
|
||||
//
|
||||
return [.. result
|
||||
result = [.. result
|
||||
.OrderByDescending(x => x.Score)
|
||||
.Take(topK)];
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool TryGet(
|
||||
|
||||
Reference in New Issue
Block a user