This commit is contained in:
Mckay Wrigley
2023-03-27 09:38:56 -06:00
committed by GitHub
parent 2269403806
commit 34c79c0d66
51 changed files with 1744 additions and 295 deletions
+24
View File
@@ -0,0 +1,24 @@
import { OpenAIModel } from './openai';
export interface Message {
role: Role;
content: string;
}
export type Role = 'assistant' | 'user';
export interface ChatBody {
model: OpenAIModel;
messages: Message[];
key: string;
prompt: string;
}
export interface Conversation {
id: string;
name: string;
messages: Message[];
model: OpenAIModel;
prompt: string;
folderId: string | null;
}
+4
View File
@@ -0,0 +1,4 @@
export interface KeyValuePair {
key: string;
value: any;
}
-6
View File
@@ -1,6 +0,0 @@
namespace NodeJS {
interface ProcessEnv {
OPENAI_API_KEY: string;
OPENAI_API_HOST?: string;
}
}
+4
View File
@@ -0,0 +1,4 @@
export interface ProcessEnv {
OPENAI_API_KEY: string;
OPENAI_API_HOST?: string;
}
+5
View File
@@ -0,0 +1,5 @@
export interface ErrorMessage {
code: String | null;
title: String;
messageLines: String[];
}
+7
View File
@@ -0,0 +1,7 @@
export interface Folder {
id: string;
name: string;
type: FolderType;
}
export type FolderType = 'chat' | 'prompt';
+1 -69
View File
@@ -1,69 +1 @@
export interface OpenAIModel {
id: string;
name: string;
}
export enum OpenAIModelID {
GPT_3_5 = 'gpt-3.5-turbo',
GPT_4 = 'gpt-4',
}
export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = {
[OpenAIModelID.GPT_3_5]: {
id: OpenAIModelID.GPT_3_5,
name: 'Default (GPT-3.5)',
},
[OpenAIModelID.GPT_4]: {
id: OpenAIModelID.GPT_4,
name: 'GPT-4',
},
};
export interface Message {
role: Role;
content: string;
}
export type Role = 'assistant' | 'user';
export interface ChatFolder {
id: number;
name: string;
}
export interface Conversation {
id: number;
name: string;
messages: Message[];
model: OpenAIModel;
prompt: string;
folderId: number;
}
export interface ChatBody {
model: OpenAIModel;
messages: Message[];
key: string;
prompt: string;
}
export interface KeyValuePair {
key: string;
value: any;
}
// keep track of local storage schema
export interface LocalStorage {
apiKey: string;
conversationHistory: Conversation[];
selectedConversation: Conversation;
theme: 'light' | 'dark';
// added folders (3/23/23)
folders: ChatFolder[];
}
export interface ErrorMessage {
code: String | null;
title: String;
messageLines: String[];
}
export {};
+20
View File
@@ -0,0 +1,20 @@
export interface OpenAIModel {
id: string;
name: string;
}
export enum OpenAIModelID {
GPT_3_5 = 'gpt-3.5-turbo',
GPT_4 = 'gpt-4',
}
export const OpenAIModels: Record<OpenAIModelID, OpenAIModel> = {
[OpenAIModelID.GPT_3_5]: {
id: OpenAIModelID.GPT_3_5,
name: 'Default (GPT-3.5)',
},
[OpenAIModelID.GPT_4]: {
id: OpenAIModelID.GPT_4,
name: 'GPT-4',
},
};
+10
View File
@@ -0,0 +1,10 @@
import { OpenAIModel } from './openai';
export interface Prompt {
id: string;
name: string;
description: string;
content: string;
model: OpenAIModel;
folderId: string | null;
}
+18
View File
@@ -0,0 +1,18 @@
import { Conversation } from './chat';
import { Folder } from './folder';
import { Prompt } from './prompt';
// keep track of local storage schema
export interface LocalStorage {
apiKey: string;
conversationHistory: Conversation[];
selectedConversation: Conversation;
theme: 'light' | 'dark';
// added folders (3/23/23)
folders: Folder[];
// added prompts (3/26/23)
prompts: Prompt[];
// added showChatbar and showPromptbar (3/26/23)
showChatbar: boolean;
showPromptbar: boolean;
}