mirror of
https://github.com/cosmicoptima/loom.git
synced 2026-07-22 07:40:25 +00:00
Compare commits
23 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afbb3519f1 | ||
|
|
53ef92e076 | ||
|
|
518a90f587 | ||
|
|
93599ed192 | ||
|
|
788d91b2b1 | ||
|
|
c624fd9282 | ||
|
|
0aee3e1cff | ||
|
|
6dc19e3196 | ||
|
|
ba0fe89876 | ||
|
|
aadf65783f | ||
|
|
a6341f64b5 | ||
|
|
1b7a7aba56 | ||
|
|
843c212b17 | ||
|
|
753e98a0dc | ||
|
|
5d089d6aa9 | ||
|
|
3c01470388 | ||
|
|
a74d395d38 | ||
|
|
926724a881 | ||
|
|
aa1dba4992 | ||
|
|
d1bae1dcda | ||
|
|
437ef9257f | ||
|
|
4885d53e00 | ||
|
|
52c92e67ff |
6 changed files with 2141 additions and 1410 deletions
31
common.ts
31
common.ts
|
|
@ -1,13 +1,24 @@
|
||||||
export const PROVIDERS = ["cohere", "textsynth", "ocp", "openai", "openai-chat", "azure", "azure-chat", "anthropic"];
|
export const PROVIDERS = [
|
||||||
|
"cohere",
|
||||||
|
"textsynth",
|
||||||
|
"openai-compat",
|
||||||
|
"openai",
|
||||||
|
"openai-chat",
|
||||||
|
"azure",
|
||||||
|
"azure-chat",
|
||||||
|
"anthropic",
|
||||||
|
"openrouter",
|
||||||
|
];
|
||||||
export type Provider = (typeof PROVIDERS)[number];
|
export type Provider = (typeof PROVIDERS)[number];
|
||||||
|
|
||||||
type ProviderProps = {
|
type ProviderProps = {
|
||||||
"openai": { organization: string };
|
openai: { organization: string };
|
||||||
"openai-chat": { organization: string };
|
"openai-chat": { organization: string };
|
||||||
"ocp": { url: string };
|
"openai-compat": { url: string };
|
||||||
"azure": { url: string };
|
azure: { url: string };
|
||||||
"azure-chat": { url: string };
|
"azure-chat": { url: string };
|
||||||
"anthropic": { url: string };
|
anthropic: { url: string };
|
||||||
|
openrouter: { quantization: string };
|
||||||
};
|
};
|
||||||
|
|
||||||
type SharedPresetSettings = {
|
type SharedPresetSettings = {
|
||||||
|
|
@ -18,13 +29,16 @@ type SharedPresetSettings = {
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ModelPreset<P extends Provider> = SharedPresetSettings & (P extends keyof ProviderProps ? ProviderProps[P] : {}) & { provider: P };
|
export type ModelPreset<P extends Provider> = SharedPresetSettings &
|
||||||
|
(P extends keyof ProviderProps ? ProviderProps[P] : {}) & { provider: P };
|
||||||
|
|
||||||
export interface LoomSettings {
|
export interface LoomSettings {
|
||||||
passageFolder: string;
|
passageFolder: string;
|
||||||
defaultPassageSeparator: string;
|
defaultPassageSeparator: string;
|
||||||
defaultPassageFrontmatter: string;
|
defaultPassageFrontmatter: string;
|
||||||
|
|
||||||
|
logApiCalls: boolean;
|
||||||
|
|
||||||
modelPresets: ModelPreset<Provider>[];
|
modelPresets: ModelPreset<Provider>[];
|
||||||
modelPreset: number;
|
modelPreset: number;
|
||||||
|
|
||||||
|
|
@ -37,6 +51,8 @@ export interface LoomSettings {
|
||||||
prepend: string;
|
prepend: string;
|
||||||
bestOf: number;
|
bestOf: number;
|
||||||
n: number;
|
n: number;
|
||||||
|
systemPrompt: string;
|
||||||
|
userMessage: string;
|
||||||
|
|
||||||
showSettings: boolean;
|
showSettings: boolean;
|
||||||
showSearchBar: boolean;
|
showSearchBar: boolean;
|
||||||
|
|
@ -44,7 +60,8 @@ export interface LoomSettings {
|
||||||
showExport: boolean;
|
showExport: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getPreset = (settings: LoomSettings) => settings.modelPresets[settings.modelPreset];
|
export const getPreset = (settings: LoomSettings) =>
|
||||||
|
settings.modelPresets[settings.modelPreset];
|
||||||
|
|
||||||
export type SearchResultState = "result" | "ancestor" | "none" | null;
|
export type SearchResultState = "result" | "ancestor" | "none" | null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "loom",
|
"id": "loom",
|
||||||
"name": "Loom",
|
"name": "Loom",
|
||||||
"version": "1.20.4",
|
"version": "1.22.6",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "Loom in Obsidian",
|
"description": "Loom in Obsidian",
|
||||||
"author": "celeste",
|
"author": "celeste",
|
||||||
|
|
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "obsidian-loom",
|
"name": "obsidian-loom",
|
||||||
"version": "1.20.3",
|
"version": "1.21.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "obsidian-loom",
|
"name": "obsidian-loom",
|
||||||
"version": "1.20.3",
|
"version": "1.21.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/sdk": "^0.20.0",
|
"@anthropic-ai/sdk": "^0.20.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "obsidian-loom",
|
"name": "obsidian-loom",
|
||||||
"version": "1.20.4",
|
"version": "1.22.6",
|
||||||
"description": "Loom in Obsidian",
|
"description": "Loom in Obsidian",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue