- AskAsync: accept Guid? projectId / conversationId; resolve defaults;
- AskAsync: ingest attached files into Conversation scope (replaceExisting)
via IXAiRAGService instead of Upload + Extract + raw content attachment;
- AskAsync: retrieve context (Conversation -> Project -> User -> Global)
and build a single System message: Introduction + ChatWithDocuments prompt
+ Context block (+ Project prompt);
- XAIServiceBase / XDefaultAiService / XDefaultThinkingAiService:
inject IXAiRAGService instead of IXFileProvider;
- Add IXAiEmbeddingService + XAiEmbeddingService; remove
IXDefaultEmbeddingService + XDefaultEmbeddingService;
- XAiEmbeddingServiceBase no longer inherits XAIServiceBase;
IXAiEmbeddingServiceBase / IXAiEmbeddingServiceControllerBase no longer
extend chat interfaces; XAiEmbeddingServiceControllerBase derives from
XBaseIdentityApiV1Controller;
- XAiRAGService: drop IXDefaultAiService dependency (removes circular
dependency); remove AskWithRAGAsync / AskWithRAGAsEnumerable; add file
reference (AddReference) for scoped ingests;
- KnowledgeController: remove POST Ask and POST AskStream;
- DI: add AddXRagService() and call it from Startup before AddXAiServices();
- Add XAiApiRagPromptName = "ChatWithDocuments";
- Knowledge scope factories default Type to XAiDefaultKnowledgeType;
- ChatWithDocuments ask request: TopK and MinScore are now required.
BREAKING: /Knowledge/Ask and /Knowledge/AskStream removed;
IXDefaultEmbeddingService replaced by IXAiEmbeddingService.
42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using xAiApi.Constants;
|
|
using xAiApi.Interfaces;
|
|
using xCommons.Providers;
|
|
using xAiModels.Interfaces;
|
|
using xAiApi.Configurations;
|
|
using Microsoft.Extensions.AI;
|
|
using Microsoft.Extensions.Logging;
|
|
using xAiApi.Interfaces.Extractors;
|
|
|
|
namespace xAiApi.Providers
|
|
{
|
|
public class XDefaultThinkingAiService : XAIServiceBase, IXDefaultThinkingAiService
|
|
{
|
|
public XDefaultThinkingAiService(
|
|
IXAiRAGService ragProvider,
|
|
IXAiDataProvider dataProvider,
|
|
ILogger<XAIServiceBase> logger,
|
|
XAiApiConfiguration configuration,
|
|
XValidationProvider validationProvider,
|
|
IXFileContentExtractor fileContentExtractor,
|
|
ReasoningEffort effort = ReasoningEffort.Medium,
|
|
ReasoningOutput output = ReasoningOutput.Full
|
|
) : base(
|
|
ragProvider,
|
|
dataProvider,
|
|
logger,
|
|
configuration,
|
|
validationProvider,
|
|
fileContentExtractor,
|
|
XAiApiConstants.XAiDefaultThinkingModelName
|
|
)
|
|
{
|
|
//
|
|
// Preparing Reasoning ...
|
|
Options.Reasoning = new ReasoningOptions
|
|
{
|
|
Output = output,
|
|
Effort = effort,
|
|
};
|
|
}
|
|
}
|
|
} |