diff --git a/LICENSE.md b/LICENSE.md index 63b4b68..51ea497 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) [year] [fullname] +Copyright (c) 2024 Aidan Tilgner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/main.ts b/main.ts index ff7b688..3e4df61 100644 --- a/main.ts +++ b/main.ts @@ -44,8 +44,6 @@ The goal is to provide the best completion for the given selection, based on the export default class Autogen extends Plugin { settings: AutogenSettings; - typingTimeout: NodeJS.Timeout | null = null; - typingDelay = 2000; openaiClient: OpenAI | null = null; async onload() { @@ -196,7 +194,7 @@ class AutogenSuggest extends EditorSuggest { ): Suggestion[] | Promise { return [ { - label: "Get Suggestions", + label: "Get suggestions", id: "getSuggestions", }, ]; @@ -262,7 +260,7 @@ class AutogenModal extends Modal { contentEl.createEl("br"); const buttonContainer = createEl("div"); - buttonContainer.addClass("modal-button-container"); + buttonContainer.addClass("autogen-modal-button-container"); const confirmButton = createEl("button", { text: "Confirm" }); const cancelButton = createEl("button", { text: "Cancel" }); @@ -320,7 +318,7 @@ class AutogenSettingTab extends PluginSettingTab { apiKeyDesc.appendChild(document.createTextNode(")")); // To add the closing parenthesis new Setting(containerEl) - .setName("OpenAI API Key") + .setName("OpenAI API key") .setDesc(apiKeyDesc) .addText((text) => text @@ -370,7 +368,7 @@ class AutogenSettingTab extends PluginSettingTab { }); new Setting(containerEl) - .setName("Trigger Regex") + .setName("Trigger regex") .setDesc("The regex pattern to trigger the autogen") .addText((text) => text @@ -383,7 +381,7 @@ class AutogenSettingTab extends PluginSettingTab { ); new Setting(containerEl) - .setName("Window Size") + .setName("Window size") .setDesc( "The max number of characters, not including the prompt, to be sent for the generation. This affects token usage and performance." ) @@ -398,7 +396,7 @@ class AutogenSettingTab extends PluginSettingTab { ); new Setting(containerEl) - .setName("System Prompt") + .setName("System prompt") .setDesc("The prompt to send to the OpenAI API") .addTextArea((text) => { text.setPlaceholder("Enter the system prompt") diff --git a/styles.css b/styles.css index 732b21c..a09915c 100644 --- a/styles.css +++ b/styles.css @@ -6,7 +6,7 @@ available in the app when your plugin is enabled. If your plugin does not need CSS, delete this file. */ -.modal-button-container { +.autogen-modal-button-container { display: flex; justify-content: flex-end; align-items: center; diff --git a/utils/openai.ts b/utils/openai.ts index 6b6618c..bebb193 100644 --- a/utils/openai.ts +++ b/utils/openai.ts @@ -2,7 +2,6 @@ import OpenAI from "openai"; import { ChatCompletionCreateParamsBase } from "openai/resources/chat/completions"; export const getClient = (apiKey: string) => { - console.log("Dangerously allowing browser"); return new OpenAI({ apiKey, dangerouslyAllowBrowser: true,