-
Notifications
You must be signed in to change notification settings - Fork 5
/
tables.sql
84 lines (59 loc) · 2.06 KB
/
tables.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--
-- Name: chatgpt_logs; Type: TABLE; Schema: llm_logs
--
CREATE TABLE "llm_logs".chatgpt_logs (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
request jsonb,
usage_info jsonb,
user_name text,
title text,
response_time timestamp without time zone DEFAULT now(),
response jsonb,
convo_title text,
convo_show boolean DEFAULT true,
root_gpt_id text
);
--
-- Name: COLUMN chatgpt_logs.root_gpt_id; Type: COMMENT; Schema: llm_logs
--
COMMENT ON COLUMN "llm_logs".chatgpt_logs.root_gpt_id IS 'id returned from llm endpoint, used to link multiple interactions into a single conversation';
--
-- Name: COLUMN chatgpt_logs.convo_title; Type: COMMENT; Schema: llm_logs
--
COMMENT ON COLUMN "llm_logs".chatgpt_logs.convo_title IS 'title for the conversation that is being had';
--
-- Name: COLUMN chatgpt_logs.convo_show; Type: COMMENT; Schema: llm_logs
--
COMMENT ON COLUMN "llm_logs".chatgpt_logs.convo_show IS 'whether you want a conversation to be shown in your histories';
--
-- Name: image_logs; Type: TABLE; Schema: llm_logs
--
CREATE TABLE "llm_logs".image_logs (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
request jsonb,
response jsonb,
usage_cost real,
user_name text,
title text,
response_time timestamp without time zone DEFAULT now()
);
--
-- Name: chatgpt_logs chatgpt_logs_id_user_name_key; Type: CONSTRAINT; Schema: llm_logs
--
ALTER TABLE ONLY "llm_logs".chatgpt_logs
ADD CONSTRAINT chatgpt_logs_id_user_name_key UNIQUE (id, user_name);
--
-- Name: chatgpt_logs chatgpt_logs_pkey; Type: CONSTRAINT; Schema: llm_logs
--
ALTER TABLE ONLY "llm_logs".chatgpt_logs
ADD CONSTRAINT chatgpt_logs_pkey PRIMARY KEY (id);
--
-- Name: image_logs image_logs_id_user_name_key; Type: CONSTRAINT; Schema: llm_logs; Owner
--
ALTER TABLE ONLY "llm_logs".image_logs
ADD CONSTRAINT image_logs_id_user_name_key UNIQUE (id, user_name);
--
-- Name: image_logs image_logs_pkey; Type: CONSTRAINT; Schema: llm_logs
--
ALTER TABLE ONLY "llm_logs".image_logs
ADD CONSTRAINT image_logs_pkey PRIMARY KEY (id);