|
@@ -829,6 +829,10 @@ class OpenaiService implements IOpenaiService {
|
|
|
this.createVectorStoreFileWithStream(newVectorStoreRelation, conditions);
|
|
this.createVectorStoreFileWithStream(newVectorStoreRelation, conditions);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (data.shareScope !== AiAssistantShareScope.PUBLIC_ONLY && aiAssistant.isDefault) {
|
|
|
|
|
+ await AiAssistantModel.setDefault(aiAssistant._id, false);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const newData = {
|
|
const newData = {
|
|
|
...data,
|
|
...data,
|
|
|
vectorStore: newVectorStoreRelation ?? aiAssistant.vectorStore,
|
|
vectorStore: newVectorStoreRelation ?? aiAssistant.vectorStore,
|
|
@@ -837,10 +841,6 @@ class OpenaiService implements IOpenaiService {
|
|
|
aiAssistant.set({ ...newData });
|
|
aiAssistant.set({ ...newData });
|
|
|
const updatedAiAssistant = await aiAssistant.save();
|
|
const updatedAiAssistant = await aiAssistant.save();
|
|
|
|
|
|
|
|
- if (data.shareScope !== AiAssistantShareScope.PUBLIC_ONLY && aiAssistant.isDefault) {
|
|
|
|
|
- await AiAssistantModel.setDefault(aiAssistant._id, false);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return updatedAiAssistant;
|
|
return updatedAiAssistant;
|
|
|
}
|
|
}
|
|
|
|
|
|