Compare commits

..

No commits in common. "master" and "1.3.1" have entirely different histories.

8 changed files with 4236 additions and 1169 deletions

View file

@ -1,6 +0,0 @@
{
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"printWidth": 100
}

View file

@ -2,7 +2,7 @@
<a href="https://www.buymeacoffee.com/yzh503" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 40px !important;width: 150px !important;" ></a>
**AI Commander** is a simple AI connector that helps you write notes with the power of OpenAI (ChatGPT) APIs in conjunction with Bing search engine.
**AI Commander** is a simple AI connector that helps you write notes with the power of OpenAI APIs in conjunction with Bing search engine.
![Demo](demo.gif)
@ -20,9 +20,9 @@
## Supported models
- GPT models listed in https://platform.openai.com/docs/models/gpt-4
- Whisper v1
- DALL·E image generation model
- OpenAI gpt-3.5-turbo
- OpenAI Whisper
- OpenAI image generation model
## How to use

View file

@ -1,9 +1,9 @@
{
"id": "ai-commander",
"name": "AI Commander",
"version": "1.3.4",
"version": "1.3.1",
"minAppVersion": "1.0.0",
"description": "Generate audio transcripts, images, and text in context of PDF attachments or web search results using OpenAI (ChatGPT) and Bing API.",
"description": "Generate audio transcripts, images, and text in context of PDF attachments or web search results using OpenAI and Bing API.",
"author": "Simon Yang",
"authorUrl": "https://yzh503.github.io",
"fundingUrl": "https://www.buymeacoffee.com/yzh503",

3769
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
{
"name": "obsidian-aicommander-plugin",
"name": "obsidian-sample-plugin",
"version": "1.0.0",
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
"main": "main.js",

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
import { App, Modal } from "obsidian";
import { App, Modal, Setting } from "obsidian";
export class PromptModal extends Modal {
prompt: string;
@ -7,47 +7,34 @@ export class PromptModal extends Modal {
constructor(
app: App,
defaultPrompt: string,
defaultprompt: string,
onSubmit: (prompt: string) => void
) {
super(app);
this.prompt = defaultPrompt;
this.prompt = defaultprompt;
this.onSubmit = onSubmit;
}
onOpen() {
const { contentEl } = this;
// Add a title to the modal
contentEl.createEl("h2", { text: "Generate Text from Prompt" });
contentEl.createEl("h1", { text: "" });
// Create a container for the textarea
const textareaContainer = contentEl.createDiv({ cls: "prompt-modal-textarea-container" });
new Setting(contentEl).setName("Generate text from prompt").addText((text) =>
text.setValue(this.prompt).onChange((value) => {
this.prompt = value;
})
);
// Create the textarea element
const textarea = textareaContainer.createEl("textarea", { cls: "prompt-modal-textarea" });
textarea.value = this.prompt;
textarea.addEventListener("input", () => {
this.prompt = textarea.value;
});
// Create a container for the buttons
const buttonContainer = contentEl.createDiv({ cls: "prompt-modal-button-container" });
// Create the submit button
const submitBtn = buttonContainer.createEl("button", { text: "Submit" });
submitBtn.addClass("mod-cta"); // Obsidian's standard call-to-action button styling
submitBtn.addEventListener("click", () => {
this.close();
this.onSubmit(this.prompt);
});
// Optionally, add a cancel button
const cancelBtn = buttonContainer.createEl("button", { text: "Cancel" });
cancelBtn.addEventListener("click", () => {
this.close();
});
new Setting(contentEl).addButton((btn) =>
btn
.setButtonText("Submit")
.setCta()
.onClick(() => {
this.close();
this.onSubmit(this.prompt);
})
);
}
onClose() {

View file

@ -1,3 +1,3 @@
{
"1.3.4": "1.0.0"
"1.3.1": "1.0.0"
}