Try to Fix Embeding RAG Persisted Issues ...
This commit is contained in:
@@ -192,6 +192,7 @@ namespace xAiApi.Controllers
|
|||||||
var result = await aiService.AskTextFromKnowledgeAsync(
|
var result = await aiService.AskTextFromKnowledgeAsync(
|
||||||
topK: request.TopK,
|
topK: request.TopK,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
type: request.Type,
|
||||||
prompt: request.Prompt,
|
prompt: request.Prompt,
|
||||||
minScore: request.MinScore,
|
minScore: request.MinScore,
|
||||||
cancellationToken: cancellationToken
|
cancellationToken: cancellationToken
|
||||||
@@ -244,6 +245,7 @@ namespace xAiApi.Controllers
|
|||||||
var enumerable = aiService.AskTextFromKnowledgeAsEnumerable(
|
var enumerable = aiService.AskTextFromKnowledgeAsEnumerable(
|
||||||
topK: request.TopK,
|
topK: request.TopK,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
type: request.Type,
|
||||||
prompt: request.Prompt,
|
prompt: request.Prompt,
|
||||||
minScore: request.MinScore,
|
minScore: request.MinScore,
|
||||||
cancellationToken: cancellationToken
|
cancellationToken: cancellationToken
|
||||||
@@ -323,6 +325,7 @@ namespace xAiApi.Controllers
|
|||||||
files: null,
|
files: null,
|
||||||
topK: request.TopK,
|
topK: request.TopK,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
type: request.Type,
|
||||||
prompt: request.Prompt,
|
prompt: request.Prompt,
|
||||||
minScore: request.MinScore,
|
minScore: request.MinScore,
|
||||||
connectionId: connectionId,
|
connectionId: connectionId,
|
||||||
@@ -379,6 +382,7 @@ namespace xAiApi.Controllers
|
|||||||
files: null,
|
files: null,
|
||||||
topK: request.TopK,
|
topK: request.TopK,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
type: request.Type,
|
||||||
prompt: request.Prompt,
|
prompt: request.Prompt,
|
||||||
minScore: request.MinScore,
|
minScore: request.MinScore,
|
||||||
connectionId: connectionId,
|
connectionId: connectionId,
|
||||||
@@ -463,6 +467,7 @@ namespace xAiApi.Controllers
|
|||||||
files: null,
|
files: null,
|
||||||
topK: request.TopK,
|
topK: request.TopK,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
type: request.Type,
|
||||||
prompt: request.Prompt,
|
prompt: request.Prompt,
|
||||||
minScore: request.MinScore,
|
minScore: request.MinScore,
|
||||||
connectionId: connectionId,
|
connectionId: connectionId,
|
||||||
@@ -520,6 +525,7 @@ namespace xAiApi.Controllers
|
|||||||
files: files,
|
files: files,
|
||||||
topK: request.TopK,
|
topK: request.TopK,
|
||||||
userInfo: userInfo,
|
userInfo: userInfo,
|
||||||
|
type: request.Type,
|
||||||
prompt: request.Prompt,
|
prompt: request.Prompt,
|
||||||
minScore: request.MinScore,
|
minScore: request.MinScore,
|
||||||
connectionId: connectionId,
|
connectionId: connectionId,
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// Ask a Question By Rag Retrive From Knowledge ...
|
/// Ask a Question By Rag Retrive From Knowledge ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
@@ -91,6 +92,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<string> AskTextFromKnowledgeAsync(
|
Task<string> AskTextFromKnowledgeAsync(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -101,6 +103,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// Ask a Question By Rag Retrive From Knowledge and Stream Response ...
|
/// Ask a Question By Rag Retrive From Knowledge and Stream Response ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
@@ -108,6 +111,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IAsyncEnumerable<string> AskTextFromKnowledgeAsEnumerable(
|
IAsyncEnumerable<string> AskTextFromKnowledgeAsEnumerable(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -118,6 +122,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// Ask a Question as Prompt and Retrieve Response ...
|
/// Ask a Question as Prompt and Retrieve Response ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="projectId"></param>
|
/// <param name="projectId"></param>
|
||||||
@@ -129,6 +134,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<XAiMessageDto> AskAsync(
|
Task<XAiMessageDto> AskAsync(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
Guid? projectId = null,
|
Guid? projectId = null,
|
||||||
@@ -143,6 +149,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// Ask a Question as Prompt and Retrieve Response as Async Enumerable ...
|
/// Ask a Question as Prompt and Retrieve Response as Async Enumerable ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="projectId"></param>
|
/// <param name="projectId"></param>
|
||||||
@@ -154,6 +161,7 @@ namespace xAiApi.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IAsyncEnumerable<XAiResonseMessage> AskAsEnumerable(
|
IAsyncEnumerable<XAiResonseMessage> AskAsEnumerable(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
Guid? projectId = null,
|
Guid? projectId = null,
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ namespace xAiApi.Providers
|
|||||||
/// Ask a Question By Rag Retrive From Knowledge ...
|
/// Ask a Question By Rag Retrive From Knowledge ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
@@ -276,6 +277,7 @@ namespace xAiApi.Providers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual async Task<string> AskTextFromKnowledgeAsync(
|
public virtual async Task<string> AskTextFromKnowledgeAsync(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -316,12 +318,17 @@ namespace xAiApi.Providers
|
|||||||
{
|
{
|
||||||
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
||||||
}
|
}
|
||||||
|
if (type.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
type = XAiModelsConstants.XAiDefaultKnowledgeType;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare Knowledge Request ...
|
// Prepare Knowledge Request ...
|
||||||
var knowledgeRequest = new XAiKnowledgeAskRequest
|
var knowledgeRequest = new XAiKnowledgeAskRequest
|
||||||
{
|
{
|
||||||
TopK = topK,
|
TopK = topK,
|
||||||
|
Type = type,
|
||||||
Prompt = prompt,
|
Prompt = prompt,
|
||||||
IncludeUser = true,
|
IncludeUser = true,
|
||||||
MinScore = minScore,
|
MinScore = minScore,
|
||||||
@@ -361,6 +368,7 @@ namespace xAiApi.Providers
|
|||||||
/// Ask a Question By Rag Retrive From Knowledge and Stream Response ...
|
/// Ask a Question By Rag Retrive From Knowledge and Stream Response ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="userInfo"></param>
|
/// <param name="userInfo"></param>
|
||||||
@@ -368,6 +376,7 @@ namespace xAiApi.Providers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual async IAsyncEnumerable<string> AskTextFromKnowledgeAsEnumerable(
|
public virtual async IAsyncEnumerable<string> AskTextFromKnowledgeAsEnumerable(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
XUserClaimsInfoDto userInfo = null,
|
XUserClaimsInfoDto userInfo = null,
|
||||||
@@ -409,12 +418,17 @@ namespace xAiApi.Providers
|
|||||||
{
|
{
|
||||||
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
||||||
}
|
}
|
||||||
|
if (type.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
type = XAiModelsConstants.XAiDefaultKnowledgeType;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare Knowledge Request ...
|
// Prepare Knowledge Request ...
|
||||||
var knowledgeRequest = new XAiKnowledgeAskRequest
|
var knowledgeRequest = new XAiKnowledgeAskRequest
|
||||||
{
|
{
|
||||||
TopK = topK,
|
TopK = topK,
|
||||||
|
Type = type,
|
||||||
Prompt = prompt,
|
Prompt = prompt,
|
||||||
IncludeUser = true,
|
IncludeUser = true,
|
||||||
MinScore = minScore,
|
MinScore = minScore,
|
||||||
@@ -453,6 +467,7 @@ namespace xAiApi.Providers
|
|||||||
/// Ask a Question as Prompt and Retrieve Response ...
|
/// Ask a Question as Prompt and Retrieve Response ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="projectId"></param>
|
/// <param name="projectId"></param>
|
||||||
@@ -464,6 +479,7 @@ namespace xAiApi.Providers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual async Task<XAiMessageDto> AskAsync(
|
public virtual async Task<XAiMessageDto> AskAsync(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
Guid? projectId = null,
|
Guid? projectId = null,
|
||||||
@@ -508,6 +524,10 @@ namespace xAiApi.Providers
|
|||||||
{
|
{
|
||||||
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
||||||
}
|
}
|
||||||
|
if (type.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
type = XAiModelsConstants.XAiDefaultKnowledgeType;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Project ...
|
// Check Project ...
|
||||||
@@ -599,6 +619,7 @@ namespace xAiApi.Providers
|
|||||||
var knowledgeRequest = new XAiKnowledgeAskRequest
|
var knowledgeRequest = new XAiKnowledgeAskRequest
|
||||||
{
|
{
|
||||||
TopK = topK,
|
TopK = topK,
|
||||||
|
Type = type,
|
||||||
Prompt = prompt,
|
Prompt = prompt,
|
||||||
IncludeUser = true,
|
IncludeUser = true,
|
||||||
MinScore = minScore,
|
MinScore = minScore,
|
||||||
@@ -688,6 +709,7 @@ namespace xAiApi.Providers
|
|||||||
/// Ask a Question as Prompt and Retrieve Response as Async Enumerable ...
|
/// Ask a Question as Prompt and Retrieve Response as Async Enumerable ...
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="prompt"></param>
|
/// <param name="prompt"></param>
|
||||||
|
/// <param name="type"></param>
|
||||||
/// <param name="topK"></param>
|
/// <param name="topK"></param>
|
||||||
/// <param name="minScore"></param>
|
/// <param name="minScore"></param>
|
||||||
/// <param name="projectId"></param>
|
/// <param name="projectId"></param>
|
||||||
@@ -699,6 +721,7 @@ namespace xAiApi.Providers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual async IAsyncEnumerable<XAiResonseMessage> AskAsEnumerable(
|
public virtual async IAsyncEnumerable<XAiResonseMessage> AskAsEnumerable(
|
||||||
string prompt,
|
string prompt,
|
||||||
|
string type = null,
|
||||||
int? topK = null,
|
int? topK = null,
|
||||||
float? minScore = null,
|
float? minScore = null,
|
||||||
Guid? projectId = null,
|
Guid? projectId = null,
|
||||||
@@ -744,6 +767,10 @@ namespace xAiApi.Providers
|
|||||||
{
|
{
|
||||||
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
minScore = configuration.RAGDescriptor.DefaultMinScore;
|
||||||
}
|
}
|
||||||
|
if (type.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
type = XAiModelsConstants.XAiDefaultKnowledgeType;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Project ...
|
// Check Project ...
|
||||||
@@ -835,6 +862,7 @@ namespace xAiApi.Providers
|
|||||||
var knowledgeRequest = new XAiKnowledgeAskRequest
|
var knowledgeRequest = new XAiKnowledgeAskRequest
|
||||||
{
|
{
|
||||||
TopK = topK,
|
TopK = topK,
|
||||||
|
Type = type,
|
||||||
Prompt = prompt,
|
Prompt = prompt,
|
||||||
IncludeUser = true,
|
IncludeUser = true,
|
||||||
MinScore = minScore,
|
MinScore = minScore,
|
||||||
|
|||||||
Reference in New Issue
Block a user