|
@@ -35,7 +35,7 @@ const findAssistantByName = async(assistantName: string): Promise<OpenAI.Beta.As
|
|
|
|
|
|
|
|
const getOrCreateAssistant = async(type: AssistantType): Promise<OpenAI.Beta.Assistant> => {
|
|
const getOrCreateAssistant = async(type: AssistantType): Promise<OpenAI.Beta.Assistant> => {
|
|
|
const appSiteUrl = configManager.getConfig('crowi', 'app:siteUrl');
|
|
const appSiteUrl = configManager.getConfig('crowi', 'app:siteUrl');
|
|
|
- const assistantName = `GROWI ${type} Assistant for ${appSiteUrl} ${configManager.getConfig('crowi', 'app:openaiAssistantNameSuffix')}}`;
|
|
|
|
|
|
|
+ const assistantName = `GROWI ${type} Assistant for ${appSiteUrl} ${configManager.getConfig('crowi', 'openai:assistantNameSuffix')}}`;
|
|
|
|
|
|
|
|
const assistantOnRemote = await findAssistantByName(assistantName);
|
|
const assistantOnRemote = await findAssistantByName(assistantName);
|
|
|
if (assistantOnRemote != null) {
|
|
if (assistantOnRemote != null) {
|
|
@@ -58,7 +58,7 @@ export const getOrCreateSearchAssistant = async(): Promise<OpenAI.Beta.Assistant
|
|
|
|
|
|
|
|
searchAssistant = await getOrCreateAssistant(AssistantType.SEARCH);
|
|
searchAssistant = await getOrCreateAssistant(AssistantType.SEARCH);
|
|
|
openaiClient.beta.assistants.update(searchAssistant.id, {
|
|
openaiClient.beta.assistants.update(searchAssistant.id, {
|
|
|
- instructions: configManager.getConfig('crowi', 'app:openaiSearchAssistantInstructions'),
|
|
|
|
|
|
|
+ instructions: configManager.getConfig('crowi', 'openai:searchAssistantInstructions'),
|
|
|
tools: [{ type: 'file_search' }],
|
|
tools: [{ type: 'file_search' }],
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -72,7 +72,7 @@ export const getOrCreateChatAssistant = async(): Promise<OpenAI.Beta.Assistant>
|
|
|
return chatAssistant;
|
|
return chatAssistant;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const instructions = configManager.getConfig('crowi', 'app:openaiChatAssistantInstructions');
|
|
|
|
|
|
|
+ const instructions = configManager.getConfig('crowi', 'openai:chatAssistantInstructions');
|
|
|
|
|
|
|
|
chatAssistant = await getOrCreateAssistant(AssistantType.CHAT);
|
|
chatAssistant = await getOrCreateAssistant(AssistantType.CHAT);
|
|
|
openaiClient.beta.assistants.update(chatAssistant.id, {
|
|
openaiClient.beta.assistants.update(chatAssistant.id, {
|