Compare commits

...
3 Commits
Author SHA1 Message Date
saherelm c05a389a44 last ... 2026-11-11 12:31:38 +03:30
saherelm 185aaae19a apply fix on Create Conversation Validations ... 2026-11-11 11:56:33 +03:30
saherelm 4fe5d57d37 fix Create Conversation to Handle Default Project Id ... 2026-11-11 11:43:10 +03:30
3 changed files with 26 additions and 12 deletions
+2 -6
View File
@@ -55,9 +55,7 @@ namespace xAiModels.Extensions
//
var result =
!source.IsNullOrDefault() &&
!source.OwnerId.IsNullOrEmpty() &&
!source.ProjectId.IsNull() &&
!source.ProjectId.IsDefaultGuid();
!source.OwnerId.IsNullOrEmpty();
//
return result;
@@ -67,9 +65,7 @@ namespace xAiModels.Extensions
//
var result =
!source.IsNullOrDefault() &&
!source.OwnerId.IsNullOrEmpty() &&
!source.ProjectId.IsNull() &&
!source.ProjectId.IsDefaultGuid();
!source.OwnerId.IsNullOrEmpty();
//
return result;
+1 -1
View File
@@ -237,7 +237,7 @@ namespace xAiModels.Interfaces
/// <returns></returns>
Task<XAiConversationDto> CreateConversation(
string ownerId,
Guid projectId,
Guid? projectId,
XAiConversationDto item = null,
string connectionId = null,
CancellationToken cancellationToken = default
+23 -5
View File
@@ -305,7 +305,7 @@ namespace xAiModels.Providers
{
//
// Validate Args ...
if (!ownerId.IsNullOrEmpty())
if (ownerId.IsNullOrEmpty())
{
XException.InvalidArgs.Throw();
}
@@ -778,7 +778,7 @@ namespace xAiModels.Providers
/// <returns></returns>
public async Task<XAiConversationDto> CreateConversation(
string ownerId,
Guid projectId,
Guid? projectId,
XAiConversationDto item = null,
string connectionId = null,
CancellationToken cancellationToken = default
@@ -786,16 +786,34 @@ namespace xAiModels.Providers
{
//
// Validate Args ...
if (projectId.IsNull() ||
projectId.IsDefaultGuid())
if (ownerId.IsNullOrEmpty())
{
XException.InvalidArgs.Throw();
}
//
if (!projectId.HasValue ||
projectId.Value.IsDefaultGuid())
{
//
var defaultProject = await GetDefaultProject(
ownerId: ownerId,
connectionId: connectionId,
cancellationToken: cancellationToken
);
if (defaultProject.IsNullOrDefault())
{
XException.ActionFailed.Throw();
}
//
projectId = defaultProject.Id;
}
//
// Handle Proejct ...
XAiProjectDto project = await projectRepositoryService.GetAsync(
id: projectId,
id: projectId.Value,
includeBuilder: null,
ignoreSoftDeleteds: true,
// fillConversations: false,