Skip to content

Commit

Permalink
Add new chat.parseWikiLinks option to control whether to send linked …
Browse files Browse the repository at this point in the history
…notes in a chat - fix
  • Loading branch information
justyns committed Feb 29, 2024
1 parent b0bbe62 commit c20a35e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,20 @@ async function initializeOpenAI() {
requireAuth: true,
secretName: "OPENAI_API_KEY",
provider: "OpenAI",
chat: {
parseWikiLinks: true,
},
chat: {},
};
const defaultChatSettings: ChatSettings = {
userInformation: "",
userInstructions: "",
parseWikiLinks: true,
};
const newSettings = await readSetting("ai", {});
const newCombinedSettings = { ...defaultSettings, ...newSettings };
newCombinedSettings.chat = {
...defaultChatSettings,
...(newSettings.chat || {}),
};

if (JSON.stringify(aiSettings) !== JSON.stringify(newCombinedSettings)) {
console.log("aiSettings updating from", aiSettings);
aiSettings = newCombinedSettings;
Expand Down

0 comments on commit c20a35e

Please sign in to comment.