Prompts (#229)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface KeyValuePair {
|
||||
key: string;
|
||||
value: any;
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
OPENAI_API_KEY: string;
|
||||
OPENAI_API_HOST?: string;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface ProcessEnv {
|
||||
OPENAI_API_KEY: string;
|
||||
OPENAI_API_HOST?: string;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export interface ErrorMessage {
|
||||
code: String | null;
|
||||
title: String;
|
||||
messageLines: String[];
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export interface Folder {
|
||||
id: string;
|
||||
name: string;
|
||||
type: FolderType;
|
||||
}
|
||||
|
||||
export type FolderType = 'chat' | 'prompt';
|
||||
+1
-69
@@ -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 {};
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
import { OpenAIModel } from './openai';
|
||||
|
||||
export interface Prompt {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
content: string;
|
||||
model: OpenAIModel;
|
||||
folderId: string | null;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user