cosmicoptima_loom/common.ts

58 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-07-01 03:58:09 +00:00
export const PROVIDERS = ["cohere", "textsynth", "ocp", "openai", "openai-chat", "azure", "azure-chat"];
export type Provider = (typeof PROVIDERS)[number];
export interface LoomSettings {
openaiApiKey: string;
openaiOrganization: string;
cohereApiKey: string;
textsynthApiKey: string;
azureApiKey: string;
azureEndpoint: string;
ocpApiKey: string;
ocpUrl: string;
2023-07-03 06:34:18 +00:00
passageFolder: string;
defaultPassageSeparator: string;
defaultPassageFrontmatter: string;
2023-07-01 03:58:09 +00:00
provider: Provider;
model: string;
2023-10-02 22:13:31 +00:00
contextLength: number;
2023-07-01 03:58:09 +00:00
maxTokens: number;
temperature: number;
topP: number;
frequencyPenalty: number;
presencePenalty: number;
2023-11-06 21:02:16 +00:00
prepend: string;
2023-11-05 04:54:44 +00:00
bestOf: number;
2023-07-01 03:58:09 +00:00
n: number;
showSettings: boolean;
2023-07-15 23:36:34 +00:00
showSearchBar: boolean;
2023-07-01 03:58:09 +00:00
showNodeBorders: boolean;
showExport: boolean;
}
2023-07-15 23:36:34 +00:00
export type SearchResultState = "result" | "ancestor" | "none" | null;
2023-07-01 03:58:09 +00:00
export interface Node {
text: string;
parentId: string | null;
collapsed: boolean;
unread: boolean;
bookmarked: boolean;
lastVisited?: number;
2023-07-15 23:36:34 +00:00
searchResultState: SearchResultState;
2023-07-01 03:58:09 +00:00
}
export interface NoteState {
current: string;
hoisted: string[];
2023-07-15 23:36:34 +00:00
searchTerm: string;
2023-07-01 03:58:09 +00:00
nodes: Record<string, Node>;
generating: string | null;
}