mirror of
https://github.com/mossy1022/Smart-Memos.git
synced 2026-07-22 05:16:24 +00:00
Updated to include transcript option + removed need to set attachment file dir
This commit is contained in:
parent
75f2756aae
commit
e0de8dd7e8
5 changed files with 26 additions and 24 deletions
37
main.ts
37
main.ts
|
|
@ -4,14 +4,14 @@ interface AudioPluginSettings {
|
|||
model: string;
|
||||
apiKey: string;
|
||||
prompt: string;
|
||||
attachmentFolderPath: string;
|
||||
includeTranscript: boolean;
|
||||
}
|
||||
|
||||
let DEFAULT_SETTINGS: AudioPluginSettings = {
|
||||
model: 'gpt-4-0613',
|
||||
apiKey: '',
|
||||
prompt: 'You are an expert note-making AI for obsidian who specializes in the Linking Your Thinking (LYK) strategy. The following is a transcription of recording of someone talking aloud or people in a conversation. There may be a lot of random things said given fluidity of conversation or thought process and the microphone\'s ability to pick up all audio. Give me detailed notes in markdown language on what was said in the most easy-to-understand, detailed, and conceptual format. Include any helpful information that can conceptualize the notes further or enhance the ideas, and then summarize what was said. Do not mention \"the speaker\" anywhere in your response. The notes your write should be written as if I were writting them. Finally, ensure to end with code for a mermaid chart that shows an enlightening concept map combining both the transcription and the information you added to it. The following is the transcribed audio:\n\n',
|
||||
attachmentFolderPath: 'Resources' // Default path set to "Resources" folder
|
||||
includeTranscript: true
|
||||
}
|
||||
|
||||
interface TokenLimits {
|
||||
|
|
@ -50,12 +50,17 @@ export default class SmartMemosPlugin extends Plugin {
|
|||
transcript: string;
|
||||
|
||||
apiKey: string = 'sk-as123mkqwenjasdasdj12...';
|
||||
model: string = 'gpt-3.5-turbo-16k';
|
||||
model: string = 'gpt-4-0613';
|
||||
|
||||
appJsonObj : any;
|
||||
|
||||
async onload() {
|
||||
|
||||
await this.loadSettings();
|
||||
|
||||
const app_json = await this.app.vault.adapter.read(".obsidian/app.json");
|
||||
this.appJsonObj = JSON.parse(app_json);
|
||||
|
||||
|
||||
this.addCommand({
|
||||
id: 'open-transcript-modal',
|
||||
|
|
@ -158,8 +163,7 @@ export default class SmartMemosPlugin extends Plugin {
|
|||
if (filename == '') throw new Error('No file found in the text.');
|
||||
|
||||
// Use the attachment folder path from the plugin settings
|
||||
const attachmentFolderPath = this.settings.attachmentFolderPath || '/';
|
||||
const fullPath = attachmentFolderPath + '/' + filename;
|
||||
const fullPath = this.appJsonObj.attachmentFolderPath + '/' + filename;
|
||||
|
||||
const file = this.app.vault.getAbstractFileByPath(fullPath);
|
||||
if (file instanceof TFile) {
|
||||
|
|
@ -288,9 +292,6 @@ class SmartMemosSettingTab extends PluginSettingTab {
|
|||
constructor(app: App, plugin: SmartMemosPlugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
|
||||
this.plugin.settings.prompt = 'You are an expert note-making AI for obsidian who specializes in the Linking Your Thinking (LYK) strategy. The following is a transcription of recording of someone talking aloud or people in a conversation. There may be a lot of random things said given fluidity of conversation or thought process and the microphone\'s ability to pick up all audio. Give me detailed notes on what was said in the most easy-to-understand, detailed, and conceptual format. Include any helpful information that can conceptualize the notes further or enhance the ideas, and then summarize what was said. Do not mention the speaker, the notes your write should be written as if they were me writting them. Finally, ensure the type format is readme and end with code for a mermaid chart that shows an enlightening concept map combining both the transcription and the information you added to it. The following is the transcribed audio:\n\n';
|
||||
this.plugin.settings.model = 'gpt-3.5-turbo-16k';
|
||||
}
|
||||
|
||||
display(): void {
|
||||
|
|
@ -298,16 +299,6 @@ class SmartMemosSettingTab extends PluginSettingTab {
|
|||
|
||||
containerEl.empty();
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Attachment Folder Path')
|
||||
.setDesc('Path to the folder where attachments are stored after import. Check "attachment folder path" within "files and links" of obsidian settings')
|
||||
.addText(text => text
|
||||
.setValue(this.plugin.settings.attachmentFolderPath)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.attachmentFolderPath = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('OpenAI api key')
|
||||
.setDesc('Ex: sk-as123mkqwenjasdasdj12...')
|
||||
|
|
@ -350,5 +341,15 @@ class SmartMemosSettingTab extends PluginSettingTab {
|
|||
this.plugin.settings.prompt = value;
|
||||
await this.plugin.saveSettings();
|
||||
})});
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Include Transcript')
|
||||
.setDesc('Toggle this setting if you want to include the raw transcript on top of custom notes.')
|
||||
.addToggle(toggle => toggle
|
||||
.setValue(this.plugin.settings.includeTranscript)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.includeTranscript = value;
|
||||
await this.plugin.saveSettings();
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "smart-memos",
|
||||
"name": "Smart Memos",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Create personalized and intelligent analysis, summaries, and more for audio recordings that can be imported or spoken directly into a note",
|
||||
"author": "Evan Moscoso",
|
||||
|
|
|
|||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -1,19 +1,19 @@
|
|||
{
|
||||
"name": "smart-memos",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "smart-memos",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.7",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bootstrap": "^5.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/d3": "^7.4.3",
|
||||
"@types/node": "^16.11.6",
|
||||
"@types/node": "^16.18.101",
|
||||
"@typescript-eslint/eslint-plugin": "5.29.0",
|
||||
"@typescript-eslint/parser": "5.29.0",
|
||||
"builtin-modules": "3.3.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "smart-memos",
|
||||
"version": "1.0.6",
|
||||
"version": "1.0.7",
|
||||
"description": "Create personalized and intelligent analysis, summaries, and more for audio recordings that can be imported or spoken directly into a note",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/d3": "^7.4.3",
|
||||
"@types/node": "^16.11.6",
|
||||
"@types/node": "^16.18.101",
|
||||
"@typescript-eslint/eslint-plugin": "5.29.0",
|
||||
"@typescript-eslint/parser": "5.29.0",
|
||||
"builtin-modules": "3.3.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"inlineSourceMap": true,
|
||||
"inlineSources": true,
|
||||
"module": "ESNext",
|
||||
|
|
|
|||
Loading…
Reference in a new issue