remove redundant obsidian naming
This commit is contained in:
parent
a478baa855
commit
6513249156
|
@ -1,4 +1,4 @@
|
||||||
# Obsidian Intelligence
|
# Intelligence
|
||||||
|
|
||||||
## DISCLAIMER
|
## DISCLAIMER
|
||||||
Educate yourself on the related prices when using large language models like GPT-4 at https://openai.com/pricing. This model uses the Assistants API, which includes the following costs:
|
Educate yourself on the related prices when using large language models like GPT-4 at https://openai.com/pricing. This model uses the Assistants API, which includes the following costs:
|
||||||
|
|
12
main.ts
12
main.ts
|
@ -3,7 +3,7 @@ import { AppView, OBSIDIAN_INTELLIGENCE_VIEW_TYPE } from './src/ui/AppView';
|
||||||
import OpenAI from 'openai';
|
import OpenAI from 'openai';
|
||||||
import { IThread } from './src/ui/types';
|
import { IThread } from './src/ui/types';
|
||||||
|
|
||||||
interface ObsidianIntelligenceSettings {
|
interface IntelligenceSettings {
|
||||||
openaiKey: string;
|
openaiKey: string;
|
||||||
threads: IThread[];
|
threads: IThread[];
|
||||||
activeThread: IThread | undefined;
|
activeThread: IThread | undefined;
|
||||||
|
@ -11,7 +11,7 @@ interface ObsidianIntelligenceSettings {
|
||||||
activeAssistantFiles: OpenAI.Files.FileObject[] | undefined;
|
activeAssistantFiles: OpenAI.Files.FileObject[] | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_SETTINGS: ObsidianIntelligenceSettings = {
|
const DEFAULT_SETTINGS: IntelligenceSettings = {
|
||||||
openaiKey: '',
|
openaiKey: '',
|
||||||
threads: [],
|
threads: [],
|
||||||
activeThread: undefined,
|
activeThread: undefined,
|
||||||
|
@ -19,8 +19,8 @@ const DEFAULT_SETTINGS: ObsidianIntelligenceSettings = {
|
||||||
activeAssistantFiles: undefined,
|
activeAssistantFiles: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default class ObsidianIntelligence extends Plugin {
|
export default class Intelligence extends Plugin {
|
||||||
settings: ObsidianIntelligenceSettings;
|
settings: IntelligenceSettings;
|
||||||
view: AppView;
|
view: AppView;
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
|
@ -85,9 +85,9 @@ export default class ObsidianIntelligence extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
class OISettingTab extends PluginSettingTab {
|
class OISettingTab extends PluginSettingTab {
|
||||||
plugin: ObsidianIntelligence;
|
plugin: Intelligence;
|
||||||
|
|
||||||
constructor(app: App, plugin: ObsidianIntelligence) {
|
constructor(app: App, plugin: Intelligence) {
|
||||||
super(app, plugin);
|
super(app, plugin);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"id": "obsidian-intelligence",
|
"id": "intelligence",
|
||||||
"name": "Obsidian Intelligence",
|
"name": "Intelligence",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "OpenAI GPT Assistants functionality inside Obsidian",
|
"description": "OpenAI GPT Assistants functionality inside Obsidian",
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as React from 'react';
|
||||||
import { Root, createRoot } from 'react-dom/client';
|
import { Root, createRoot } from 'react-dom/client';
|
||||||
import PluginView from './PluginView';
|
import PluginView from './PluginView';
|
||||||
import { App } from 'obsidian';
|
import { App } from 'obsidian';
|
||||||
import ObsidianIntelligence from '../../main';
|
import Intelligence from '../../main';
|
||||||
import OpenAI from 'openai';
|
import OpenAI from 'openai';
|
||||||
|
|
||||||
export const OBSIDIAN_INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view';
|
export const OBSIDIAN_INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view';
|
||||||
|
@ -13,7 +13,7 @@ export const OBSIDIAN_INTELLIGENCE_VIEW_TYPE = 'obsidian-intelligence-view';
|
||||||
export const AppContext = React.createContext<App | undefined>(undefined);
|
export const AppContext = React.createContext<App | undefined>(undefined);
|
||||||
|
|
||||||
export const PluginContext = React.createContext<
|
export const PluginContext = React.createContext<
|
||||||
ObsidianIntelligence | undefined
|
Intelligence | undefined
|
||||||
>(undefined);
|
>(undefined);
|
||||||
|
|
||||||
export const OpenAIContext = React.createContext<OpenAI | undefined>(undefined);
|
export const OpenAIContext = React.createContext<OpenAI | undefined>(undefined);
|
||||||
|
@ -24,7 +24,7 @@ export const useApp = (): App | undefined => {
|
||||||
return React.useContext(AppContext);
|
return React.useContext(AppContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const usePlugin = (): ObsidianIntelligence | undefined => {
|
export const usePlugin = (): Intelligence | undefined => {
|
||||||
return React.useContext(PluginContext);
|
return React.useContext(PluginContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,11 +38,11 @@ export const useOpenAI = (): OpenAI | undefined => {
|
||||||
|
|
||||||
export class AppView extends ItemView {
|
export class AppView extends ItemView {
|
||||||
root: Root | null = null;
|
root: Root | null = null;
|
||||||
plugin: ObsidianIntelligence;
|
plugin: Intelligence;
|
||||||
openAI: OpenAI;
|
openAI: OpenAI;
|
||||||
// commands: ICommandPayload | undefined;
|
// commands: ICommandPayload | undefined;
|
||||||
|
|
||||||
constructor(leaf: WorkspaceLeaf, plugin: ObsidianIntelligence) {
|
constructor(leaf: WorkspaceLeaf, plugin: Intelligence) {
|
||||||
super(leaf);
|
super(leaf);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
const openaiKey = plugin.settings.openaiKey;
|
const openaiKey = plugin.settings.openaiKey;
|
||||||
|
|
Loading…
Reference in New Issue