Compare commits
4
Commits
08fd26ffac
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c05a389a44 | ||
|
|
185aaae19a | ||
|
|
4fe5d57d37 | ||
|
|
27b9f51dc9 |
@@ -55,9 +55,7 @@ namespace xAiModels.Extensions
|
|||||||
//
|
//
|
||||||
var result =
|
var result =
|
||||||
!source.IsNullOrDefault() &&
|
!source.IsNullOrDefault() &&
|
||||||
!source.OwnerId.IsNullOrEmpty() &&
|
!source.OwnerId.IsNullOrEmpty();
|
||||||
!source.ProjectId.IsNull() &&
|
|
||||||
!source.ProjectId.IsDefaultGuid();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -67,9 +65,7 @@ namespace xAiModels.Extensions
|
|||||||
//
|
//
|
||||||
var result =
|
var result =
|
||||||
!source.IsNullOrDefault() &&
|
!source.IsNullOrDefault() &&
|
||||||
!source.OwnerId.IsNullOrEmpty() &&
|
!source.OwnerId.IsNullOrEmpty();
|
||||||
!source.ProjectId.IsNull() &&
|
|
||||||
!source.ProjectId.IsDefaultGuid();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ namespace xAiModels.Interfaces
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<XAiConversationDto> CreateConversation(
|
Task<XAiConversationDto> CreateConversation(
|
||||||
string ownerId,
|
string ownerId,
|
||||||
Guid projectId,
|
Guid? projectId,
|
||||||
XAiConversationDto item = null,
|
XAiConversationDto item = null,
|
||||||
string connectionId = null,
|
string connectionId = null,
|
||||||
CancellationToken cancellationToken = default
|
CancellationToken cancellationToken = default
|
||||||
|
|||||||
@@ -778,7 +778,7 @@ namespace xAiModels.Providers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<XAiConversationDto> CreateConversation(
|
public async Task<XAiConversationDto> CreateConversation(
|
||||||
string ownerId,
|
string ownerId,
|
||||||
Guid projectId,
|
Guid? projectId,
|
||||||
XAiConversationDto item = null,
|
XAiConversationDto item = null,
|
||||||
string connectionId = null,
|
string connectionId = null,
|
||||||
CancellationToken cancellationToken = default
|
CancellationToken cancellationToken = default
|
||||||
@@ -786,16 +786,34 @@ namespace xAiModels.Providers
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Validate Args ...
|
// Validate Args ...
|
||||||
if (projectId.IsNull() ||
|
if (ownerId.IsNullOrEmpty())
|
||||||
projectId.IsDefaultGuid())
|
|
||||||
{
|
{
|
||||||
XException.InvalidArgs.Throw();
|
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 ...
|
// Handle Proejct ...
|
||||||
XAiProjectDto project = await projectRepositoryService.GetAsync(
|
XAiProjectDto project = await projectRepositoryService.GetAsync(
|
||||||
id: projectId,
|
id: projectId.Value,
|
||||||
includeBuilder: null,
|
includeBuilder: null,
|
||||||
ignoreSoftDeleteds: true,
|
ignoreSoftDeleteds: true,
|
||||||
// fillConversations: false,
|
// fillConversations: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user