Try to Fix Embeding RAG Persisted Issues ...

This commit is contained in:
2026-11-01 23:12:12 +03:30
parent fa1014bf20
commit 726d6ce827
3 changed files with 43 additions and 1 deletions
+28
View File
@@ -269,6 +269,7 @@ namespace xAiApi.Providers
/// Ask a Question By Rag Retrive From Knowledge ...
/// </summary>
/// <param name="prompt"></param>
/// <param name="type"></param>
/// <param name="topK"></param>
/// <param name="minScore"></param>
/// <param name="userInfo"></param>
@@ -276,6 +277,7 @@ namespace xAiApi.Providers
/// <returns></returns>
public virtual async Task<string> AskTextFromKnowledgeAsync(
string prompt,
string type = null,
int? topK = null,
float? minScore = null,
XUserClaimsInfoDto userInfo = null,
@@ -316,12 +318,17 @@ namespace xAiApi.Providers
{
minScore = configuration.RAGDescriptor.DefaultMinScore;
}
if (type.IsNullOrEmpty())
{
type = XAiModelsConstants.XAiDefaultKnowledgeType;
}
//
// Prepare Knowledge Request ...
var knowledgeRequest = new XAiKnowledgeAskRequest
{
TopK = topK,
Type = type,
Prompt = prompt,
IncludeUser = true,
MinScore = minScore,
@@ -361,6 +368,7 @@ namespace xAiApi.Providers
/// Ask a Question By Rag Retrive From Knowledge and Stream Response ...
/// </summary>
/// <param name="prompt"></param>
/// <param name="type"></param>
/// <param name="topK"></param>
/// <param name="minScore"></param>
/// <param name="userInfo"></param>
@@ -368,6 +376,7 @@ namespace xAiApi.Providers
/// <returns></returns>
public virtual async IAsyncEnumerable<string> AskTextFromKnowledgeAsEnumerable(
string prompt,
string type = null,
int? topK = null,
float? minScore = null,
XUserClaimsInfoDto userInfo = null,
@@ -409,12 +418,17 @@ namespace xAiApi.Providers
{
minScore = configuration.RAGDescriptor.DefaultMinScore;
}
if (type.IsNullOrEmpty())
{
type = XAiModelsConstants.XAiDefaultKnowledgeType;
}
//
// Prepare Knowledge Request ...
var knowledgeRequest = new XAiKnowledgeAskRequest
{
TopK = topK,
Type = type,
Prompt = prompt,
IncludeUser = true,
MinScore = minScore,
@@ -453,6 +467,7 @@ namespace xAiApi.Providers
/// Ask a Question as Prompt and Retrieve Response ...
/// </summary>
/// <param name="prompt"></param>
/// <param name="type"></param>
/// <param name="topK"></param>
/// <param name="minScore"></param>
/// <param name="projectId"></param>
@@ -464,6 +479,7 @@ namespace xAiApi.Providers
/// <returns></returns>
public virtual async Task<XAiMessageDto> AskAsync(
string prompt,
string type = null,
int? topK = null,
float? minScore = null,
Guid? projectId = null,
@@ -508,6 +524,10 @@ namespace xAiApi.Providers
{
minScore = configuration.RAGDescriptor.DefaultMinScore;
}
if (type.IsNullOrEmpty())
{
type = XAiModelsConstants.XAiDefaultKnowledgeType;
}
//
// Check Project ...
@@ -599,6 +619,7 @@ namespace xAiApi.Providers
var knowledgeRequest = new XAiKnowledgeAskRequest
{
TopK = topK,
Type = type,
Prompt = prompt,
IncludeUser = true,
MinScore = minScore,
@@ -688,6 +709,7 @@ namespace xAiApi.Providers
/// Ask a Question as Prompt and Retrieve Response as Async Enumerable ...
/// </summary>
/// <param name="prompt"></param>
/// <param name="type"></param>
/// <param name="topK"></param>
/// <param name="minScore"></param>
/// <param name="projectId"></param>
@@ -699,6 +721,7 @@ namespace xAiApi.Providers
/// <returns></returns>
public virtual async IAsyncEnumerable<XAiResonseMessage> AskAsEnumerable(
string prompt,
string type = null,
int? topK = null,
float? minScore = null,
Guid? projectId = null,
@@ -744,6 +767,10 @@ namespace xAiApi.Providers
{
minScore = configuration.RAGDescriptor.DefaultMinScore;
}
if (type.IsNullOrEmpty())
{
type = XAiModelsConstants.XAiDefaultKnowledgeType;
}
//
// Check Project ...
@@ -835,6 +862,7 @@ namespace xAiApi.Providers
var knowledgeRequest = new XAiKnowledgeAskRequest
{
TopK = topK,
Type = type,
Prompt = prompt,
IncludeUser = true,
MinScore = minScore,