Make projectId Nullable in Data Provider and Remove Api Configuration

- IXAiDataProvider.GetDefaultConversation: projectId changed from Guid to Guid?;
- XAiDataProvider.GetDefaultConversation / HasDefaultConversation /
  CreateDefaultConversation: adapt to Guid? (use !projectId.HasValue instead of
  projectId.IsNull(); resolve project via projectId.Value);
- XAiDataProvider: conversation lookup predicate fixed to
  x.ProjectId == project.Id (was x.ProjectId == projectId);
- XEmbeddingExtensions: add ToEmbedding(this ReadOnlyMemory<float>) to persist
  embeddings as JSON;
- XAiDataProvider: use item.Embedding.ToEmbedding() instead of ToJSON() when
  upserting vectors;
- XAiModelsExtensions: rename GetDafualtProject -> GetDafaultProject (typo fix);
- Remove Configurations/XAiApiConfiguration.cs and
  Extensions/XAiApiConfigurationExtensions.cs (Api configuration does not belong
  to the models module).
BREAKING: XAiApiConfiguration / XAiApiConfigurationExtensions removed from
          xAiModels; GetDafualtProject renamed to GetDafaultProject.
This commit is contained in:
2026-11-02 16:37:27 +03:30
parent c4b7e86174
commit 9e7710e345
6 changed files with 41 additions and 89 deletions
+1 -1
View File
@@ -197,7 +197,7 @@ namespace xAiModels.Interfaces
/// <returns></returns>
Task<XAiConversationDto> GetDefaultConversation(
string ownerId,
Guid projectId,
Guid? projectId,
string connectionId = null,
CancellationToken cancellationToken = default
);