Files

25 lines
1010 B
SQL

-- Ported from the SQLite migration of the same number.
-- Keeping requests and answers, for a project that asks: how long, and
-- what share of its requests. Off for every project until set, like
-- conversations: a gateway that keeps no text is the default.
ALTER TABLE projects ADD COLUMN request_log_hours BIGINT;
ALTER TABLE projects ADD COLUMN request_log_sample DOUBLE PRECISION;
-- The request as the model was sent it — after the guardrails' redaction
-- and with any stored conversation spliced in — and the answer as the
-- client was sent it.
CREATE TABLE request_bodies (
request_id TEXT PRIMARY KEY,
project_id TEXT NOT NULL,
ts BIGINT NOT NULL,
expires_at BIGINT NOT NULL,
path TEXT NOT NULL,
model TEXT NOT NULL,
served_model TEXT NOT NULL,
status BIGINT NOT NULL,
request TEXT NOT NULL,
response TEXT NOT NULL,
truncated BIGINT NOT NULL DEFAULT 0
);
CREATE INDEX request_bodies_expiry ON request_bodies (expires_at);