diff --git a/bifrost/app/pi/first_page/page.tsx b/bifrost/app/pi/first_page/page.tsx index b4ba9481c..5132be0a4 100644 --- a/bifrost/app/pi/first_page/page.tsx +++ b/bifrost/app/pi/first_page/page.tsx @@ -6,30 +6,51 @@ import { useRouter } from "next/navigation"; import { Suspense } from "react"; import { useHeliconeLogin } from "./../useHeliconeLogin"; import { useTestAPIKey } from "./useTestApiKey"; +import { useQuery } from "@tanstack/react-query"; const jetbrainsMono = JetBrains_Mono({ subsets: ["latin"] }); const FirstPageContent = () => { - const jawn = useJawnClient(); const { apiKey, sessionUUID } = useHeliconeLogin(); const { data, isLoading } = useTestAPIKey(apiKey.data ?? ""); + const jawn = useJawnClient(apiKey.data ?? ""); const router = useRouter(); - if ((!data && !isLoading) || !apiKey.data) { + router.push("/pi/total-requests"); + const orgName = useQuery({ + queryKey: ["org-name", apiKey.data], + queryFn: () => jawn.POST("/v1/pi/org-name/query"), + }); + + const totalCosts = useQuery({ + queryKey: ["total-costs", apiKey.data], + queryFn: () => jawn.POST("/v1/pi/total-costs"), + }); + + const costsOverTime = useQuery({ + queryKey: ["costs-over-time", apiKey.data], + queryFn: () => + jawn.POST("/v1/pi/costs-over-time/query", { + body: { + userFilter: "all", + dbIncrement: "day", + timeZoneDifference: new Date().getTimezoneOffset(), + timeFilter: { + start: new Date( + Date.now() - 30 * 24 * 60 * 60 * 1000 + ).toISOString(), + end: new Date().toISOString(), + }, + }, + }), + }); + + if (!data && !isLoading && !apiKey.data && !apiKey.isLoading) { router.push("/pi/setup?invalid_api_key=true"); return
Loading...
; } - return ( -
-

- LOGGED IN! WOOOHOO -

- {data && JSON.stringify(data).slice(0, 100)} -
- ); + return
; }; const PiPage = () => { diff --git a/bifrost/app/pi/page.tsx b/bifrost/app/pi/page.tsx index ac6607ad4..42b9e4d82 100644 --- a/bifrost/app/pi/page.tsx +++ b/bifrost/app/pi/page.tsx @@ -13,16 +13,16 @@ const jetbrainsMono = JetBrains_Mono({ subsets: ["latin"] }); const PiPageContent = () => { return ( -
-

+
+

Welcome to Helicone!

Helicone Logo { Start diff --git a/bifrost/app/pi/setup/page.tsx b/bifrost/app/pi/setup/page.tsx index d61b6a8af..1cb9b565c 100644 --- a/bifrost/app/pi/setup/page.tsx +++ b/bifrost/app/pi/setup/page.tsx @@ -19,8 +19,8 @@ const PiPageContent = () => { ); const { data, isLoading } = useTestAPIKey(apiKey.data ?? ""); - if (apiKey.data && data && !isLoading) { - router.push("/pi/first_page"); + if (apiKey.data && data && !isLoading && !apiKey.isLoading) { + router.push("/pi/total-requests"); return
Loading...
; } @@ -34,7 +34,7 @@ const PiPageContent = () => {
Helicone Logo { + const { apiKey } = useHeliconeLogin(); + const { data, isLoading } = useTestAPIKey(apiKey.data ?? ""); + const router = useRouter(); + + const jawn = useJawnClient(apiKey.data ?? ""); + + const totalRequests = useQuery({ + queryKey: ["total-requests", apiKey.data], + queryFn: () => jawn.POST("/v1/pi/total_requests"), + }); + + const costsOverTime = useQuery({ + queryKey: ["costs-over-time", apiKey.data], + queryFn: () => + jawn.POST("/v1/pi/costs-over-time/query", { + body: { + userFilter: "all", + dbIncrement: "day", + timeZoneDifference: new Date().getTimezoneOffset(), + timeFilter: { + start: new Date( + Date.now() - 30 * 24 * 60 * 60 * 1000 + ).toISOString(), + end: new Date().toISOString(), + }, + }, + }), + }); + const costsOverTimeData = costsOverTime.data?.data?.data; + + if (!data && !isLoading && !apiKey.data && !apiKey.isLoading) { + router.push("/pi/setup?invalid_api_key=true"); + return null; + } + + return ( +
+
+
+
Total Cost
+
+ $ + {costsOverTimeData + ?.reduce((sum, item) => sum + item.cost, 0) + ?.toFixed(2) ?? "0.00"} +
+
+
+
+
costs
+
+ + + + + new Date(value).toLocaleDateString(undefined, { + month: "numeric", + day: "numeric", + year: "2-digit", + }) + } + includeHidden + interval={6} + tickSize={14} + padding={{ left: 16, right: 16 }} + tickMargin={8} + fontSize={12} + strokeWidth={1.52} + stroke="#000000" + /> + {/* */} + + + +
+
+ + {/* eslint-disable-next-line @next/next/no-img-element */} + arrow-left + + + + {/* eslint-disable-next-line @next/next/no-img-element */} + arrow-right + +
+
+ ); +}; + +export default TotalCost; diff --git a/bifrost/app/pi/total-requests/page.tsx b/bifrost/app/pi/total-requests/page.tsx new file mode 100644 index 000000000..f427a4cbf --- /dev/null +++ b/bifrost/app/pi/total-requests/page.tsx @@ -0,0 +1,180 @@ +"use client"; + +import { useRouter } from "next/navigation"; +import { useHeliconeLogin } from "../useHeliconeLogin"; + +import { JetBrains_Mono } from "next/font/google"; +import { useTestAPIKey } from "../first_page/useTestApiKey"; +import { useJawnClient } from "@/lib/clients/jawnHook"; +import { useQuery } from "@tanstack/react-query"; +import Link from "next/link"; +const jetbrainsMono = JetBrains_Mono({ subsets: ["latin"] }); + +const formatNumber = ( + number: number +): [ + number | null, + number | null, + "." | "," | number | null, + number | null | ".", + number | null, + number | null | "B" | "M" +] => { + if (number < 10) { + return [null, null, null, null, null, number]; + } else if (number < 100) { + return [ + null, + null, + null, + null, + Number(number.toString().split("")[0]), + Number(number.toString().split("")[1]), + ]; + } else if (number < 1000) { + return [ + null, + null, + null, + Number(number.toString().split("")[0]), + Number(number.toString().split("")[1]), + Number(number.toString().split("")[2]), + ]; + } else if (number < 10000) { + return [ + null, + Number(number.toString().split("")[0]), + ",", + Number(number.toString().split("")[1]), + Number(number.toString().split("")[2]), + Number(number.toString().split("")[3]), + ]; + } else if (number < 100_000) { + return [ + Number(number.toString().split("")[0]), + Number(number.toString().split("")[1]), + ",", + Number(number.toString().split("")[2]), + Number(number.toString().split("")[3]), + Number(number.toString().split("")[4]), + ]; + } else if (number < 1_000_000) { + // 2,345,678 = _,2,.,3,4,M + return [ + null, + Number(number.toString().split("")[0]), + ".", + Number(number.toString().split("")[1]), + Number(number.toString().split("")[2]), + "M", + ]; + } else if (number < 10_000_000) { + // 23,456,789 = 2,3,.,4,5,M + return [ + Number(number.toString().split("")[0]), + Number(number.toString().split("")[1]), + ".", + Number(number.toString().split("")[2]), + Number(number.toString().split("")[3]), + "M", + ]; + } else if (number < 100_000_000) { + // 234,567,890 = 2,3,4,.,5,M + return [ + Number(number.toString().split("")[0]), + Number(number.toString().split("")[1]), + Number(number.toString().split("")[2]), + ".", + Number(number.toString().split("")[3]), + "M", + ]; + } else if (number < 1_000_000_000) { + // 245,678,901 = _,_,2,4,5,M + return [ + null, + null, + Number(number.toString().split("")[0]), + Number(number.toString().split("")[1]), + Number(number.toString().split("")[2]), + "M", + ]; + } else if (number < 10_000_000_000) { + // 1,234,567,890 = _,1,.,2,3,B + return [ + null, + Number(number.toString().split("")[0]), + ".", + Number(number.toString().split("")[1]), + Number(number.toString().split("")[2]), + "B", + ]; + } else { + return [null, null, null, null, null, null]; + } +}; + +const TotalRequestsPage = () => { + const { apiKey } = useHeliconeLogin(); + const { data, isLoading } = useTestAPIKey(apiKey.data ?? ""); + const router = useRouter(); + + const jawn = useJawnClient(apiKey.data ?? ""); + + const totalRequests = useQuery({ + queryKey: ["total-requests", apiKey.data], + queryFn: () => jawn.POST("/v1/pi/total_requests"), + }); + + if (!data && !isLoading && !apiKey.data && !apiKey.isLoading) { + router.push("/pi/setup?invalid_api_key=true"); + return null; + } + + return ( +
+
+
+ Total Requests +
{" "} +
+ {formatNumber(totalRequests.data?.data?.data ?? 0).map( + (num, index) => ( +
+ {num} +
+ ) + )} +
+
+ Last 30 days +
+ {/* {JSON.stringify(formatNumber(totalRequests.data?.data?.data ?? 0))} */} +
+
+ + {/* eslint-disable-next-line @next/next/no-img-element */} + arrow-left + + + {/* eslint-disable-next-line @next/next/no-img-element */} + arrow-left + +
+
+ ); +}; + +export default TotalRequestsPage; diff --git a/bifrost/app/pi/useHeliconeLogin.ts b/bifrost/app/pi/useHeliconeLogin.ts index 81cfb7f08..0358474c6 100644 --- a/bifrost/app/pi/useHeliconeLogin.ts +++ b/bifrost/app/pi/useHeliconeLogin.ts @@ -78,6 +78,7 @@ export const useHeliconeLogin = (invalid_api_key?: boolean) => { return apiKey.data?.data?.apiKey; }, refetchInterval: 10_000, // 1 second + staleTime: 0, }); return { diff --git a/bifrost/lib/clients/jawn.ts b/bifrost/lib/clients/jawn.ts index c8903e11e..39114f488 100644 --- a/bifrost/lib/clients/jawn.ts +++ b/bifrost/lib/clients/jawn.ts @@ -3,7 +3,7 @@ import type { paths as privatePaths } from "./jawnTypes/private"; import createClient from "openapi-fetch"; export type JawnFilterNode = any; -export function getJawnClient(orgId?: string | "none") { +export function getJawnClient(apiKey?: string) { // const jwtToken = getHeliconeCookie().data?.jwtToken; // const headers = // orgId !== "none" @@ -19,6 +19,9 @@ export function getJawnClient(orgId?: string | "none") { return createClient({ baseUrl: process.env.NEXT_PUBLIC_HELICONE_JAWN_SERVICE ?? "http://localhost:8585", + headers: { + Authorization: `Bearer ${apiKey}`, + }, }); } diff --git a/bifrost/lib/clients/jawnHook.tsx b/bifrost/lib/clients/jawnHook.tsx index 5265eb318..ec6d63be4 100644 --- a/bifrost/lib/clients/jawnHook.tsx +++ b/bifrost/lib/clients/jawnHook.tsx @@ -1,6 +1,6 @@ import { getJawnClient } from "./jawn"; -export const useJawnClient = () => { +export const useJawnClient = (apiKey?: string) => { // const org = useOrg(); - return getJawnClient(); + return getJawnClient(apiKey); }; diff --git a/bifrost/lib/clients/jawnTypes/private.ts b/bifrost/lib/clients/jawnTypes/private.ts index 9edb00ad0..1ae4e696a 100644 --- a/bifrost/lib/clients/jawnTypes/private.ts +++ b/bifrost/lib/clients/jawnTypes/private.ts @@ -301,27 +301,6 @@ export interface paths { "/v1/integration/slack/channels": { get: operations["GetSlackChannels"]; }; - "/v1/experiment/dataset": { - post: operations["AddDataset"]; - }; - "/v1/experiment/dataset/random": { - post: operations["AddRandomDataset"]; - }; - "/v1/experiment/dataset/query": { - post: operations["GetDatasets"]; - }; - "/v1/experiment/dataset/{datasetId}/row/insert": { - post: operations["InsertDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { - post: operations["CreateDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/inputs/query": { - post: operations["GetDataset"]; - }; - "/v1/experiment/dataset/{datasetId}/mutate": { - post: operations["MutateDataset"]; - }; "/v1/experiment/new-empty": { post: operations["CreateNewEmptyExperiment"]; }; @@ -378,6 +357,27 @@ export interface paths { "/v1/experiment/query": { post: operations["GetExperimentsOld"]; }; + "/v1/experiment/dataset": { + post: operations["AddDataset"]; + }; + "/v1/experiment/dataset/random": { + post: operations["AddRandomDataset"]; + }; + "/v1/experiment/dataset/query": { + post: operations["GetDatasets"]; + }; + "/v1/experiment/dataset/{datasetId}/row/insert": { + post: operations["InsertDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + post: operations["CreateDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/inputs/query": { + post: operations["GetDataset"]; + }; + "/v1/experiment/dataset/{datasetId}/mutate": { + post: operations["MutateDataset"]; + }; "/v1/helicone-dataset": { post: operations["AddHeliconeDataset"]; }; @@ -523,6 +523,18 @@ export interface paths { "/v1/pi/session": { post: operations["AddSession"]; }; + "/v1/pi/org-name/query": { + post: operations["GetOrgName"]; + }; + "/v1/pi/total-costs": { + post: operations["GetTotalCosts"]; + }; + "/v1/pi/total_requests": { + post: operations["GetTotalRequests"]; + }; + "/v1/pi/costs-over-time/query": { + post: operations["GetCostsOverTime"]; + }; "/v1/settings/query": { get: operations["GetSettings"]; }; @@ -2372,64 +2384,6 @@ Json: JsonObject; error: null; }; "Result_Array__id-string--name-string__.string_": components["schemas"]["ResultSuccess_Array__id-string--name-string___"] | components["schemas"]["ResultError_string_"]; - "ResultSuccess__datasetId-string__": { - data: { - datasetId: string; - }; - /** @enum {number|null} */ - error: null; - }; - "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; - DatasetMetadata: { - promptVersionId?: string; - inputRecordsIds?: string[]; - }; - NewDatasetParams: { - datasetName: string; - requestIds: string[]; - /** @enum {string} */ - datasetType: "experiment" | "helicone"; - meta?: components["schemas"]["DatasetMetadata"]; - }; - /** @description From T, pick a set of properties whose keys are in the union K */ - "Pick_FilterLeaf.request-or-prompts_versions_": { - request?: components["schemas"]["Partial_RequestTableToOperators_"]; - prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; - }; - "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; - DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; - DatasetFilterBranch: { - right: components["schemas"]["DatasetFilterNode"]; - /** @enum {string} */ - operator: "or" | "and"; - left: components["schemas"]["DatasetFilterNode"]; - }; - RandomDatasetParams: { - datasetName: string; - filter: components["schemas"]["DatasetFilterNode"]; - /** Format: double */ - offset?: number; - /** Format: double */ - limit?: number; - }; - DatasetResult: { - id: string; - name: string; - created_at: string; - meta?: components["schemas"]["DatasetMetadata"]; - }; - "ResultSuccess_DatasetResult-Array_": { - data: components["schemas"]["DatasetResult"][]; - /** @enum {number|null} */ - error: null; - }; - "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; - "ResultSuccess___-Array_": { - data: Record[]; - /** @enum {number|null} */ - error: null; - }; - "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; "ResultSuccess__tableId-string--experimentId-string__": { data: { experimentId: string; @@ -2659,6 +2613,64 @@ Json: JsonObject; /** @enum {boolean} */ score?: true; }; + "ResultSuccess__datasetId-string__": { + data: { + datasetId: string; + }; + /** @enum {number|null} */ + error: null; + }; + "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; + DatasetMetadata: { + promptVersionId?: string; + inputRecordsIds?: string[]; + }; + NewDatasetParams: { + datasetName: string; + requestIds: string[]; + /** @enum {string} */ + datasetType: "experiment" | "helicone"; + meta?: components["schemas"]["DatasetMetadata"]; + }; + /** @description From T, pick a set of properties whose keys are in the union K */ + "Pick_FilterLeaf.request-or-prompts_versions_": { + request?: components["schemas"]["Partial_RequestTableToOperators_"]; + prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; + }; + "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; + DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; + DatasetFilterBranch: { + right: components["schemas"]["DatasetFilterNode"]; + /** @enum {string} */ + operator: "or" | "and"; + left: components["schemas"]["DatasetFilterNode"]; + }; + RandomDatasetParams: { + datasetName: string; + filter: components["schemas"]["DatasetFilterNode"]; + /** Format: double */ + offset?: number; + /** Format: double */ + limit?: number; + }; + DatasetResult: { + id: string; + name: string; + created_at: string; + meta?: components["schemas"]["DatasetMetadata"]; + }; + "ResultSuccess_DatasetResult-Array_": { + data: components["schemas"]["DatasetResult"][]; + /** @enum {number|null} */ + error: null; + }; + "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess___-Array_": { + data: Record[]; + /** @enum {number|null} */ + error: null; + }; + "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; HeliconeDatasetMetadata: { promptVersionId?: string; inputRecordsIds?: string[]; @@ -3138,6 +3150,16 @@ Json: JsonObject; error: null; }; "Result__apiKey-string_.string_": components["schemas"]["ResultSuccess__apiKey-string__"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + data: { + created_at_trunc: string; + /** Format: double */ + cost: number; + }[]; + /** @enum {number|null} */ + error: null; + }; + "Result__cost-number--created_at_trunc-string_-Array.string_": components["schemas"]["ResultSuccess__cost-number--created_at_trunc-string_-Array_"] | components["schemas"]["ResultError_string_"]; }; responses: { }; @@ -5023,134 +5045,6 @@ export interface operations { }; }; }; - AddDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["NewDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - AddRandomDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["RandomDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - GetDatasets: { - requestBody: { - content: { - "application/json": { - promptVersionId?: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; - }; - }; - }; - }; - InsertDatasetRow: { - parameters: { - path: { - datasetId: string; - }; - }; - requestBody: { - content: { - "application/json": { - originalColumnId?: string; - inputs: components["schemas"]["Record_string.string_"]; - inputRecordId: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - CreateDatasetRow: { - parameters: { - path: { - datasetId: string; - promptVersionId: string; - }; - }; - requestBody: { - content: { - "application/json": { - sourceRequest?: string; - inputs: components["schemas"]["Record_string.string_"]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - GetDataset: { - parameters: { - path: { - datasetId: string; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; - }; - }; - }; - }; - MutateDataset: { - requestBody: { - content: { - "application/json": { - removeRequests: string[]; - addRequests: string[]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result___-Array.string_"]; - }; - }; - }; - }; CreateNewEmptyExperiment: { requestBody: { content: { @@ -5514,6 +5408,134 @@ export interface operations { }; }; }; + AddDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["NewDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + AddRandomDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["RandomDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + GetDatasets: { + requestBody: { + content: { + "application/json": { + promptVersionId?: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; + }; + }; + }; + }; + InsertDatasetRow: { + parameters: { + path: { + datasetId: string; + }; + }; + requestBody: { + content: { + "application/json": { + originalColumnId?: string; + inputs: components["schemas"]["Record_string.string_"]; + inputRecordId: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + CreateDatasetRow: { + parameters: { + path: { + datasetId: string; + promptVersionId: string; + }; + }; + requestBody: { + content: { + "application/json": { + sourceRequest?: string; + inputs: components["schemas"]["Record_string.string_"]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetDataset: { + parameters: { + path: { + datasetId: string; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; + }; + }; + }; + }; + MutateDataset: { + requestBody: { + content: { + "application/json": { + removeRequests: string[]; + addRequests: string[]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result___-Array.string_"]; + }; + }; + }; + }; AddHeliconeDataset: { requestBody: { content: { @@ -5661,11 +5683,6 @@ export interface operations { }; }; GetTotalRequests: { - requestBody: { - content: { - "application/json": components["schemas"]["DataIsBeautifulRequestBody"]; - }; - }; responses: { /** @description Ok */ 200: { @@ -6304,6 +6321,41 @@ export interface operations { }; }; }; + GetOrgName: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetTotalCosts: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_number.string_"]; + }; + }; + }; + }; + GetCostsOverTime: { + requestBody: { + content: { + "application/json": components["schemas"]["DataOverTimeRequest"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__cost-number--created_at_trunc-string_-Array.string_"]; + }; + }; + }; + }; GetSettings: { responses: { /** @description Ok */ diff --git a/bifrost/lib/clients/jawnTypes/public.ts b/bifrost/lib/clients/jawnTypes/public.ts index 5b20d59ee..0f7b89456 100644 --- a/bifrost/lib/clients/jawnTypes/public.ts +++ b/bifrost/lib/clients/jawnTypes/public.ts @@ -256,6 +256,27 @@ export interface paths { "/v1/integration/slack/channels": { get: operations["GetSlackChannels"]; }; + "/v1/experiment/dataset": { + post: operations["AddDataset"]; + }; + "/v1/experiment/dataset/random": { + post: operations["AddRandomDataset"]; + }; + "/v1/experiment/dataset/query": { + post: operations["GetDatasets"]; + }; + "/v1/experiment/dataset/{datasetId}/row/insert": { + post: operations["InsertDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + post: operations["CreateDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/inputs/query": { + post: operations["GetDataset"]; + }; + "/v1/experiment/dataset/{datasetId}/mutate": { + post: operations["MutateDataset"]; + }; "/v1/experiment/new-empty": { post: operations["CreateNewEmptyExperiment"]; }; @@ -312,27 +333,6 @@ export interface paths { "/v1/experiment/query": { post: operations["GetExperimentsOld"]; }; - "/v1/experiment/dataset": { - post: operations["AddDataset"]; - }; - "/v1/experiment/dataset/random": { - post: operations["AddRandomDataset"]; - }; - "/v1/experiment/dataset/query": { - post: operations["GetDatasets"]; - }; - "/v1/experiment/dataset/{datasetId}/row/insert": { - post: operations["InsertDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { - post: operations["CreateDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/inputs/query": { - post: operations["GetDataset"]; - }; - "/v1/experiment/dataset/{datasetId}/mutate": { - post: operations["MutateDataset"]; - }; "/v1/helicone-dataset": { post: operations["AddHeliconeDataset"]; }; @@ -478,6 +478,18 @@ export interface paths { "/v1/pi/session": { post: operations["AddSession"]; }; + "/v1/pi/org-name/query": { + post: operations["GetOrgName"]; + }; + "/v1/pi/total-costs": { + post: operations["GetTotalCosts"]; + }; + "/v1/pi/total_requests": { + post: operations["GetTotalRequests"]; + }; + "/v1/pi/costs-over-time/query": { + post: operations["GetCostsOverTime"]; + }; "/v1/settings/query": { get: operations["GetSettings"]; }; @@ -1943,6 +1955,85 @@ Json: JsonObject; error: null; }; "Result_Array__id-string--name-string__.string_": components["schemas"]["ResultSuccess_Array__id-string--name-string___"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess__datasetId-string__": { + data: { + datasetId: string; + }; + /** @enum {number|null} */ + error: null; + }; + "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; + DatasetMetadata: { + promptVersionId?: string; + inputRecordsIds?: string[]; + }; + NewDatasetParams: { + datasetName: string; + requestIds: string[]; + /** @enum {string} */ + datasetType: "experiment" | "helicone"; + meta?: components["schemas"]["DatasetMetadata"]; + }; + /** @description Make all properties in T optional */ + Partial_TimestampOperators_: { + gte?: string; + lte?: string; + lt?: string; + gt?: string; + }; + /** @description Make all properties in T optional */ + Partial_RequestTableToOperators_: { + prompt?: components["schemas"]["Partial_TextOperators_"]; + created_at?: components["schemas"]["Partial_TimestampOperators_"]; + user_id?: components["schemas"]["Partial_TextOperators_"]; + auth_hash?: components["schemas"]["Partial_TextOperators_"]; + org_id?: components["schemas"]["Partial_TextOperators_"]; + id?: components["schemas"]["Partial_TextOperators_"]; + node_id?: components["schemas"]["Partial_TextOperators_"]; + model?: components["schemas"]["Partial_TextOperators_"]; + modelOverride?: components["schemas"]["Partial_TextOperators_"]; + path?: components["schemas"]["Partial_TextOperators_"]; + prompt_id?: components["schemas"]["Partial_TextOperators_"]; + }; + /** @description From T, pick a set of properties whose keys are in the union K */ + "Pick_FilterLeaf.request-or-prompts_versions_": { + request?: components["schemas"]["Partial_RequestTableToOperators_"]; + prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; + }; + "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; + DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; + DatasetFilterBranch: { + right: components["schemas"]["DatasetFilterNode"]; + /** @enum {string} */ + operator: "or" | "and"; + left: components["schemas"]["DatasetFilterNode"]; + }; + RandomDatasetParams: { + datasetName: string; + filter: components["schemas"]["DatasetFilterNode"]; + /** Format: double */ + offset?: number; + /** Format: double */ + limit?: number; + }; + DatasetResult: { + id: string; + name: string; + created_at: string; + meta?: components["schemas"]["DatasetMetadata"]; + }; + "ResultSuccess_DatasetResult-Array_": { + data: components["schemas"]["DatasetResult"][]; + /** @enum {number|null} */ + error: null; + }; + "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess___-Array_": { + data: Record[]; + /** @enum {number|null} */ + error: null; + }; + "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; "ResultSuccess__tableId-string--experimentId-string__": { data: { experimentId: string; @@ -2172,85 +2263,6 @@ Json: JsonObject; /** @enum {boolean} */ score?: true; }; - "ResultSuccess__datasetId-string__": { - data: { - datasetId: string; - }; - /** @enum {number|null} */ - error: null; - }; - "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; - DatasetMetadata: { - promptVersionId?: string; - inputRecordsIds?: string[]; - }; - NewDatasetParams: { - datasetName: string; - requestIds: string[]; - /** @enum {string} */ - datasetType: "experiment" | "helicone"; - meta?: components["schemas"]["DatasetMetadata"]; - }; - /** @description Make all properties in T optional */ - Partial_TimestampOperators_: { - gte?: string; - lte?: string; - lt?: string; - gt?: string; - }; - /** @description Make all properties in T optional */ - Partial_RequestTableToOperators_: { - prompt?: components["schemas"]["Partial_TextOperators_"]; - created_at?: components["schemas"]["Partial_TimestampOperators_"]; - user_id?: components["schemas"]["Partial_TextOperators_"]; - auth_hash?: components["schemas"]["Partial_TextOperators_"]; - org_id?: components["schemas"]["Partial_TextOperators_"]; - id?: components["schemas"]["Partial_TextOperators_"]; - node_id?: components["schemas"]["Partial_TextOperators_"]; - model?: components["schemas"]["Partial_TextOperators_"]; - modelOverride?: components["schemas"]["Partial_TextOperators_"]; - path?: components["schemas"]["Partial_TextOperators_"]; - prompt_id?: components["schemas"]["Partial_TextOperators_"]; - }; - /** @description From T, pick a set of properties whose keys are in the union K */ - "Pick_FilterLeaf.request-or-prompts_versions_": { - request?: components["schemas"]["Partial_RequestTableToOperators_"]; - prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; - }; - "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; - DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; - DatasetFilterBranch: { - right: components["schemas"]["DatasetFilterNode"]; - /** @enum {string} */ - operator: "or" | "and"; - left: components["schemas"]["DatasetFilterNode"]; - }; - RandomDatasetParams: { - datasetName: string; - filter: components["schemas"]["DatasetFilterNode"]; - /** Format: double */ - offset?: number; - /** Format: double */ - limit?: number; - }; - DatasetResult: { - id: string; - name: string; - created_at: string; - meta?: components["schemas"]["DatasetMetadata"]; - }; - "ResultSuccess_DatasetResult-Array_": { - data: components["schemas"]["DatasetResult"][]; - /** @enum {number|null} */ - error: null; - }; - "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; - "ResultSuccess___-Array_": { - data: Record[]; - /** @enum {number|null} */ - error: null; - }; - "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; HeliconeDatasetMetadata: { promptVersionId?: string; inputRecordsIds?: string[]; @@ -2730,6 +2742,16 @@ Json: JsonObject; error: null; }; "Result__apiKey-string_.string_": components["schemas"]["ResultSuccess__apiKey-string__"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + data: { + created_at_trunc: string; + /** Format: double */ + cost: number; + }[]; + /** @enum {number|null} */ + error: null; + }; + "Result__cost-number--created_at_trunc-string_-Array.string_": components["schemas"]["ResultSuccess__cost-number--created_at_trunc-string_-Array_"] | components["schemas"]["ResultError_string_"]; /** @enum {string} */ LlmType: "chat" | "completion"; FunctionCall: { @@ -4780,6 +4802,134 @@ export interface operations { }; }; }; + AddDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["NewDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + AddRandomDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["RandomDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + GetDatasets: { + requestBody: { + content: { + "application/json": { + promptVersionId?: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; + }; + }; + }; + }; + InsertDatasetRow: { + parameters: { + path: { + datasetId: string; + }; + }; + requestBody: { + content: { + "application/json": { + originalColumnId?: string; + inputs: components["schemas"]["Record_string.string_"]; + inputRecordId: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + CreateDatasetRow: { + parameters: { + path: { + datasetId: string; + promptVersionId: string; + }; + }; + requestBody: { + content: { + "application/json": { + sourceRequest?: string; + inputs: components["schemas"]["Record_string.string_"]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetDataset: { + parameters: { + path: { + datasetId: string; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; + }; + }; + }; + }; + MutateDataset: { + requestBody: { + content: { + "application/json": { + removeRequests: string[]; + addRequests: string[]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result___-Array.string_"]; + }; + }; + }; + }; CreateNewEmptyExperiment: { requestBody: { content: { @@ -5143,134 +5293,6 @@ export interface operations { }; }; }; - AddDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["NewDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - AddRandomDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["RandomDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - GetDatasets: { - requestBody: { - content: { - "application/json": { - promptVersionId?: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; - }; - }; - }; - }; - InsertDatasetRow: { - parameters: { - path: { - datasetId: string; - }; - }; - requestBody: { - content: { - "application/json": { - originalColumnId?: string; - inputs: components["schemas"]["Record_string.string_"]; - inputRecordId: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - CreateDatasetRow: { - parameters: { - path: { - datasetId: string; - promptVersionId: string; - }; - }; - requestBody: { - content: { - "application/json": { - sourceRequest?: string; - inputs: components["schemas"]["Record_string.string_"]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - GetDataset: { - parameters: { - path: { - datasetId: string; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; - }; - }; - }; - }; - MutateDataset: { - requestBody: { - content: { - "application/json": { - removeRequests: string[]; - addRequests: string[]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result___-Array.string_"]; - }; - }; - }; - }; AddHeliconeDataset: { requestBody: { content: { @@ -5418,11 +5440,6 @@ export interface operations { }; }; GetTotalRequests: { - requestBody: { - content: { - "application/json": components["schemas"]["DataIsBeautifulRequestBody"]; - }; - }; responses: { /** @description Ok */ 200: { @@ -6061,6 +6078,41 @@ export interface operations { }; }; }; + GetOrgName: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetTotalCosts: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_number.string_"]; + }; + }; + }; + }; + GetCostsOverTime: { + requestBody: { + content: { + "application/json": components["schemas"]["DataOverTimeRequest"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__cost-number--created_at_trunc-string_-Array.string_"]; + }; + }; + }; + }; GetSettings: { responses: { /** @description Ok */ diff --git a/bifrost/public/static/pi/arrow-left.webp b/bifrost/public/static/pi/arrow-left.webp new file mode 100644 index 000000000..76223ec3e Binary files /dev/null and b/bifrost/public/static/pi/arrow-left.webp differ diff --git a/bifrost/public/static/pi/arrow-right.webp b/bifrost/public/static/pi/arrow-right.webp new file mode 100644 index 000000000..0ca8e9d7b Binary files /dev/null and b/bifrost/public/static/pi/arrow-right.webp differ diff --git a/bifrost/public/static/pi/intro-image.png b/bifrost/public/static/pi/intro-image.png deleted file mode 100644 index ba99349b0..000000000 Binary files a/bifrost/public/static/pi/intro-image.png and /dev/null differ diff --git a/bifrost/public/static/pi/intro-image.webp b/bifrost/public/static/pi/intro-image.webp new file mode 100644 index 000000000..c62fd9ba8 Binary files /dev/null and b/bifrost/public/static/pi/intro-image.webp differ diff --git a/docs/swagger.json b/docs/swagger.json index bab2b06d5..bde361282 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4567,20 +4567,16 @@ } ] }, - "ResultSuccess__tableId-string--experimentId-string__": { + "ResultSuccess__datasetId-string__": { "properties": { "data": { "properties": { - "experimentId": { - "type": "string" - }, - "tableId": { + "datasetId": { "type": "string" } }, "required": [ - "experimentId", - "tableId" + "datasetId" ], "type": "object" }, @@ -4599,109 +4595,197 @@ "type": "object", "additionalProperties": false }, - "Result__tableId-string--experimentId-string_.string_": { + "Result__datasetId-string_.string_": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess__tableId-string--experimentId-string__" + "$ref": "#/components/schemas/ResultSuccess__datasetId-string__" }, { "$ref": "#/components/schemas/ResultError_string_" } ] }, - "CreateExperimentTableParams": { + "DatasetMetadata": { "properties": { - "datasetId": { - "type": "string" - }, - "experimentMetadata": { - "$ref": "#/components/schemas/Record_string.any_" - }, "promptVersionId": { "type": "string" }, - "newHeliconeTemplate": { + "inputRecordsIds": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "additionalProperties": false + }, + "NewDatasetParams": { + "properties": { + "datasetName": { "type": "string" }, - "isMajorVersion": { - "type": "boolean" + "requestIds": { + "items": { + "type": "string" + }, + "type": "array" }, - "promptSubversionMetadata": { - "$ref": "#/components/schemas/Record_string.any_" + "datasetType": { + "type": "string", + "enum": [ + "experiment", + "helicone" + ] }, - "experimentTableMetadata": { - "$ref": "#/components/schemas/Record_string.any_" + "meta": { + "$ref": "#/components/schemas/DatasetMetadata" } }, "required": [ - "datasetId", - "experimentMetadata", - "promptVersionId", - "newHeliconeTemplate", - "isMajorVersion", - "promptSubversionMetadata" + "datasetName", + "requestIds", + "datasetType" ], "type": "object", "additionalProperties": false }, - "ExperimentTableColumn": { + "Partial_TimestampOperators_": { "properties": { - "id": { + "gte": { "type": "string" }, - "columnName": { + "lte": { "type": "string" }, - "columnType": { + "lt": { "type": "string" }, - "hypothesisId": { + "gt": { "type": "string" + } + }, + "type": "object", + "description": "Make all properties in T optional" + }, + "Partial_RequestTableToOperators_": { + "properties": { + "prompt": { + "$ref": "#/components/schemas/Partial_TextOperators_" }, - "cells": { - "items": { - "properties": { - "metadata": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "value": { - "type": "string", - "nullable": true - }, - "requestId": { - "type": "string" - }, - "rowIndex": { - "type": "number", - "format": "double" - }, - "id": { - "type": "string" - } - }, - "required": [ - "value", - "rowIndex", - "id" - ], - "type": "object" - }, - "type": "array" + "created_at": { + "$ref": "#/components/schemas/Partial_TimestampOperators_" }, - "metadata": { - "$ref": "#/components/schemas/Record_string.any_" + "user_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "auth_hash": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "org_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "node_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "model": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "modelOverride": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "path": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "prompt_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + } + }, + "type": "object", + "description": "Make all properties in T optional" + }, + "Pick_FilterLeaf.request-or-prompts_versions_": { + "properties": { + "request": { + "$ref": "#/components/schemas/Partial_RequestTableToOperators_" + }, + "prompts_versions": { + "$ref": "#/components/schemas/Partial_PromptVersionsToOperators_" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "FilterLeafSubset_request-or-prompts_versions_": { + "$ref": "#/components/schemas/Pick_FilterLeaf.request-or-prompts_versions_" + }, + "DatasetFilterNode": { + "anyOf": [ + { + "$ref": "#/components/schemas/FilterLeafSubset_request-or-prompts_versions_" + }, + { + "$ref": "#/components/schemas/DatasetFilterBranch" + }, + { + "type": "string", + "enum": [ + "all" + ] + } + ] + }, + "DatasetFilterBranch": { + "properties": { + "right": { + "$ref": "#/components/schemas/DatasetFilterNode" + }, + "operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "left": { + "$ref": "#/components/schemas/DatasetFilterNode" } }, "required": [ - "id", - "columnName", - "columnType", - "cells" + "right", + "operator", + "left" + ], + "type": "object" + }, + "RandomDatasetParams": { + "properties": { + "datasetName": { + "type": "string" + }, + "filter": { + "$ref": "#/components/schemas/DatasetFilterNode" + }, + "offset": { + "type": "number", + "format": "double" + }, + "limit": { + "type": "number", + "format": "double" + } + }, + "required": [ + "datasetName", + "filter" ], "type": "object", "additionalProperties": false }, - "ExperimentTable": { + "DatasetResult": { "properties": { "id": { "type": "string" @@ -4709,32 +4793,28 @@ "name": { "type": "string" }, - "experimentId": { + "created_at": { "type": "string" }, - "columns": { - "items": { - "$ref": "#/components/schemas/ExperimentTableColumn" - }, - "type": "array" - }, - "metadata": { - "$ref": "#/components/schemas/Record_string.any_" + "meta": { + "$ref": "#/components/schemas/DatasetMetadata" } }, "required": [ "id", "name", - "experimentId", - "columns" + "created_at" ], "type": "object", "additionalProperties": false }, - "ResultSuccess_ExperimentTable_": { + "ResultSuccess_DatasetResult-Array_": { "properties": { "data": { - "$ref": "#/components/schemas/ExperimentTable" + "items": { + "$ref": "#/components/schemas/DatasetResult" + }, + "type": "array" }, "error": { "type": "number", @@ -4751,22 +4831,250 @@ "type": "object", "additionalProperties": false }, - "Result_ExperimentTable.string_": { + "Result_DatasetResult-Array.string_": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess_ExperimentTable_" + "$ref": "#/components/schemas/ResultSuccess_DatasetResult-Array_" }, { "$ref": "#/components/schemas/ResultError_string_" } ] }, - "ExperimentTableSimplified": { + "ResultSuccess___-Array_": { "properties": { - "id": { - "type": "string" - }, - "name": { + "data": { + "items": { + "properties": {}, + "type": "object" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result___-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess___-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "ResultSuccess__tableId-string--experimentId-string__": { + "properties": { + "data": { + "properties": { + "experimentId": { + "type": "string" + }, + "tableId": { + "type": "string" + } + }, + "required": [ + "experimentId", + "tableId" + ], + "type": "object" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result__tableId-string--experimentId-string_.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess__tableId-string--experimentId-string__" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "CreateExperimentTableParams": { + "properties": { + "datasetId": { + "type": "string" + }, + "experimentMetadata": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "promptVersionId": { + "type": "string" + }, + "newHeliconeTemplate": { + "type": "string" + }, + "isMajorVersion": { + "type": "boolean" + }, + "promptSubversionMetadata": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "experimentTableMetadata": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "datasetId", + "experimentMetadata", + "promptVersionId", + "newHeliconeTemplate", + "isMajorVersion", + "promptSubversionMetadata" + ], + "type": "object", + "additionalProperties": false + }, + "ExperimentTableColumn": { + "properties": { + "id": { + "type": "string" + }, + "columnName": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "hypothesisId": { + "type": "string" + }, + "cells": { + "items": { + "properties": { + "metadata": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "value": { + "type": "string", + "nullable": true + }, + "requestId": { + "type": "string" + }, + "rowIndex": { + "type": "number", + "format": "double" + }, + "id": { + "type": "string" + } + }, + "required": [ + "value", + "rowIndex", + "id" + ], + "type": "object" + }, + "type": "array" + }, + "metadata": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "id", + "columnName", + "columnType", + "cells" + ], + "type": "object", + "additionalProperties": false + }, + "ExperimentTable": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "experimentId": { + "type": "string" + }, + "columns": { + "items": { + "$ref": "#/components/schemas/ExperimentTableColumn" + }, + "type": "array" + }, + "metadata": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "id", + "name", + "experimentId", + "columns" + ], + "type": "object", + "additionalProperties": false + }, + "ResultSuccess_ExperimentTable_": { + "properties": { + "data": { + "$ref": "#/components/schemas/ExperimentTable" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result_ExperimentTable.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess_ExperimentTable_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "ExperimentTableSimplified": { + "properties": { + "id": { + "type": "string" + }, + "name": { "type": "string" }, "experimentId": { @@ -5335,404 +5643,33 @@ "allOf": [ { "$ref": "#/components/schemas/ExperimentScores" - } - ], - "nullable": true - }, - "tableId": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "organization", - "dataset", - "meta", - "createdAt", - "hypotheses", - "scores", - "tableId" - ], - "type": "object", - "additionalProperties": false - }, - "ResultSuccess_Experiment-Array_": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Experiment" - }, - "type": "array" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result_Experiment-Array.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess_Experiment-Array_" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, - "Partial_ExperimentToOperators_": { - "properties": { - "id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "prompt_v2": { - "$ref": "#/components/schemas/Partial_TextOperators_" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Pick_FilterLeaf.experiment_": { - "properties": { - "experiment": { - "$ref": "#/components/schemas/Partial_ExperimentToOperators_" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "FilterLeafSubset_experiment_": { - "$ref": "#/components/schemas/Pick_FilterLeaf.experiment_" - }, - "ExperimentFilterNode": { - "anyOf": [ - { - "$ref": "#/components/schemas/FilterLeafSubset_experiment_" - }, - { - "$ref": "#/components/schemas/ExperimentFilterBranch" - }, - { - "type": "string", - "enum": [ - "all" - ] - } - ] - }, - "ExperimentFilterBranch": { - "properties": { - "right": { - "$ref": "#/components/schemas/ExperimentFilterNode" - }, - "operator": { - "type": "string", - "enum": [ - "or", - "and" - ] - }, - "left": { - "$ref": "#/components/schemas/ExperimentFilterNode" - } - }, - "required": [ - "right", - "operator", - "left" - ], - "type": "object" - }, - "IncludeExperimentKeys": { - "properties": { - "inputs": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - }, - "promptVersion": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - }, - "responseBodies": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - }, - "score": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - } - }, - "type": "object", - "additionalProperties": false - }, - "ResultSuccess__datasetId-string__": { - "properties": { - "data": { - "properties": { - "datasetId": { - "type": "string" - } - }, - "required": [ - "datasetId" - ], - "type": "object" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result__datasetId-string_.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess__datasetId-string__" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, - "DatasetMetadata": { - "properties": { - "promptVersionId": { - "type": "string" - }, - "inputRecordsIds": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": false - }, - "NewDatasetParams": { - "properties": { - "datasetName": { - "type": "string" - }, - "requestIds": { - "items": { - "type": "string" - }, - "type": "array" - }, - "datasetType": { - "type": "string", - "enum": [ - "experiment", - "helicone" - ] - }, - "meta": { - "$ref": "#/components/schemas/DatasetMetadata" - } - }, - "required": [ - "datasetName", - "requestIds", - "datasetType" - ], - "type": "object", - "additionalProperties": false - }, - "Partial_TimestampOperators_": { - "properties": { - "gte": { - "type": "string" - }, - "lte": { - "type": "string" - }, - "lt": { - "type": "string" - }, - "gt": { - "type": "string" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Partial_RequestTableToOperators_": { - "properties": { - "prompt": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "created_at": { - "$ref": "#/components/schemas/Partial_TimestampOperators_" - }, - "user_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "auth_hash": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "org_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "node_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "model": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "modelOverride": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "path": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "prompt_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Pick_FilterLeaf.request-or-prompts_versions_": { - "properties": { - "request": { - "$ref": "#/components/schemas/Partial_RequestTableToOperators_" - }, - "prompts_versions": { - "$ref": "#/components/schemas/Partial_PromptVersionsToOperators_" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "FilterLeafSubset_request-or-prompts_versions_": { - "$ref": "#/components/schemas/Pick_FilterLeaf.request-or-prompts_versions_" - }, - "DatasetFilterNode": { - "anyOf": [ - { - "$ref": "#/components/schemas/FilterLeafSubset_request-or-prompts_versions_" - }, - { - "$ref": "#/components/schemas/DatasetFilterBranch" - }, - { - "type": "string", - "enum": [ - "all" - ] - } - ] - }, - "DatasetFilterBranch": { - "properties": { - "right": { - "$ref": "#/components/schemas/DatasetFilterNode" - }, - "operator": { - "type": "string", - "enum": [ - "or", - "and" - ] - }, - "left": { - "$ref": "#/components/schemas/DatasetFilterNode" - } - }, - "required": [ - "right", - "operator", - "left" - ], - "type": "object" - }, - "RandomDatasetParams": { - "properties": { - "datasetName": { - "type": "string" - }, - "filter": { - "$ref": "#/components/schemas/DatasetFilterNode" - }, - "offset": { - "type": "number", - "format": "double" - }, - "limit": { - "type": "number", - "format": "double" - } - }, - "required": [ - "datasetName", - "filter" - ], - "type": "object", - "additionalProperties": false - }, - "DatasetResult": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "created_at": { - "type": "string" + } + ], + "nullable": true }, - "meta": { - "$ref": "#/components/schemas/DatasetMetadata" + "tableId": { + "type": "string", + "nullable": true } }, "required": [ "id", - "name", - "created_at" + "organization", + "dataset", + "meta", + "createdAt", + "hypotheses", + "scores", + "tableId" ], "type": "object", "additionalProperties": false }, - "ResultSuccess_DatasetResult-Array_": { + "ResultSuccess_Experiment-Array_": { "properties": { "data": { "items": { - "$ref": "#/components/schemas/DatasetResult" + "$ref": "#/components/schemas/Experiment" }, "type": "array" }, @@ -5751,50 +5688,113 @@ "type": "object", "additionalProperties": false }, - "Result_DatasetResult-Array.string_": { + "Result_Experiment-Array.string_": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess_DatasetResult-Array_" + "$ref": "#/components/schemas/ResultSuccess_Experiment-Array_" }, { "$ref": "#/components/schemas/ResultError_string_" } ] }, - "ResultSuccess___-Array_": { + "Partial_ExperimentToOperators_": { "properties": { - "data": { - "items": { - "properties": {}, - "type": "object" - }, - "type": "array" + "id": { + "$ref": "#/components/schemas/Partial_TextOperators_" }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true + "prompt_v2": { + "$ref": "#/components/schemas/Partial_TextOperators_" } }, - "required": [ - "data", - "error" - ], "type": "object", - "additionalProperties": false + "description": "Make all properties in T optional" }, - "Result___-Array.string_": { + "Pick_FilterLeaf.experiment_": { + "properties": { + "experiment": { + "$ref": "#/components/schemas/Partial_ExperimentToOperators_" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "FilterLeafSubset_experiment_": { + "$ref": "#/components/schemas/Pick_FilterLeaf.experiment_" + }, + "ExperimentFilterNode": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess___-Array_" + "$ref": "#/components/schemas/FilterLeafSubset_experiment_" }, { - "$ref": "#/components/schemas/ResultError_string_" + "$ref": "#/components/schemas/ExperimentFilterBranch" + }, + { + "type": "string", + "enum": [ + "all" + ] } ] }, + "ExperimentFilterBranch": { + "properties": { + "right": { + "$ref": "#/components/schemas/ExperimentFilterNode" + }, + "operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "left": { + "$ref": "#/components/schemas/ExperimentFilterNode" + } + }, + "required": [ + "right", + "operator", + "left" + ], + "type": "object" + }, + "IncludeExperimentKeys": { + "properties": { + "inputs": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + }, + "promptVersion": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + }, + "responseBodies": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + }, + "score": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + } + }, + "type": "object", + "additionalProperties": false + }, "HeliconeDatasetMetadata": { "properties": { "promptVersionId": { @@ -7713,6 +7713,52 @@ } ] }, + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + "properties": { + "data": { + "items": { + "properties": { + "created_at_trunc": { + "type": "string" + }, + "cost": { + "type": "number", + "format": "double" + } + }, + "required": [ + "created_at_trunc", + "cost" + ], + "type": "object" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result__cost-number--created_at_trunc-string_-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess__cost-number--created_at_trunc-string_-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, "LlmType": { "type": "string", "enum": [ @@ -13390,206 +13436,139 @@ "api_key": [] } ], - "parameters": [] - } - }, - "/v1/experiment/new-empty": { - "post": { - "operationId": "CreateNewEmptyExperiment", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result__experimentId-string_.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "datasetId": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Record_string.string_" - } - }, - "required": [ - "datasetId", - "metadata" - ], - "type": "object" - } - } - } - } - } - }, - "/v1/experiment/table/new": { - "post": { - "operationId": "CreateNewExperimentTable", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result__tableId-string--experimentId-string_.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateExperimentTableParams" - } - } - } - } + "parameters": [] } }, - "/v1/experiment/table/{experimentTableId}/query": { + "/v1/experiment/dataset": { "post": { - "operationId": "GetExperimentTableById", + "operationId": "AddDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTable.string_" + "$ref": "#/components/schemas/Result__datasetId-string_.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewDatasetParams" + } } } - ] + } } }, - "/v1/experiment/table/{experimentTableId}/metadata/query": { + "/v1/experiment/dataset/random": { "post": { - "operationId": "GetExperimentTableMetadata", + "operationId": "AddRandomDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTableSimplified.string_" + "$ref": "#/components/schemas/Result__datasetId-string_.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RandomDatasetParams" + } } } - ] + } } }, - "/v1/experiment/tables/query": { + "/v1/experiment/dataset/query": { "post": { - "operationId": "GetExperimentTables", + "operationId": "GetDatasets", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTableSimplified-Array.string_" + "$ref": "#/components/schemas/Result_DatasetResult-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "promptVersionId": { + "type": "string" + } + }, + "type": "object" + } + } + } + } } }, - "/v1/experiment/table/{experimentTableId}/cell": { + "/v1/experiment/dataset/{datasetId}/row/insert": { "post": { - "operationId": "CreateExperimentCell", + "operationId": "InsertDatasetRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_string.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -13599,7 +13578,7 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "datasetId", "required": true, "schema": { "type": "string" @@ -13612,45 +13591,44 @@ "application/json": { "schema": { "properties": { - "value": { - "type": "string", - "nullable": true + "originalColumnId": { + "type": "string" }, - "rowIndex": { - "type": "number", - "format": "double" + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" }, - "columnId": { + "inputRecordId": { "type": "string" } }, "required": [ - "value", - "rowIndex", - "columnId" + "inputs", + "inputRecordId" ], "type": "object" } } } } - }, - "patch": { - "operationId": "UpdateExperimentCell", + } + }, + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + "post": { + "operationId": "CreateDatasetRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_string.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -13660,7 +13638,15 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "datasetId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "promptVersionId", "required": true, "schema": { "type": "string" @@ -13673,24 +13659,15 @@ "application/json": { "schema": { "properties": { - "updateInputs": { - "type": "boolean" - }, - "metadata": { - "type": "string" - }, - "value": { - "type": "string" - }, - "status": { + "sourceRequest": { "type": "string" }, - "cellId": { - "type": "string" + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" } }, "required": [ - "cellId" + "inputs" ], "type": "object" } @@ -13699,23 +13676,23 @@ } } }, - "/v1/experiment/table/{experimentTableId}/column": { + "/v1/experiment/dataset/{datasetId}/inputs/query": { "post": { - "operationId": "CreateExperimentColumn", + "operationId": "GetDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_PromptInputRecord-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -13725,41 +13702,61 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "datasetId", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/v1/experiment/dataset/{datasetId}/mutate": { + "post": { + "operationId": "MutateDataset", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result___-Array.string_" + } + } + } + } + }, + "tags": [ + "Dataset" + ], + "security": [ + { + "api_key": [] + } ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "inputKeys": { + "removeRequests": { "items": { "type": "string" }, "type": "array" }, - "promptVersionId": { - "type": "string" - }, - "hypothesisId": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "columnName": { - "type": "string" + "addRequests": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "columnType", - "columnName" + "removeRequests", + "addRequests" ], "type": "object" } @@ -13768,16 +13765,16 @@ } } }, - "/v1/experiment/table/{experimentTableId}/row/new": { + "/v1/experiment/new-empty": { "post": { - "operationId": "CreateExperimentTableRow", + "operationId": "CreateNewEmptyExperiment", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result__experimentId-string_.string_" } } } @@ -13791,34 +13788,23 @@ "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "sourceRequest": { + "datasetId": { "type": "string" }, - "promptVersionId": { - "type": "string" + "metadata": { + "$ref": "#/components/schemas/Record_string.string_" } }, "required": [ - "promptVersionId" + "datasetId", + "metadata" ], "type": "object" } @@ -13827,16 +13813,52 @@ } } }, - "/v1/experiment/table/{experimentTableId}/row/{rowIndex}": { - "delete": { - "operationId": "DeleteExperimentTableRow", + "/v1/experiment/table/new": { + "post": { + "operationId": "CreateNewExperimentTable", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__tableId-string--experimentId-string_.string_" + } + } + } + } + }, + "tags": [ + "Experiment" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateExperimentTableParams" + } + } + } + } + } + }, + "/v1/experiment/table/{experimentTableId}/query": { + "post": { + "operationId": "GetExperimentTableById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_ExperimentTable.string_" } } } @@ -13858,29 +13880,20 @@ "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rowIndex", - "required": true, - "schema": { - "format": "double", - "type": "number" - } } ] } }, - "/v1/experiment/table/{experimentTableId}/row/insert/batch": { + "/v1/experiment/table/{experimentTableId}/metadata/query": { "post": { - "operationId": "CreateExperimentTableRowWithCellsBatch", + "operationId": "GetExperimentTableMetadata", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_ExperimentTableSimplified.string_" } } } @@ -13903,87 +13916,19 @@ "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "rows": { - "items": { - "properties": { - "sourceRequest": { - "type": "string" - }, - "cells": { - "items": { - "properties": { - "metadata": {}, - "value": { - "type": "string", - "nullable": true - }, - "columnId": { - "type": "string" - } - }, - "required": [ - "value", - "columnId" - ], - "type": "object" - }, - "type": "array" - }, - "datasetId": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "inputRecordId": { - "type": "string" - } - }, - "required": [ - "cells", - "datasetId", - "inputs", - "inputRecordId" - ], - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "rows" - ], - "type": "object" - } - } - } - } + ] } }, - "/v1/experiment/update-meta": { + "/v1/experiment/tables/query": { "post": { - "operationId": "UpdateExperimentMeta", + "operationId": "GetExperimentTables", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess_unknown_" - }, - { - "$ref": "#/components/schemas/ResultError_PostgrestError_" - } - ] + "$ref": "#/components/schemas/Result_ExperimentTableSimplified-Array.string_" } } } @@ -13997,41 +13942,19 @@ "api_key": [] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "meta": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "experimentId": { - "type": "string" - } - }, - "required": [ - "meta", - "experimentId" - ], - "type": "object" - } - } - } - } + "parameters": [] } }, - "/v1/experiment": { + "/v1/experiment/table/{experimentTableId}/cell": { "post": { - "operationId": "CreateNewExperimentOld", + "operationId": "CreateExperimentCell", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__experimentId-string_.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14045,29 +13968,54 @@ "api_key": [] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewExperimentParams" + "properties": { + "value": { + "type": "string", + "nullable": true + }, + "rowIndex": { + "type": "number", + "format": "double" + }, + "columnId": { + "type": "string" + } + }, + "required": [ + "value", + "rowIndex", + "columnId" + ], + "type": "object" } } } } - } - }, - "/v1/experiment/hypothesis": { - "post": { - "operationId": "CreateNewExperimentHypothesis", + }, + "patch": { + "operationId": "UpdateExperimentCell", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__hypothesisId-string_.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14081,41 +14029,40 @@ "api_key": [] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "status": { - "type": "string", - "enum": [ - "PENDING", - "RUNNING", - "COMPLETED", - "FAILED" - ] + "updateInputs": { + "type": "boolean" }, - "providerKeyId": { + "metadata": { "type": "string" }, - "promptVersion": { + "value": { "type": "string" }, - "model": { + "status": { "type": "string" }, - "experimentId": { + "cellId": { "type": "string" } }, "required": [ - "status", - "providerKeyId", - "promptVersion", - "model", - "experimentId" + "cellId" ], "type": "object" } @@ -14124,16 +14071,16 @@ } } }, - "/v1/experiment/hypothesis/{hypothesisId}/scores/query": { + "/v1/experiment/table/{experimentTableId}/column": { "post": { - "operationId": "GetExperimentHypothesisScores", + "operationId": "CreateExperimentColumn", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__runsCount-number--scores-Record_string.Score__.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14150,51 +14097,52 @@ "parameters": [ { "in": "path", - "name": "hypothesisId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "inputKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "promptVersionId": { + "type": "string" + }, + "hypothesisId": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "columnName": { + "type": "string" + } + }, + "required": [ + "columnType", + "columnName" + ], + "type": "object" + } + } + } + } } }, - "/v1/experiment/{experimentId}/evaluators": { - "get": { - "operationId": "GetExperimentEvaluators", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result_EvaluatorResult-Array.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "experimentId", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, + "/v1/experiment/table/{experimentTableId}/row/new": { "post": { - "operationId": "CreateExperimentEvaluatorOld", + "operationId": "CreateExperimentTableRow", "responses": { "200": { "description": "Ok", @@ -14218,7 +14166,7 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" @@ -14231,12 +14179,18 @@ "application/json": { "schema": { "properties": { - "evaluatorId": { + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "sourceRequest": { + "type": "string" + }, + "promptVersionId": { "type": "string" } }, "required": [ - "evaluatorId" + "promptVersionId" ], "type": "object" } @@ -14245,9 +14199,9 @@ } } }, - "/v1/experiment/{experimentId}/evaluators/run": { - "post": { - "operationId": "RunExperimentEvaluatorsOld", + "/v1/experiment/table/{experimentTableId}/row/{rowIndex}": { + "delete": { + "operationId": "DeleteExperimentTableRow", "responses": { "200": { "description": "Ok", @@ -14271,18 +14225,27 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } + }, + { + "in": "path", + "name": "rowIndex", + "required": true, + "schema": { + "format": "double", + "type": "number" + } } ] } }, - "/v1/experiment/{experimentId}/evaluators/{evaluatorId}": { - "delete": { - "operationId": "DeleteExperimentEvaluatorOld", + "/v1/experiment/table/{experimentTableId}/row/insert/batch": { + "post": { + "operationId": "CreateExperimentTableRowWithCellsBatch", "responses": { "200": { "description": "Ok", @@ -14306,33 +14269,93 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } - }, - { - "in": "path", - "name": "evaluatorId", - "required": true, - "schema": { - "type": "string" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "rows": { + "items": { + "properties": { + "sourceRequest": { + "type": "string" + }, + "cells": { + "items": { + "properties": { + "metadata": {}, + "value": { + "type": "string", + "nullable": true + }, + "columnId": { + "type": "string" + } + }, + "required": [ + "value", + "columnId" + ], + "type": "object" + }, + "type": "array" + }, + "datasetId": { + "type": "string" + }, + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "inputRecordId": { + "type": "string" + } + }, + "required": [ + "cells", + "datasetId", + "inputs", + "inputRecordId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "rows" + ], + "type": "object" + } } } - ] + } } }, - "/v1/experiment/query": { + "/v1/experiment/update-meta": { "post": { - "operationId": "GetExperimentsOld", + "operationId": "UpdateExperimentMeta", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_Experiment-Array.string_" + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess_unknown_" + }, + { + "$ref": "#/components/schemas/ResultError_PostgrestError_" + } + ] } } } @@ -14353,15 +14376,16 @@ "application/json": { "schema": { "properties": { - "include": { - "$ref": "#/components/schemas/IncludeExperimentKeys" + "meta": { + "$ref": "#/components/schemas/Record_string.string_" }, - "filter": { - "$ref": "#/components/schemas/ExperimentFilterNode" + "experimentId": { + "type": "string" } }, "required": [ - "filter" + "meta", + "experimentId" ], "type": "object" } @@ -14370,23 +14394,23 @@ } } }, - "/v1/experiment/dataset": { + "/v1/experiment": { "post": { - "operationId": "AddDataset", + "operationId": "CreateNewExperimentOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__datasetId-string_.string_" + "$ref": "#/components/schemas/Result__experimentId-string_.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14399,30 +14423,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewDatasetParams" + "$ref": "#/components/schemas/NewExperimentParams" } } } } } }, - "/v1/experiment/dataset/random": { + "/v1/experiment/hypothesis": { "post": { - "operationId": "AddRandomDataset", + "operationId": "CreateNewExperimentHypothesis", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__datasetId-string_.string_" + "$ref": "#/components/schemas/Result__hypothesisId-string_.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14435,71 +14459,128 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RandomDatasetParams" + "properties": { + "status": { + "type": "string", + "enum": [ + "PENDING", + "RUNNING", + "COMPLETED", + "FAILED" + ] + }, + "providerKeyId": { + "type": "string" + }, + "promptVersion": { + "type": "string" + }, + "model": { + "type": "string" + }, + "experimentId": { + "type": "string" + } + }, + "required": [ + "status", + "providerKeyId", + "promptVersion", + "model", + "experimentId" + ], + "type": "object" } } } } } }, - "/v1/experiment/dataset/query": { + "/v1/experiment/hypothesis/{hypothesisId}/scores/query": { "post": { - "operationId": "GetDatasets", + "operationId": "GetExperimentHypothesisScores", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__runsCount-number--scores-Record_string.Score__.string_" + } + } + } + } + }, + "tags": [ + "Experiment" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "hypothesisId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/v1/experiment/{experimentId}/evaluators": { + "get": { + "operationId": "GetExperimentEvaluators", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_DatasetResult-Array.string_" + "$ref": "#/components/schemas/Result_EvaluatorResult-Array.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { "api_key": [] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "promptVersionId": { - "type": "string" - } - }, - "type": "object" - } + "parameters": [ + { + "in": "path", + "name": "experimentId", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/v1/experiment/dataset/{datasetId}/row/insert": { + ] + }, "post": { - "operationId": "InsertDatasetRow", + "operationId": "CreateExperimentEvaluatorOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_string.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14509,7 +14590,7 @@ "parameters": [ { "in": "path", - "name": "datasetId", + "name": "experimentId", "required": true, "schema": { "type": "string" @@ -14522,19 +14603,12 @@ "application/json": { "schema": { "properties": { - "originalColumnId": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "inputRecordId": { + "evaluatorId": { "type": "string" } }, "required": [ - "inputs", - "inputRecordId" + "evaluatorId" ], "type": "object" } @@ -14543,23 +14617,23 @@ } } }, - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + "/v1/experiment/{experimentId}/evaluators/run": { "post": { - "operationId": "CreateDatasetRow", + "operationId": "RunExperimentEvaluatorsOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_string.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14569,61 +14643,32 @@ "parameters": [ { "in": "path", - "name": "datasetId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "promptVersionId", + "name": "experimentId", "required": true, "schema": { "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "sourceRequest": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - } - }, - "required": [ - "inputs" - ], - "type": "object" - } - } - } - } + ] } }, - "/v1/experiment/dataset/{datasetId}/inputs/query": { - "post": { - "operationId": "GetDataset", + "/v1/experiment/{experimentId}/evaluators/{evaluatorId}": { + "delete": { + "operationId": "DeleteExperimentEvaluatorOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_PromptInputRecord-Array.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14633,7 +14678,15 @@ "parameters": [ { "in": "path", - "name": "datasetId", + "name": "experimentId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "evaluatorId", "required": true, "schema": { "type": "string" @@ -14642,23 +14695,23 @@ ] } }, - "/v1/experiment/dataset/{datasetId}/mutate": { + "/v1/experiment/query": { "post": { - "operationId": "MutateDataset", + "operationId": "GetExperimentsOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result___-Array.string_" + "$ref": "#/components/schemas/Result_Experiment-Array.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14672,22 +14725,15 @@ "application/json": { "schema": { "properties": { - "removeRequests": { - "items": { - "type": "string" - }, - "type": "array" + "include": { + "$ref": "#/components/schemas/IncludeExperimentKeys" }, - "addRequests": { - "items": { - "type": "string" - }, - "type": "array" + "filter": { + "$ref": "#/components/schemas/ExperimentFilterNode" } }, "required": [ - "removeRequests", - "addRequests" + "filter" ], "type": "object" } @@ -16753,6 +16799,133 @@ } } }, + "/v1/pi/org-name/query": { + "post": { + "operationId": "GetOrgName", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_string.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/total-costs": { + "post": { + "operationId": "GetTotalCosts", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_number.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/total_requests": { + "post": { + "operationId": "GetTotalRequests", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_number.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/costs-over-time/query": { + "post": { + "operationId": "GetCostsOverTime", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__cost-number--created_at_trunc-string_-Array.string_" + }, + "examples": { + "Example 1": { + "value": { + "userFilter": "all", + "timeFilter": { + "start": "2024-01-01", + "end": "2024-01-31" + }, + "dbIncrement": "day", + "timeZoneDifference": 0 + } + } + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataOverTimeRequest" + } + } + } + } + } + }, "/v1/settings/query": { "get": { "operationId": "GetSettings", diff --git a/valhalla/jawn/src/controllers/public/piController.ts b/valhalla/jawn/src/controllers/public/piController.ts index 01df61c9d..e21f4f1d4 100644 --- a/valhalla/jawn/src/controllers/public/piController.ts +++ b/valhalla/jawn/src/controllers/public/piController.ts @@ -1,8 +1,26 @@ -import { Body, Controller, Post, Request, Route, Security, Tags } from "tsoa"; +import { + Body, + Controller, + Example, + Post, + Request, + Route, + Security, + Tags, +} from "tsoa"; import { Result, err, ok } from "../../lib/shared/result"; import { JawnAuthenticatedRequest } from "../../types/request"; import { supabaseServer } from "../../lib/db/supabase"; +import { RequestManager } from "../../managers/request/RequestManager"; +import { buildFilterWithAuthClickHouse } from "../../lib/shared/filters/filters"; +import { timeFilterToFilterNode } from "../../lib/shared/filters/filterDefs"; +import { dbQueryClickhouse } from "../../lib/shared/db/dbExecute"; +import { clickhousePriceCalc } from "../../packages/cost"; +import { + DataOverTimeRequest, + getXOverTime, +} from "../../managers/helpers/getXOverTime"; @Route("/v1/pi") @Tags("PI") @@ -40,4 +58,140 @@ export class PiController extends Controller { return ok("success"); } } + + @Post("/org-name/query") + public async getOrgName( + @Request() request: JawnAuthenticatedRequest + ): Promise> { + const result = await supabaseServer.client + .from("organization") + .select("*") + .eq("id", request.authParams.organizationId); + + if (result.error) { + this.setStatus(500); + console.error(result.error); + return err(result.error?.message || "Failed to fetch evals"); + } + + return ok(result.data?.[0]?.name || "Unknown"); + } + + @Post("/total-costs") + public async getTotalCosts( + @Request() request: JawnAuthenticatedRequest + ): Promise> { + const startTime = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000); // 30 days ago + const endTime = new Date(Date.now()); + + const { filter: filterString, argsAcc } = + await buildFilterWithAuthClickHouse({ + org_id: request.authParams.organizationId, + filter: { + left: timeFilterToFilterNode( + { + start: startTime, + end: endTime, + }, + "request_response_rmt" + ), + right: "all", + operator: "and", + }, + argsAcc: [], + }); + + const query = ` + WITH total_cost AS ( + SELECT ${clickhousePriceCalc("request_response_rmt")} as cost + FROM request_response_rmt + WHERE ( + (${filterString}) + ) + ) + SELECT coalesce(sum(cost), 0) as cost + FROM total_cost +`; + + const result = await dbQueryClickhouse<{ + cost: number; + }>(query, argsAcc); + + return ok(result.data?.[0]?.cost || 0); + } + + @Post("/total_requests") + public async getTotalRequests( + @Request() request: JawnAuthenticatedRequest + ): Promise> { + const startTime = new Date(Date.now() - 30 * 24 * 60 * 60 * 1000); // 30 days ago + const endTime = new Date(Date.now()); + + const { filter: filterString, argsAcc } = + await buildFilterWithAuthClickHouse({ + org_id: request.authParams.organizationId, + filter: { + left: timeFilterToFilterNode( + { + start: startTime, + end: endTime, + }, + "request_response_rmt" + ), + right: "all", + operator: "and", + }, + argsAcc: [], + }); + + const query = ` + WITH total_count AS ( + SELECT count(*) as count + FROM request_response_rmt + WHERE ( + (${filterString}) + ) + ) + SELECT coalesce(sum(count), 0) as count + FROM total_count +`; + + const result = await dbQueryClickhouse<{ + count: number; + }>(query, argsAcc); + + return ok(result.data?.[0]?.count || 0); + } + + @Post("/costs-over-time/query") + @Example({ + userFilter: "all", + timeFilter: { + start: "2024-01-01", + end: "2024-01-31", + }, + dbIncrement: "day", + timeZoneDifference: 0, + }) + public async getCostsOverTime( + @Body() + requestBody: DataOverTimeRequest, + @Request() request: JawnAuthenticatedRequest + ): Promise< + Result< + { + cost: number; + created_at_trunc: string; + }[], + string + > + > { + return await getXOverTime<{ + cost: number; + }>(requestBody, { + orgId: request.authParams.organizationId, + countColumn: `${clickhousePriceCalc("request_response_rmt")} as cost`, + groupByColumns: ["created_at_trunc"], + }); + } } diff --git a/valhalla/jawn/src/tsoa-build/private/routes.ts b/valhalla/jawn/src/tsoa-build/private/routes.ts index 8c93a91fb..65950358e 100644 --- a/valhalla/jawn/src/tsoa-build/private/routes.ts +++ b/valhalla/jawn/src/tsoa-build/private/routes.ts @@ -44,10 +44,10 @@ import { PropertyController } from './../../controllers/public/propertyControlle // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { IntegrationController } from './../../controllers/public/integrationController'; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { ExperimentDatasetController } from './../../controllers/public/experimentDatasetController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { ExperimentController } from './../../controllers/public/experimentController'; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { ExperimentDatasetController } from './../../controllers/public/experimentDatasetController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { HeliconeDatasetController } from './../../controllers/public/heliconeDatasetController'; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { DataIsBeautifulRouter } from './../../controllers/public/dataIsBeautifulController'; @@ -2145,110 +2145,6 @@ const models: TsoaRoute.Models = { "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess_Array__id-string--name-string___"},{"ref":"ResultError_string_"}],"validators":{}}, }, // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResultSuccess__datasetId-string__": { - "dataType": "refObject", - "properties": { - "data": {"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true}},"required":true}, - "error": {"dataType":"enum","enums":[null],"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Result__datasetId-string_.string_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__datasetId-string__"},{"ref":"ResultError_string_"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetMetadata": { - "dataType": "refObject", - "properties": { - "promptVersionId": {"dataType":"string"}, - "inputRecordsIds": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "NewDatasetParams": { - "dataType": "refObject", - "properties": { - "datasetName": {"dataType":"string","required":true}, - "requestIds": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "datasetType": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["experiment"]},{"dataType":"enum","enums":["helicone"]}],"required":true}, - "meta": {"ref":"DatasetMetadata"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_FilterLeaf.request-or-prompts_versions_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"request":{"ref":"Partial_RequestTableToOperators_"},"prompts_versions":{"ref":"Partial_PromptVersionsToOperators_"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "FilterLeafSubset_request-or-prompts_versions_": { - "dataType": "refAlias", - "type": {"ref":"Pick_FilterLeaf.request-or-prompts_versions_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetFilterNode": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"FilterLeafSubset_request-or-prompts_versions_"},{"ref":"DatasetFilterBranch"},{"dataType":"enum","enums":["all"]}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetFilterBranch": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"right":{"ref":"DatasetFilterNode","required":true},"operator":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["or"]},{"dataType":"enum","enums":["and"]}],"required":true},"left":{"ref":"DatasetFilterNode","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RandomDatasetParams": { - "dataType": "refObject", - "properties": { - "datasetName": {"dataType":"string","required":true}, - "filter": {"ref":"DatasetFilterNode","required":true}, - "offset": {"dataType":"double"}, - "limit": {"dataType":"double"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetResult": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "name": {"dataType":"string","required":true}, - "created_at": {"dataType":"string","required":true}, - "meta": {"ref":"DatasetMetadata"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResultSuccess_DatasetResult-Array_": { - "dataType": "refObject", - "properties": { - "data": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetResult"},"required":true}, - "error": {"dataType":"enum","enums":[null],"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Result_DatasetResult-Array.string_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess_DatasetResult-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResultSuccess___-Array_": { - "dataType": "refObject", - "properties": { - "data": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{}},"required":true}, - "error": {"dataType":"enum","enums":[null],"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Result___-Array.string_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess___-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa "ResultSuccess__tableId-string--experimentId-string__": { "dataType": "refObject", "properties": { @@ -2541,6 +2437,110 @@ const models: TsoaRoute.Models = { "additionalProperties": false, }, // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess__datasetId-string__": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true}},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result__datasetId-string_.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__datasetId-string__"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetMetadata": { + "dataType": "refObject", + "properties": { + "promptVersionId": {"dataType":"string"}, + "inputRecordsIds": {"dataType":"array","array":{"dataType":"string"}}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "NewDatasetParams": { + "dataType": "refObject", + "properties": { + "datasetName": {"dataType":"string","required":true}, + "requestIds": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "datasetType": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["experiment"]},{"dataType":"enum","enums":["helicone"]}],"required":true}, + "meta": {"ref":"DatasetMetadata"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_FilterLeaf.request-or-prompts_versions_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"request":{"ref":"Partial_RequestTableToOperators_"},"prompts_versions":{"ref":"Partial_PromptVersionsToOperators_"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "FilterLeafSubset_request-or-prompts_versions_": { + "dataType": "refAlias", + "type": {"ref":"Pick_FilterLeaf.request-or-prompts_versions_","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetFilterNode": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"FilterLeafSubset_request-or-prompts_versions_"},{"ref":"DatasetFilterBranch"},{"dataType":"enum","enums":["all"]}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetFilterBranch": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"right":{"ref":"DatasetFilterNode","required":true},"operator":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["or"]},{"dataType":"enum","enums":["and"]}],"required":true},"left":{"ref":"DatasetFilterNode","required":true}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "RandomDatasetParams": { + "dataType": "refObject", + "properties": { + "datasetName": {"dataType":"string","required":true}, + "filter": {"ref":"DatasetFilterNode","required":true}, + "offset": {"dataType":"double"}, + "limit": {"dataType":"double"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetResult": { + "dataType": "refObject", + "properties": { + "id": {"dataType":"string","required":true}, + "name": {"dataType":"string","required":true}, + "created_at": {"dataType":"string","required":true}, + "meta": {"ref":"DatasetMetadata"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess_DatasetResult-Array_": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetResult"},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result_DatasetResult-Array.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess_DatasetResult-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess___-Array_": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{}},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result___-Array.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess___-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa "HeliconeDatasetMetadata": { "dataType": "refObject", "properties": { @@ -3125,6 +3125,20 @@ const models: TsoaRoute.Models = { "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__apiKey-string__"},{"ref":"ResultError_string_"}],"validators":{}}, }, // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"created_at_trunc":{"dataType":"string","required":true},"cost":{"dataType":"double","required":true}}},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result__cost-number--created_at_trunc-string_-Array.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__cost-number--created_at_trunc-string_-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa }; const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true}); @@ -6489,14 +6503,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset', + app.post('/v1/experiment/new-empty', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.addDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewEmptyExperiment)), - async function ExperimentDatasetController_addDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewEmptyExperiment(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewDatasetParams"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true},"metadata":{"ref":"Record_string.string_","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6506,10 +6520,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'addDataset', + methodName: 'createNewEmptyExperiment', controller, response, next, @@ -6521,14 +6535,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/random', + app.post('/v1/experiment/table/new', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.addRandomDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentTable)), - async function ExperimentDatasetController_addRandomDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewExperimentTable(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"RandomDatasetParams"}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"CreateExperimentTableParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6538,10 +6552,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'addRandomDataset', + methodName: 'createNewExperimentTable', controller, response, next, @@ -6553,14 +6567,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/query', + app.post('/v1/experiment/table/:experimentTableId/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDatasets)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableById)), - async function ExperimentDatasetController_getDatasets(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentTableById(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"promptVersionId":{"dataType":"string"}}}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6570,10 +6584,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getDatasets', + methodName: 'getExperimentTableById', controller, response, next, @@ -6585,16 +6599,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/row/insert', + app.post('/v1/experiment/table/:experimentTableId/metadata/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.insertDatasetRow)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableMetadata)), - async function ExperimentDatasetController_insertDatasetRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentTableMetadata(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"originalColumnId":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, - datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6603,10 +6616,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'insertDatasetRow', + methodName: 'getExperimentTableMetadata', controller, response, next, @@ -6618,17 +6631,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/version/:promptVersionId/row/new', + app.post('/v1/experiment/tables/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.createDatasetRow)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTables)), - async function ExperimentDatasetController_createDatasetRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentTables(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, - datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, - promptVersionId: {"in":"path","name":"promptVersionId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6637,10 +6647,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createDatasetRow', + methodName: 'getExperimentTables', controller, response, next, @@ -6652,15 +6662,16 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/inputs/query', + app.post('/v1/experiment/table/:experimentTableId/cell', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentCell)), - async function ExperimentDatasetController_getDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentCell(request: ExRequest, response: ExResponse, next: any) { const args: Record = { + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"rowIndex":{"dataType":"double","required":true},"columnId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, - datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6669,10 +6680,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getDataset', + methodName: 'createExperimentCell', controller, response, next, @@ -6684,14 +6695,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/mutate', + app.patch('/v1/experiment/table/:experimentTableId/cell', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.mutateDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentCell)), - async function ExperimentDatasetController_mutateDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_updateExperimentCell(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"removeRequests":{"dataType":"array","array":{"dataType":"string"},"required":true},"addRequests":{"dataType":"array","array":{"dataType":"string"},"required":true}}}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"updateInputs":{"dataType":"boolean"},"metadata":{"dataType":"string"},"value":{"dataType":"string"},"status":{"dataType":"string"},"cellId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6701,10 +6713,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'mutateDataset', + methodName: 'updateExperimentCell', controller, response, next, @@ -6716,14 +6728,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/new-empty', + app.post('/v1/experiment/table/:experimentTableId/column', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewEmptyExperiment)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentColumn)), - async function ExperimentController_createNewEmptyExperiment(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentColumn(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true},"metadata":{"ref":"Record_string.string_","required":true}}}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputKeys":{"dataType":"array","array":{"dataType":"string"}},"promptVersionId":{"dataType":"string"},"hypothesisId":{"dataType":"string"},"columnType":{"dataType":"string","required":true},"columnName":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6736,7 +6749,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createNewEmptyExperiment', + methodName: 'createExperimentColumn', controller, response, next, @@ -6748,14 +6761,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/new', + app.post('/v1/experiment/table/:experimentTableId/row/new', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentTable)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRow)), - async function ExperimentController_createNewExperimentTable(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"CreateExperimentTableParams"}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputs":{"ref":"Record_string.string_"},"sourceRequest":{"dataType":"string"},"promptVersionId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6768,7 +6782,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createNewExperimentTable', + methodName: 'createExperimentTableRow', controller, response, next, @@ -6780,14 +6794,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/query', + app.delete('/v1/experiment/table/:experimentTableId/row/:rowIndex', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableById)), + ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentTableRow)), - async function ExperimentController_getExperimentTableById(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_deleteExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + rowIndex: {"in":"path","name":"rowIndex","required":true,"dataType":"double"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6800,7 +6815,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getExperimentTableById', + methodName: 'deleteExperimentTableRow', controller, response, next, @@ -6812,14 +6827,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/metadata/query', + app.post('/v1/experiment/table/:experimentTableId/row/insert/batch', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableMetadata)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRowWithCellsBatch)), - async function ExperimentController_getExperimentTableMetadata(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentTableRowWithCellsBatch(request: ExRequest, response: ExResponse, next: any) { const args: Record = { experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"rows":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"cells":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"metadata":{"dataType":"any"},"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"columnId":{"dataType":"string","required":true}}},"required":true},"datasetId":{"dataType":"string","required":true},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}},"required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6832,7 +6848,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getExperimentTableMetadata', + methodName: 'createExperimentTableRowWithCellsBatch', controller, response, next, @@ -6844,13 +6860,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/tables/query', + app.post('/v1/experiment/update-meta', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTables)), + ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentMeta)), - async function ExperimentController_getExperimentTables(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_updateExperimentMeta(request: ExRequest, response: ExResponse, next: any) { const args: Record = { + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"meta":{"ref":"Record_string.string_","required":true},"experimentId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6863,7 +6880,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getExperimentTables', + methodName: 'updateExperimentMeta', controller, response, next, @@ -6875,15 +6892,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/cell', + app.post('/v1/experiment', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentCell)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentOld)), - async function ExperimentController_createExperimentCell(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewExperimentOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"rowIndex":{"dataType":"double","required":true},"columnId":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewExperimentParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6896,7 +6912,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentCell', + methodName: 'createNewExperimentOld', controller, response, next, @@ -6908,15 +6924,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.patch('/v1/experiment/table/:experimentTableId/cell', + app.post('/v1/experiment/hypothesis', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentCell)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentHypothesis)), - async function ExperimentController_updateExperimentCell(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewExperimentHypothesis(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"updateInputs":{"dataType":"boolean"},"metadata":{"dataType":"string"},"value":{"dataType":"string"},"status":{"dataType":"string"},"cellId":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"status":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["PENDING"]},{"dataType":"enum","enums":["RUNNING"]},{"dataType":"enum","enums":["COMPLETED"]},{"dataType":"enum","enums":["FAILED"]}],"required":true},"providerKeyId":{"dataType":"string","required":true},"promptVersion":{"dataType":"string","required":true},"model":{"dataType":"string","required":true},"experimentId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6929,7 +6944,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'updateExperimentCell', + methodName: 'createNewExperimentHypothesis', controller, response, next, @@ -6941,15 +6956,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/column', + app.post('/v1/experiment/hypothesis/:hypothesisId/scores/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentColumn)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentHypothesisScores)), - async function ExperimentController_createExperimentColumn(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentHypothesisScores(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputKeys":{"dataType":"array","array":{"dataType":"string"}},"promptVersionId":{"dataType":"string"},"hypothesisId":{"dataType":"string"},"columnType":{"dataType":"string","required":true},"columnName":{"dataType":"string","required":true}}}, + hypothesisId: {"in":"path","name":"hypothesisId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6962,7 +6976,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentColumn', + methodName: 'getExperimentHypothesisScores', controller, response, next, @@ -6974,15 +6988,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/row/new', + app.get('/v1/experiment/:experimentId/evaluators', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRow)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentEvaluators)), - async function ExperimentController_createExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentEvaluators(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputs":{"ref":"Record_string.string_"},"sourceRequest":{"dataType":"string"},"promptVersionId":{"dataType":"string","required":true}}}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6995,7 +7008,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentTableRow', + methodName: 'getExperimentEvaluators', controller, response, next, @@ -7007,15 +7020,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/v1/experiment/table/:experimentTableId/row/:rowIndex', + app.post('/v1/experiment/:experimentId/evaluators/run', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentTableRow)), + ...(fetchMiddlewares(ExperimentController.prototype.runExperimentEvaluatorsOld)), - async function ExperimentController_deleteExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_runExperimentEvaluatorsOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - rowIndex: {"in":"path","name":"rowIndex","required":true,"dataType":"double"}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7028,7 +7040,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'deleteExperimentTableRow', + methodName: 'runExperimentEvaluatorsOld', controller, response, next, @@ -7040,15 +7052,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/row/insert/batch', + app.post('/v1/experiment/:experimentId/evaluators', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRowWithCellsBatch)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentEvaluatorOld)), - async function ExperimentController_createExperimentTableRowWithCellsBatch(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"rows":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"cells":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"metadata":{"dataType":"any"},"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"columnId":{"dataType":"string","required":true}}},"required":true},"datasetId":{"dataType":"string","required":true},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}},"required":true}}}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"evaluatorId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7061,7 +7073,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentTableRowWithCellsBatch', + methodName: 'createExperimentEvaluatorOld', controller, response, next, @@ -7073,14 +7085,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/update-meta', + app.delete('/v1/experiment/:experimentId/evaluators/:evaluatorId', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentMeta)), + ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentEvaluatorOld)), - async function ExperimentController_updateExperimentMeta(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_deleteExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"meta":{"ref":"Record_string.string_","required":true},"experimentId":{"dataType":"string","required":true}}}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + evaluatorId: {"in":"path","name":"evaluatorId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7093,7 +7106,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'updateExperimentMeta', + methodName: 'deleteExperimentEvaluatorOld', controller, response, next, @@ -7105,14 +7118,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment', + app.post('/v1/experiment/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentOld)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentsOld)), - async function ExperimentController_createNewExperimentOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentsOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewExperimentParams"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"include":{"ref":"IncludeExperimentKeys"},"filter":{"ref":"ExperimentFilterNode","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7125,7 +7138,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createNewExperimentOld', + methodName: 'getExperimentsOld', controller, response, next, @@ -7137,14 +7150,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/hypothesis', + app.post('/v1/experiment/dataset', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentHypothesis)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.addDataset)), - async function ExperimentController_createNewExperimentHypothesis(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_addDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"status":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["PENDING"]},{"dataType":"enum","enums":["RUNNING"]},{"dataType":"enum","enums":["COMPLETED"]},{"dataType":"enum","enums":["FAILED"]}],"required":true},"providerKeyId":{"dataType":"string","required":true},"promptVersion":{"dataType":"string","required":true},"model":{"dataType":"string","required":true},"experimentId":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewDatasetParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7154,10 +7167,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'createNewExperimentHypothesis', + methodName: 'addDataset', controller, response, next, @@ -7169,14 +7182,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/hypothesis/:hypothesisId/scores/query', + app.post('/v1/experiment/dataset/random', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentHypothesisScores)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.addRandomDataset)), - async function ExperimentController_getExperimentHypothesisScores(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_addRandomDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - hypothesisId: {"in":"path","name":"hypothesisId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"RandomDatasetParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7186,10 +7199,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'getExperimentHypothesisScores', + methodName: 'addRandomDataset', controller, response, next, @@ -7201,14 +7214,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/v1/experiment/:experimentId/evaluators', + app.post('/v1/experiment/dataset/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentEvaluators)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDatasets)), - async function ExperimentController_getExperimentEvaluators(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_getDatasets(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"promptVersionId":{"dataType":"string"}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7218,10 +7231,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'getExperimentEvaluators', + methodName: 'getDatasets', controller, response, next, @@ -7233,15 +7246,16 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/:experimentId/evaluators/run', + app.post('/v1/experiment/dataset/:datasetId/row/insert', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.runExperimentEvaluatorsOld)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.insertDatasetRow)), - async function ExperimentController_runExperimentEvaluatorsOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_insertDatasetRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"originalColumnId":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, + datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -7250,10 +7264,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'runExperimentEvaluatorsOld', + methodName: 'insertDatasetRow', controller, response, next, @@ -7265,16 +7279,17 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/:experimentId/evaluators', + app.post('/v1/experiment/dataset/:datasetId/version/:promptVersionId/row/new', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentEvaluatorOld)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.createDatasetRow)), - async function ExperimentController_createExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_createDatasetRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"evaluatorId":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, + datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, + promptVersionId: {"in":"path","name":"promptVersionId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -7283,10 +7298,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'createExperimentEvaluatorOld', + methodName: 'createDatasetRow', controller, response, next, @@ -7298,16 +7313,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/v1/experiment/:experimentId/evaluators/:evaluatorId', + app.post('/v1/experiment/dataset/:datasetId/inputs/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentEvaluatorOld)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDataset)), - async function ExperimentController_deleteExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_getDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, - evaluatorId: {"in":"path","name":"evaluatorId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, + datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -7316,10 +7330,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'deleteExperimentEvaluatorOld', + methodName: 'getDataset', controller, response, next, @@ -7331,14 +7345,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/query', + app.post('/v1/experiment/dataset/:datasetId/mutate', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentsOld)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.mutateDataset)), - async function ExperimentController_getExperimentsOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_mutateDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"include":{"ref":"IncludeExperimentKeys"},"filter":{"ref":"ExperimentFilterNode","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"removeRequests":{"dataType":"array","array":{"dataType":"string"},"required":true},"addRequests":{"dataType":"array","array":{"dataType":"string"},"required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -7348,10 +7362,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'getExperimentsOld', + methodName: 'mutateDataset', controller, response, next, @@ -8930,6 +8944,131 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/org-name/query', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getOrgName)), + + async function PiController_getOrgName(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getOrgName', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/total-costs', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getTotalCosts)), + + async function PiController_getTotalCosts(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getTotalCosts', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/total_requests', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getTotalRequests)), + + async function PiController_getTotalRequests(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getTotalRequests', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/costs-over-time/query', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getCostsOverTime)), + + async function PiController_getCostsOverTime(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"DataOverTimeRequest"}, + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getCostsOverTime', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa app.get('/v1/settings/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(SettingController)), diff --git a/valhalla/jawn/src/tsoa-build/private/swagger.json b/valhalla/jawn/src/tsoa-build/private/swagger.json index 906a5d6b4..3ee4c99cd 100644 --- a/valhalla/jawn/src/tsoa-build/private/swagger.json +++ b/valhalla/jawn/src/tsoa-build/private/swagger.json @@ -6105,257 +6105,6 @@ } ] }, - "ResultSuccess__datasetId-string__": { - "properties": { - "data": { - "properties": { - "datasetId": { - "type": "string" - } - }, - "required": [ - "datasetId" - ], - "type": "object" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result__datasetId-string_.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess__datasetId-string__" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, - "DatasetMetadata": { - "properties": { - "promptVersionId": { - "type": "string" - }, - "inputRecordsIds": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": false - }, - "NewDatasetParams": { - "properties": { - "datasetName": { - "type": "string" - }, - "requestIds": { - "items": { - "type": "string" - }, - "type": "array" - }, - "datasetType": { - "type": "string", - "enum": [ - "experiment", - "helicone" - ] - }, - "meta": { - "$ref": "#/components/schemas/DatasetMetadata" - } - }, - "required": [ - "datasetName", - "requestIds", - "datasetType" - ], - "type": "object", - "additionalProperties": false - }, - "Pick_FilterLeaf.request-or-prompts_versions_": { - "properties": { - "request": { - "$ref": "#/components/schemas/Partial_RequestTableToOperators_" - }, - "prompts_versions": { - "$ref": "#/components/schemas/Partial_PromptVersionsToOperators_" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "FilterLeafSubset_request-or-prompts_versions_": { - "$ref": "#/components/schemas/Pick_FilterLeaf.request-or-prompts_versions_" - }, - "DatasetFilterNode": { - "anyOf": [ - { - "$ref": "#/components/schemas/FilterLeafSubset_request-or-prompts_versions_" - }, - { - "$ref": "#/components/schemas/DatasetFilterBranch" - }, - { - "type": "string", - "enum": [ - "all" - ] - } - ] - }, - "DatasetFilterBranch": { - "properties": { - "right": { - "$ref": "#/components/schemas/DatasetFilterNode" - }, - "operator": { - "type": "string", - "enum": [ - "or", - "and" - ] - }, - "left": { - "$ref": "#/components/schemas/DatasetFilterNode" - } - }, - "required": [ - "right", - "operator", - "left" - ], - "type": "object" - }, - "RandomDatasetParams": { - "properties": { - "datasetName": { - "type": "string" - }, - "filter": { - "$ref": "#/components/schemas/DatasetFilterNode" - }, - "offset": { - "type": "number", - "format": "double" - }, - "limit": { - "type": "number", - "format": "double" - } - }, - "required": [ - "datasetName", - "filter" - ], - "type": "object", - "additionalProperties": false - }, - "DatasetResult": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "meta": { - "$ref": "#/components/schemas/DatasetMetadata" - } - }, - "required": [ - "id", - "name", - "created_at" - ], - "type": "object", - "additionalProperties": false - }, - "ResultSuccess_DatasetResult-Array_": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/DatasetResult" - }, - "type": "array" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result_DatasetResult-Array.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess_DatasetResult-Array_" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, - "ResultSuccess___-Array_": { - "properties": { - "data": { - "items": { - "properties": {}, - "type": "object" - }, - "type": "array" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result___-Array.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess___-Array_" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, "ResultSuccess__tableId-string--experimentId-string__": { "properties": { "data": { @@ -7276,11 +7025,262 @@ "type": "object", "additionalProperties": false }, - "HeliconeDatasetMetadata": { + "ResultSuccess__datasetId-string__": { "properties": { - "promptVersionId": { - "type": "string" - }, + "data": { + "properties": { + "datasetId": { + "type": "string" + } + }, + "required": [ + "datasetId" + ], + "type": "object" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result__datasetId-string_.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess__datasetId-string__" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "DatasetMetadata": { + "properties": { + "promptVersionId": { + "type": "string" + }, + "inputRecordsIds": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "additionalProperties": false + }, + "NewDatasetParams": { + "properties": { + "datasetName": { + "type": "string" + }, + "requestIds": { + "items": { + "type": "string" + }, + "type": "array" + }, + "datasetType": { + "type": "string", + "enum": [ + "experiment", + "helicone" + ] + }, + "meta": { + "$ref": "#/components/schemas/DatasetMetadata" + } + }, + "required": [ + "datasetName", + "requestIds", + "datasetType" + ], + "type": "object", + "additionalProperties": false + }, + "Pick_FilterLeaf.request-or-prompts_versions_": { + "properties": { + "request": { + "$ref": "#/components/schemas/Partial_RequestTableToOperators_" + }, + "prompts_versions": { + "$ref": "#/components/schemas/Partial_PromptVersionsToOperators_" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "FilterLeafSubset_request-or-prompts_versions_": { + "$ref": "#/components/schemas/Pick_FilterLeaf.request-or-prompts_versions_" + }, + "DatasetFilterNode": { + "anyOf": [ + { + "$ref": "#/components/schemas/FilterLeafSubset_request-or-prompts_versions_" + }, + { + "$ref": "#/components/schemas/DatasetFilterBranch" + }, + { + "type": "string", + "enum": [ + "all" + ] + } + ] + }, + "DatasetFilterBranch": { + "properties": { + "right": { + "$ref": "#/components/schemas/DatasetFilterNode" + }, + "operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "left": { + "$ref": "#/components/schemas/DatasetFilterNode" + } + }, + "required": [ + "right", + "operator", + "left" + ], + "type": "object" + }, + "RandomDatasetParams": { + "properties": { + "datasetName": { + "type": "string" + }, + "filter": { + "$ref": "#/components/schemas/DatasetFilterNode" + }, + "offset": { + "type": "number", + "format": "double" + }, + "limit": { + "type": "number", + "format": "double" + } + }, + "required": [ + "datasetName", + "filter" + ], + "type": "object", + "additionalProperties": false + }, + "DatasetResult": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "meta": { + "$ref": "#/components/schemas/DatasetMetadata" + } + }, + "required": [ + "id", + "name", + "created_at" + ], + "type": "object", + "additionalProperties": false + }, + "ResultSuccess_DatasetResult-Array_": { + "properties": { + "data": { + "items": { + "$ref": "#/components/schemas/DatasetResult" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result_DatasetResult-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess_DatasetResult-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "ResultSuccess___-Array_": { + "properties": { + "data": { + "items": { + "properties": {}, + "type": "object" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result___-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess___-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "HeliconeDatasetMetadata": { + "properties": { + "promptVersionId": { + "type": "string" + }, "inputRecordsIds": { "items": { "type": "string" @@ -9193,8 +9193,54 @@ "$ref": "#/components/schemas/ResultError_string_" } ] - } - }, + }, + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + "properties": { + "data": { + "items": { + "properties": { + "created_at_trunc": { + "type": "string" + }, + "cost": { + "type": "number", + "format": "double" + } + }, + "required": [ + "created_at_trunc", + "cost" + ], + "type": "object" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result__cost-number--created_at_trunc-string_-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess__cost-number--created_at_trunc-string_-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + } + }, "securitySchemes": { "api_key": { "type": "apiKey", @@ -14086,23 +14132,23 @@ "parameters": [] } }, - "/v1/experiment/dataset": { + "/v1/experiment/new-empty": { "post": { - "operationId": "AddDataset", + "operationId": "CreateNewEmptyExperiment", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__datasetId-string_.string_" + "$ref": "#/components/schemas/Result__experimentId-string_.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14115,30 +14161,42 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewDatasetParams" + "properties": { + "datasetId": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/Record_string.string_" + } + }, + "required": [ + "datasetId", + "metadata" + ], + "type": "object" } } } } } }, - "/v1/experiment/dataset/random": { + "/v1/experiment/table/new": { "post": { - "operationId": "AddRandomDataset", + "operationId": "CreateNewExperimentTable", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__datasetId-string_.string_" + "$ref": "#/components/schemas/Result__tableId-string--experimentId-string_.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14151,71 +14209,65 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RandomDatasetParams" + "$ref": "#/components/schemas/CreateExperimentTableParams" } } } } } }, - "/v1/experiment/dataset/query": { + "/v1/experiment/table/{experimentTableId}/query": { "post": { - "operationId": "GetDatasets", + "operationId": "GetExperimentTableById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_DatasetResult-Array.string_" + "$ref": "#/components/schemas/Result_ExperimentTable.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { "api_key": [] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "promptVersionId": { - "type": "string" - } - }, - "type": "object" - } + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/v1/experiment/dataset/{datasetId}/row/insert": { + "/v1/experiment/table/{experimentTableId}/metadata/query": { "post": { - "operationId": "InsertDatasetRow", + "operationId": "GetExperimentTableMetadata", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_string.string_" + "$ref": "#/components/schemas/Result_ExperimentTableSimplified.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14225,57 +14277,58 @@ "parameters": [ { "in": "path", - "name": "datasetId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "originalColumnId": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "inputRecordId": { - "type": "string" - } - }, - "required": [ - "inputs", - "inputRecordId" - ], - "type": "object" + ] + } + }, + "/v1/experiment/tables/query": { + "post": { + "operationId": "GetExperimentTables", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_ExperimentTableSimplified-Array.string_" + } } } } - } + }, + "tags": [ + "Experiment" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] } }, - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + "/v1/experiment/table/{experimentTableId}/cell": { "post": { - "operationId": "CreateDatasetRow", + "operationId": "CreateExperimentCell", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_string.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14285,15 +14338,7 @@ "parameters": [ { "in": "path", - "name": "datasetId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "promptVersionId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" @@ -14306,40 +14351,45 @@ "application/json": { "schema": { "properties": { - "sourceRequest": { - "type": "string" + "value": { + "type": "string", + "nullable": true }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" + "rowIndex": { + "type": "number", + "format": "double" + }, + "columnId": { + "type": "string" } }, "required": [ - "inputs" + "value", + "rowIndex", + "columnId" ], "type": "object" } } } } - } - }, - "/v1/experiment/dataset/{datasetId}/inputs/query": { - "post": { - "operationId": "GetDataset", + }, + "patch": { + "operationId": "UpdateExperimentCell", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_PromptInputRecord-Array.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14349,61 +14399,106 @@ "parameters": [ { "in": "path", - "name": "datasetId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "updateInputs": { + "type": "boolean" + }, + "metadata": { + "type": "string" + }, + "value": { + "type": "string" + }, + "status": { + "type": "string" + }, + "cellId": { + "type": "string" + } + }, + "required": [ + "cellId" + ], + "type": "object" + } + } + } + } } }, - "/v1/experiment/dataset/{datasetId}/mutate": { + "/v1/experiment/table/{experimentTableId}/column": { "post": { - "operationId": "MutateDataset", + "operationId": "CreateExperimentColumn", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result___-Array.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { "api_key": [] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { "schema": { "properties": { - "removeRequests": { + "inputKeys": { "items": { "type": "string" }, "type": "array" }, - "addRequests": { - "items": { - "type": "string" - }, - "type": "array" + "promptVersionId": { + "type": "string" + }, + "hypothesisId": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "columnName": { + "type": "string" } }, "required": [ - "removeRequests", - "addRequests" + "columnType", + "columnName" ], "type": "object" } @@ -14412,16 +14507,16 @@ } } }, - "/v1/experiment/new-empty": { + "/v1/experiment/table/{experimentTableId}/row/new": { "post": { - "operationId": "CreateNewEmptyExperiment", + "operationId": "CreateExperimentTableRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__experimentId-string_.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14435,23 +14530,34 @@ "api_key": [] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "datasetId": { + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "sourceRequest": { "type": "string" }, - "metadata": { - "$ref": "#/components/schemas/Record_string.string_" + "promptVersionId": { + "type": "string" } }, "required": [ - "datasetId", - "metadata" + "promptVersionId" ], "type": "object" } @@ -14460,52 +14566,16 @@ } } }, - "/v1/experiment/table/new": { - "post": { - "operationId": "CreateNewExperimentTable", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result__tableId-string--experimentId-string_.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateExperimentTableParams" - } - } - } - } - } - }, - "/v1/experiment/table/{experimentTableId}/query": { - "post": { - "operationId": "GetExperimentTableById", + "/v1/experiment/table/{experimentTableId}/row/{rowIndex}": { + "delete": { + "operationId": "DeleteExperimentTableRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTable.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14527,20 +14597,29 @@ "schema": { "type": "string" } + }, + { + "in": "path", + "name": "rowIndex", + "required": true, + "schema": { + "format": "double", + "type": "number" + } } ] } }, - "/v1/experiment/table/{experimentTableId}/metadata/query": { + "/v1/experiment/table/{experimentTableId}/row/insert/batch": { "post": { - "operationId": "GetExperimentTableMetadata", + "operationId": "CreateExperimentTableRowWithCellsBatch", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTableSimplified.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14563,19 +14642,87 @@ "type": "string" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "rows": { + "items": { + "properties": { + "sourceRequest": { + "type": "string" + }, + "cells": { + "items": { + "properties": { + "metadata": {}, + "value": { + "type": "string", + "nullable": true + }, + "columnId": { + "type": "string" + } + }, + "required": [ + "value", + "columnId" + ], + "type": "object" + }, + "type": "array" + }, + "datasetId": { + "type": "string" + }, + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "inputRecordId": { + "type": "string" + } + }, + "required": [ + "cells", + "datasetId", + "inputs", + "inputRecordId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "rows" + ], + "type": "object" + } + } + } + } } }, - "/v1/experiment/tables/query": { + "/v1/experiment/update-meta": { "post": { - "operationId": "GetExperimentTables", + "operationId": "UpdateExperimentMeta", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTableSimplified-Array.string_" + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess_unknown_" + }, + { + "$ref": "#/components/schemas/ResultError_PostgrestError_" + } + ] } } } @@ -14589,19 +14736,41 @@ "api_key": [] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "meta": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "experimentId": { + "type": "string" + } + }, + "required": [ + "meta", + "experimentId" + ], + "type": "object" + } + } + } + } } }, - "/v1/experiment/table/{experimentTableId}/cell": { + "/v1/experiment": { "post": { - "operationId": "CreateExperimentCell", + "operationId": "CreateNewExperimentOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result__experimentId-string_.string_" } } } @@ -14615,54 +14784,29 @@ "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "value": { - "type": "string", - "nullable": true - }, - "rowIndex": { - "type": "number", - "format": "double" - }, - "columnId": { - "type": "string" - } - }, - "required": [ - "value", - "rowIndex", - "columnId" - ], - "type": "object" + "$ref": "#/components/schemas/NewExperimentParams" } } } } - }, - "patch": { - "operationId": "UpdateExperimentCell", + } + }, + "/v1/experiment/hypothesis": { + "post": { + "operationId": "CreateNewExperimentHypothesis", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result__hypothesisId-string_.string_" } } } @@ -14676,40 +14820,41 @@ "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "updateInputs": { - "type": "boolean" + "status": { + "type": "string", + "enum": [ + "PENDING", + "RUNNING", + "COMPLETED", + "FAILED" + ] }, - "metadata": { + "providerKeyId": { "type": "string" }, - "value": { + "promptVersion": { "type": "string" }, - "status": { + "model": { "type": "string" }, - "cellId": { + "experimentId": { "type": "string" } }, "required": [ - "cellId" + "status", + "providerKeyId", + "promptVersion", + "model", + "experimentId" ], "type": "object" } @@ -14718,16 +14863,16 @@ } } }, - "/v1/experiment/table/{experimentTableId}/column": { + "/v1/experiment/hypothesis/{hypothesisId}/scores/query": { "post": { - "operationId": "CreateExperimentColumn", + "operationId": "GetExperimentHypothesisScores", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result__runsCount-number--scores-Record_string.Score__.string_" } } } @@ -14744,52 +14889,51 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "hypothesisId", "required": true, "schema": { "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "inputKeys": { - "items": { - "type": "string" - }, - "type": "array" - }, - "promptVersionId": { - "type": "string" - }, - "hypothesisId": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "columnName": { - "type": "string" - } - }, - "required": [ - "columnType", - "columnName" - ], - "type": "object" + ] + } + }, + "/v1/experiment/{experimentId}/evaluators": { + "get": { + "operationId": "GetExperimentEvaluators", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_EvaluatorResult-Array.string_" + } } } } - } - } - }, - "/v1/experiment/table/{experimentTableId}/row/new": { + }, + "tags": [ + "Experiment" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "experimentId", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, "post": { - "operationId": "CreateExperimentTableRow", + "operationId": "CreateExperimentEvaluatorOld", "responses": { "200": { "description": "Ok", @@ -14813,7 +14957,7 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "experimentId", "required": true, "schema": { "type": "string" @@ -14826,18 +14970,12 @@ "application/json": { "schema": { "properties": { - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "sourceRequest": { - "type": "string" - }, - "promptVersionId": { + "evaluatorId": { "type": "string" } }, "required": [ - "promptVersionId" + "evaluatorId" ], "type": "object" } @@ -14846,9 +14984,9 @@ } } }, - "/v1/experiment/table/{experimentTableId}/row/{rowIndex}": { - "delete": { - "operationId": "DeleteExperimentTableRow", + "/v1/experiment/{experimentId}/evaluators/run": { + "post": { + "operationId": "RunExperimentEvaluatorsOld", "responses": { "200": { "description": "Ok", @@ -14872,27 +15010,18 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "experimentId", "required": true, "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rowIndex", - "required": true, - "schema": { - "format": "double", - "type": "number" - } } ] } }, - "/v1/experiment/table/{experimentTableId}/row/insert/batch": { - "post": { - "operationId": "CreateExperimentTableRowWithCellsBatch", + "/v1/experiment/{experimentId}/evaluators/{evaluatorId}": { + "delete": { + "operationId": "DeleteExperimentEvaluatorOld", "responses": { "200": { "description": "Ok", @@ -14916,93 +15045,33 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "experimentId", "required": true, "schema": { "type": "string" } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "rows": { - "items": { - "properties": { - "sourceRequest": { - "type": "string" - }, - "cells": { - "items": { - "properties": { - "metadata": {}, - "value": { - "type": "string", - "nullable": true - }, - "columnId": { - "type": "string" - } - }, - "required": [ - "value", - "columnId" - ], - "type": "object" - }, - "type": "array" - }, - "datasetId": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "inputRecordId": { - "type": "string" - } - }, - "required": [ - "cells", - "datasetId", - "inputs", - "inputRecordId" - ], - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "rows" - ], - "type": "object" - } + }, + { + "in": "path", + "name": "evaluatorId", + "required": true, + "schema": { + "type": "string" } } - } + ] } }, - "/v1/experiment/update-meta": { + "/v1/experiment/query": { "post": { - "operationId": "UpdateExperimentMeta", + "operationId": "GetExperimentsOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess_unknown_" - }, - { - "$ref": "#/components/schemas/ResultError_PostgrestError_" - } - ] + "$ref": "#/components/schemas/Result_Experiment-Array.string_" } } } @@ -15023,16 +15092,15 @@ "application/json": { "schema": { "properties": { - "meta": { - "$ref": "#/components/schemas/Record_string.string_" + "include": { + "$ref": "#/components/schemas/IncludeExperimentKeys" }, - "experimentId": { - "type": "string" + "filter": { + "$ref": "#/components/schemas/ExperimentFilterNode" } }, "required": [ - "meta", - "experimentId" + "filter" ], "type": "object" } @@ -15041,23 +15109,23 @@ } } }, - "/v1/experiment": { + "/v1/experiment/dataset": { "post": { - "operationId": "CreateNewExperimentOld", + "operationId": "AddDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__experimentId-string_.string_" + "$ref": "#/components/schemas/Result__datasetId-string_.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -15070,30 +15138,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewExperimentParams" + "$ref": "#/components/schemas/NewDatasetParams" } } } } } }, - "/v1/experiment/hypothesis": { + "/v1/experiment/dataset/random": { "post": { - "operationId": "CreateNewExperimentHypothesis", + "operationId": "AddRandomDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__hypothesisId-string_.string_" + "$ref": "#/components/schemas/Result__datasetId-string_.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -15106,128 +15174,71 @@ "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string", - "enum": [ - "PENDING", - "RUNNING", - "COMPLETED", - "FAILED" - ] - }, - "providerKeyId": { - "type": "string" - }, - "promptVersion": { - "type": "string" - }, - "model": { - "type": "string" - }, - "experimentId": { - "type": "string" - } - }, - "required": [ - "status", - "providerKeyId", - "promptVersion", - "model", - "experimentId" - ], - "type": "object" + "$ref": "#/components/schemas/RandomDatasetParams" } } } } } }, - "/v1/experiment/hypothesis/{hypothesisId}/scores/query": { - "post": { - "operationId": "GetExperimentHypothesisScores", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result__runsCount-number--scores-Record_string.Score__.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "hypothesisId", - "required": true, - "schema": { - "type": "string" - } - } - ] - } - }, - "/v1/experiment/{experimentId}/evaluators": { - "get": { - "operationId": "GetExperimentEvaluators", + "/v1/experiment/dataset/query": { + "post": { + "operationId": "GetDatasets", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_EvaluatorResult-Array.string_" + "$ref": "#/components/schemas/Result_DatasetResult-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "promptVersionId": { + "type": "string" + } + }, + "type": "object" + } } } - ] - }, + } + } + }, + "/v1/experiment/dataset/{datasetId}/row/insert": { "post": { - "operationId": "CreateExperimentEvaluatorOld", + "operationId": "InsertDatasetRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_string.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -15237,7 +15248,7 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "datasetId", "required": true, "schema": { "type": "string" @@ -15250,12 +15261,19 @@ "application/json": { "schema": { "properties": { - "evaluatorId": { + "originalColumnId": { + "type": "string" + }, + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "inputRecordId": { "type": "string" } }, "required": [ - "evaluatorId" + "inputs", + "inputRecordId" ], "type": "object" } @@ -15264,23 +15282,23 @@ } } }, - "/v1/experiment/{experimentId}/evaluators/run": { + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { "post": { - "operationId": "RunExperimentEvaluatorsOld", + "operationId": "CreateDatasetRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_string.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -15290,32 +15308,61 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "datasetId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "promptVersionId", "required": true, "schema": { "type": "string" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "sourceRequest": { + "type": "string" + }, + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + } + }, + "required": [ + "inputs" + ], + "type": "object" + } + } + } + } } }, - "/v1/experiment/{experimentId}/evaluators/{evaluatorId}": { - "delete": { - "operationId": "DeleteExperimentEvaluatorOld", + "/v1/experiment/dataset/{datasetId}/inputs/query": { + "post": { + "operationId": "GetDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_PromptInputRecord-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -15325,15 +15372,7 @@ "parameters": [ { "in": "path", - "name": "experimentId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "evaluatorId", + "name": "datasetId", "required": true, "schema": { "type": "string" @@ -15342,23 +15381,23 @@ ] } }, - "/v1/experiment/query": { + "/v1/experiment/dataset/{datasetId}/mutate": { "post": { - "operationId": "GetExperimentsOld", + "operationId": "MutateDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_Experiment-Array.string_" + "$ref": "#/components/schemas/Result___-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -15372,15 +15411,22 @@ "application/json": { "schema": { "properties": { - "include": { - "$ref": "#/components/schemas/IncludeExperimentKeys" + "removeRequests": { + "items": { + "type": "string" + }, + "type": "array" }, - "filter": { - "$ref": "#/components/schemas/ExperimentFilterNode" + "addRequests": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "filter" + "removeRequests", + "addRequests" ], "type": "object" } @@ -17446,6 +17492,133 @@ } } }, + "/v1/pi/org-name/query": { + "post": { + "operationId": "GetOrgName", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_string.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/total-costs": { + "post": { + "operationId": "GetTotalCosts", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_number.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/total_requests": { + "post": { + "operationId": "GetTotalRequests", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_number.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/costs-over-time/query": { + "post": { + "operationId": "GetCostsOverTime", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__cost-number--created_at_trunc-string_-Array.string_" + }, + "examples": { + "Example 1": { + "value": { + "userFilter": "all", + "timeFilter": { + "start": "2024-01-01", + "end": "2024-01-31" + }, + "dbIncrement": "day", + "timeZoneDifference": 0 + } + } + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataOverTimeRequest" + } + } + } + } + } + }, "/v1/settings/query": { "get": { "operationId": "GetSettings", diff --git a/valhalla/jawn/src/tsoa-build/public/routes.ts b/valhalla/jawn/src/tsoa-build/public/routes.ts index ea338fe28..722d791dc 100644 --- a/valhalla/jawn/src/tsoa-build/public/routes.ts +++ b/valhalla/jawn/src/tsoa-build/public/routes.ts @@ -38,10 +38,10 @@ import { PropertyController } from './../../controllers/public/propertyControlle // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { IntegrationController } from './../../controllers/public/integrationController'; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa -import { ExperimentController } from './../../controllers/public/experimentController'; -// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { ExperimentDatasetController } from './../../controllers/public/experimentDatasetController'; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa +import { ExperimentController } from './../../controllers/public/experimentController'; +// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { HeliconeDatasetController } from './../../controllers/public/heliconeDatasetController'; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa import { DataIsBeautifulRouter } from './../../controllers/public/dataIsBeautifulController'; @@ -1624,6 +1624,120 @@ const models: TsoaRoute.Models = { "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess_Array__id-string--name-string___"},{"ref":"ResultError_string_"}],"validators":{}}, }, // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess__datasetId-string__": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true}},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result__datasetId-string_.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__datasetId-string__"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetMetadata": { + "dataType": "refObject", + "properties": { + "promptVersionId": {"dataType":"string"}, + "inputRecordsIds": {"dataType":"array","array":{"dataType":"string"}}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "NewDatasetParams": { + "dataType": "refObject", + "properties": { + "datasetName": {"dataType":"string","required":true}, + "requestIds": {"dataType":"array","array":{"dataType":"string"},"required":true}, + "datasetType": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["experiment"]},{"dataType":"enum","enums":["helicone"]}],"required":true}, + "meta": {"ref":"DatasetMetadata"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Partial_TimestampOperators_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"gte":{"dataType":"string"},"lte":{"dataType":"string"},"lt":{"dataType":"string"},"gt":{"dataType":"string"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Partial_RequestTableToOperators_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"prompt":{"ref":"Partial_TextOperators_"},"created_at":{"ref":"Partial_TimestampOperators_"},"user_id":{"ref":"Partial_TextOperators_"},"auth_hash":{"ref":"Partial_TextOperators_"},"org_id":{"ref":"Partial_TextOperators_"},"id":{"ref":"Partial_TextOperators_"},"node_id":{"ref":"Partial_TextOperators_"},"model":{"ref":"Partial_TextOperators_"},"modelOverride":{"ref":"Partial_TextOperators_"},"path":{"ref":"Partial_TextOperators_"},"prompt_id":{"ref":"Partial_TextOperators_"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Pick_FilterLeaf.request-or-prompts_versions_": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"request":{"ref":"Partial_RequestTableToOperators_"},"prompts_versions":{"ref":"Partial_PromptVersionsToOperators_"}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "FilterLeafSubset_request-or-prompts_versions_": { + "dataType": "refAlias", + "type": {"ref":"Pick_FilterLeaf.request-or-prompts_versions_","validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetFilterNode": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"FilterLeafSubset_request-or-prompts_versions_"},{"ref":"DatasetFilterBranch"},{"dataType":"enum","enums":["all"]}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetFilterBranch": { + "dataType": "refAlias", + "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"right":{"ref":"DatasetFilterNode","required":true},"operator":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["or"]},{"dataType":"enum","enums":["and"]}],"required":true},"left":{"ref":"DatasetFilterNode","required":true}},"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "RandomDatasetParams": { + "dataType": "refObject", + "properties": { + "datasetName": {"dataType":"string","required":true}, + "filter": {"ref":"DatasetFilterNode","required":true}, + "offset": {"dataType":"double"}, + "limit": {"dataType":"double"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "DatasetResult": { + "dataType": "refObject", + "properties": { + "id": {"dataType":"string","required":true}, + "name": {"dataType":"string","required":true}, + "created_at": {"dataType":"string","required":true}, + "meta": {"ref":"DatasetMetadata"}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess_DatasetResult-Array_": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetResult"},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result_DatasetResult-Array.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess_DatasetResult-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess___-Array_": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{}},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result___-Array.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess___-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa "ResultSuccess__tableId-string--experimentId-string__": { "dataType": "refObject", "properties": { @@ -1916,120 +2030,6 @@ const models: TsoaRoute.Models = { "additionalProperties": false, }, // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResultSuccess__datasetId-string__": { - "dataType": "refObject", - "properties": { - "data": {"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true}},"required":true}, - "error": {"dataType":"enum","enums":[null],"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Result__datasetId-string_.string_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__datasetId-string__"},{"ref":"ResultError_string_"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetMetadata": { - "dataType": "refObject", - "properties": { - "promptVersionId": {"dataType":"string"}, - "inputRecordsIds": {"dataType":"array","array":{"dataType":"string"}}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "NewDatasetParams": { - "dataType": "refObject", - "properties": { - "datasetName": {"dataType":"string","required":true}, - "requestIds": {"dataType":"array","array":{"dataType":"string"},"required":true}, - "datasetType": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["experiment"]},{"dataType":"enum","enums":["helicone"]}],"required":true}, - "meta": {"ref":"DatasetMetadata"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Partial_TimestampOperators_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"gte":{"dataType":"string"},"lte":{"dataType":"string"},"lt":{"dataType":"string"},"gt":{"dataType":"string"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Partial_RequestTableToOperators_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"prompt":{"ref":"Partial_TextOperators_"},"created_at":{"ref":"Partial_TimestampOperators_"},"user_id":{"ref":"Partial_TextOperators_"},"auth_hash":{"ref":"Partial_TextOperators_"},"org_id":{"ref":"Partial_TextOperators_"},"id":{"ref":"Partial_TextOperators_"},"node_id":{"ref":"Partial_TextOperators_"},"model":{"ref":"Partial_TextOperators_"},"modelOverride":{"ref":"Partial_TextOperators_"},"path":{"ref":"Partial_TextOperators_"},"prompt_id":{"ref":"Partial_TextOperators_"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Pick_FilterLeaf.request-or-prompts_versions_": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"request":{"ref":"Partial_RequestTableToOperators_"},"prompts_versions":{"ref":"Partial_PromptVersionsToOperators_"}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "FilterLeafSubset_request-or-prompts_versions_": { - "dataType": "refAlias", - "type": {"ref":"Pick_FilterLeaf.request-or-prompts_versions_","validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetFilterNode": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"FilterLeafSubset_request-or-prompts_versions_"},{"ref":"DatasetFilterBranch"},{"dataType":"enum","enums":["all"]}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetFilterBranch": { - "dataType": "refAlias", - "type": {"dataType":"nestedObjectLiteral","nestedProperties":{"right":{"ref":"DatasetFilterNode","required":true},"operator":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["or"]},{"dataType":"enum","enums":["and"]}],"required":true},"left":{"ref":"DatasetFilterNode","required":true}},"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "RandomDatasetParams": { - "dataType": "refObject", - "properties": { - "datasetName": {"dataType":"string","required":true}, - "filter": {"ref":"DatasetFilterNode","required":true}, - "offset": {"dataType":"double"}, - "limit": {"dataType":"double"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "DatasetResult": { - "dataType": "refObject", - "properties": { - "id": {"dataType":"string","required":true}, - "name": {"dataType":"string","required":true}, - "created_at": {"dataType":"string","required":true}, - "meta": {"ref":"DatasetMetadata"}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResultSuccess_DatasetResult-Array_": { - "dataType": "refObject", - "properties": { - "data": {"dataType":"array","array":{"dataType":"refObject","ref":"DatasetResult"},"required":true}, - "error": {"dataType":"enum","enums":[null],"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Result_DatasetResult-Array.string_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess_DatasetResult-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "ResultSuccess___-Array_": { - "dataType": "refObject", - "properties": { - "data": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{}},"required":true}, - "error": {"dataType":"enum","enums":[null],"required":true}, - }, - "additionalProperties": false, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - "Result___-Array.string_": { - "dataType": "refAlias", - "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess___-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, - }, - // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa "HeliconeDatasetMetadata": { "dataType": "refObject", "properties": { @@ -2614,6 +2614,20 @@ const models: TsoaRoute.Models = { "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__apiKey-string__"},{"ref":"ResultError_string_"}],"validators":{}}, }, // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + "dataType": "refObject", + "properties": { + "data": {"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"created_at_trunc":{"dataType":"string","required":true},"cost":{"dataType":"double","required":true}}},"required":true}, + "error": {"dataType":"enum","enums":[null],"required":true}, + }, + "additionalProperties": false, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + "Result__cost-number--created_at_trunc-string_-Array.string_": { + "dataType": "refAlias", + "type": {"dataType":"union","subSchemas":[{"ref":"ResultSuccess__cost-number--created_at_trunc-string_-Array_"},{"ref":"ResultError_string_"}],"validators":{}}, + }, + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa "LlmType": { "dataType": "refAlias", "type": {"dataType":"union","subSchemas":[{"dataType":"enum","enums":["chat"]},{"dataType":"enum","enums":["completion"]}],"validators":{}}, @@ -6004,14 +6018,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/new-empty', + app.post('/v1/experiment/dataset', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewEmptyExperiment)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.addDataset)), - async function ExperimentController_createNewEmptyExperiment(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_addDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true},"metadata":{"ref":"Record_string.string_","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewDatasetParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6021,10 +6035,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'createNewEmptyExperiment', + methodName: 'addDataset', controller, response, next, @@ -6036,14 +6050,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/new', + app.post('/v1/experiment/dataset/random', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentTable)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.addRandomDataset)), - async function ExperimentController_createNewExperimentTable(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_addRandomDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"CreateExperimentTableParams"}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"RandomDatasetParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6053,10 +6067,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'createNewExperimentTable', + methodName: 'addRandomDataset', controller, response, next, @@ -6068,14 +6082,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/query', + app.post('/v1/experiment/dataset/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableById)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDatasets)), - async function ExperimentController_getExperimentTableById(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_getDatasets(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"promptVersionId":{"dataType":"string"}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6085,10 +6099,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'getExperimentTableById', + methodName: 'getDatasets', controller, response, next, @@ -6100,15 +6114,16 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/metadata/query', + app.post('/v1/experiment/dataset/:datasetId/row/insert', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableMetadata)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.insertDatasetRow)), - async function ExperimentController_getExperimentTableMetadata(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_insertDatasetRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"originalColumnId":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, + datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6117,10 +6132,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'getExperimentTableMetadata', + methodName: 'insertDatasetRow', controller, response, next, @@ -6132,14 +6147,17 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/tables/query', + app.post('/v1/experiment/dataset/:datasetId/version/:promptVersionId/row/new', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTables)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.createDatasetRow)), - async function ExperimentController_getExperimentTables(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_createDatasetRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, + datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, + promptVersionId: {"in":"path","name":"promptVersionId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6148,10 +6166,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'getExperimentTables', + methodName: 'createDatasetRow', controller, response, next, @@ -6163,16 +6181,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/cell', + app.post('/v1/experiment/dataset/:datasetId/inputs/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentCell)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDataset)), - async function ExperimentController_createExperimentCell(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_getDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"rowIndex":{"dataType":"double","required":true},"columnId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, + datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6181,10 +6198,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'createExperimentCell', + methodName: 'getDataset', controller, response, next, @@ -6196,15 +6213,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.patch('/v1/experiment/table/:experimentTableId/cell', + app.post('/v1/experiment/dataset/:datasetId/mutate', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentCell)), + ...(fetchMiddlewares(ExperimentDatasetController)), + ...(fetchMiddlewares(ExperimentDatasetController.prototype.mutateDataset)), - async function ExperimentController_updateExperimentCell(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentDatasetController_mutateDataset(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"updateInputs":{"dataType":"boolean"},"metadata":{"dataType":"string"},"value":{"dataType":"string"},"status":{"dataType":"string"},"cellId":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"removeRequests":{"dataType":"array","array":{"dataType":"string"},"required":true},"addRequests":{"dataType":"array","array":{"dataType":"string"},"required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6214,10 +6230,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentController(); + const controller = new ExperimentDatasetController(); await templateService.apiHandler({ - methodName: 'updateExperimentCell', + methodName: 'mutateDataset', controller, response, next, @@ -6229,15 +6245,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/column', + app.post('/v1/experiment/new-empty', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentColumn)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewEmptyExperiment)), - async function ExperimentController_createExperimentColumn(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewEmptyExperiment(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputKeys":{"dataType":"array","array":{"dataType":"string"}},"promptVersionId":{"dataType":"string"},"hypothesisId":{"dataType":"string"},"columnType":{"dataType":"string","required":true},"columnName":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"datasetId":{"dataType":"string","required":true},"metadata":{"ref":"Record_string.string_","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6250,7 +6265,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentColumn', + methodName: 'createNewEmptyExperiment', controller, response, next, @@ -6262,15 +6277,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/row/new', + app.post('/v1/experiment/table/new', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRow)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentTable)), - async function ExperimentController_createExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewExperimentTable(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputs":{"ref":"Record_string.string_"},"sourceRequest":{"dataType":"string"},"promptVersionId":{"dataType":"string","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"CreateExperimentTableParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6283,7 +6297,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentTableRow', + methodName: 'createNewExperimentTable', controller, response, next, @@ -6295,15 +6309,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/v1/experiment/table/:experimentTableId/row/:rowIndex', + app.post('/v1/experiment/table/:experimentTableId/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentTableRow)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableById)), - async function ExperimentController_deleteExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentTableById(request: ExRequest, response: ExResponse, next: any) { const args: Record = { experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - rowIndex: {"in":"path","name":"rowIndex","required":true,"dataType":"double"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6316,7 +6329,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'deleteExperimentTableRow', + methodName: 'getExperimentTableById', controller, response, next, @@ -6328,15 +6341,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/table/:experimentTableId/row/insert/batch', + app.post('/v1/experiment/table/:experimentTableId/metadata/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRowWithCellsBatch)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTableMetadata)), - async function ExperimentController_createExperimentTableRowWithCellsBatch(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentTableMetadata(request: ExRequest, response: ExResponse, next: any) { const args: Record = { experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"rows":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"cells":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"metadata":{"dataType":"any"},"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"columnId":{"dataType":"string","required":true}}},"required":true},"datasetId":{"dataType":"string","required":true},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}},"required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6349,7 +6361,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentTableRowWithCellsBatch', + methodName: 'getExperimentTableMetadata', controller, response, next, @@ -6361,14 +6373,13 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/update-meta', + app.post('/v1/experiment/tables/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentMeta)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentTables)), - async function ExperimentController_updateExperimentMeta(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentTables(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"meta":{"ref":"Record_string.string_","required":true},"experimentId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6381,7 +6392,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'updateExperimentMeta', + methodName: 'getExperimentTables', controller, response, next, @@ -6393,14 +6404,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment', + app.post('/v1/experiment/table/:experimentTableId/cell', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentOld)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentCell)), - async function ExperimentController_createNewExperimentOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentCell(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewExperimentParams"}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"rowIndex":{"dataType":"double","required":true},"columnId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6413,7 +6425,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createNewExperimentOld', + methodName: 'createExperimentCell', controller, response, next, @@ -6425,14 +6437,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/hypothesis', + app.patch('/v1/experiment/table/:experimentTableId/cell', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentHypothesis)), + ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentCell)), - async function ExperimentController_createNewExperimentHypothesis(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_updateExperimentCell(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"status":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["PENDING"]},{"dataType":"enum","enums":["RUNNING"]},{"dataType":"enum","enums":["COMPLETED"]},{"dataType":"enum","enums":["FAILED"]}],"required":true},"providerKeyId":{"dataType":"string","required":true},"promptVersion":{"dataType":"string","required":true},"model":{"dataType":"string","required":true},"experimentId":{"dataType":"string","required":true}}}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"updateInputs":{"dataType":"boolean"},"metadata":{"dataType":"string"},"value":{"dataType":"string"},"status":{"dataType":"string"},"cellId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6445,7 +6458,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createNewExperimentHypothesis', + methodName: 'updateExperimentCell', controller, response, next, @@ -6457,14 +6470,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/hypothesis/:hypothesisId/scores/query', + app.post('/v1/experiment/table/:experimentTableId/column', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentHypothesisScores)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentColumn)), - async function ExperimentController_getExperimentHypothesisScores(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentColumn(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - hypothesisId: {"in":"path","name":"hypothesisId","required":true,"dataType":"string"}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputKeys":{"dataType":"array","array":{"dataType":"string"}},"promptVersionId":{"dataType":"string"},"hypothesisId":{"dataType":"string"},"columnType":{"dataType":"string","required":true},"columnName":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6477,7 +6491,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getExperimentHypothesisScores', + methodName: 'createExperimentColumn', controller, response, next, @@ -6489,14 +6503,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.get('/v1/experiment/:experimentId/evaluators', + app.post('/v1/experiment/table/:experimentTableId/row/new', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentEvaluators)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRow)), - async function ExperimentController_getExperimentEvaluators(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"inputs":{"ref":"Record_string.string_"},"sourceRequest":{"dataType":"string"},"promptVersionId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6509,7 +6524,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getExperimentEvaluators', + methodName: 'createExperimentTableRow', controller, response, next, @@ -6521,14 +6536,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/:experimentId/evaluators/run', + app.delete('/v1/experiment/table/:experimentTableId/row/:rowIndex', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.runExperimentEvaluatorsOld)), + ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentTableRow)), - async function ExperimentController_runExperimentEvaluatorsOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_deleteExperimentTableRow(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + rowIndex: {"in":"path","name":"rowIndex","required":true,"dataType":"double"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6541,7 +6557,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'runExperimentEvaluatorsOld', + methodName: 'deleteExperimentTableRow', controller, response, next, @@ -6553,15 +6569,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/:experimentId/evaluators', + app.post('/v1/experiment/table/:experimentTableId/row/insert/batch', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.createExperimentEvaluatorOld)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentTableRowWithCellsBatch)), - async function ExperimentController_createExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentTableRowWithCellsBatch(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"evaluatorId":{"dataType":"string","required":true}}}, + experimentTableId: {"in":"path","name":"experimentTableId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"rows":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"cells":{"dataType":"array","array":{"dataType":"nestedObjectLiteral","nestedProperties":{"metadata":{"dataType":"any"},"value":{"dataType":"union","subSchemas":[{"dataType":"string"},{"dataType":"enum","enums":[null]}],"required":true},"columnId":{"dataType":"string","required":true}}},"required":true},"datasetId":{"dataType":"string","required":true},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}},"required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6574,7 +6590,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createExperimentEvaluatorOld', + methodName: 'createExperimentTableRowWithCellsBatch', controller, response, next, @@ -6586,15 +6602,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.delete('/v1/experiment/:experimentId/evaluators/:evaluatorId', + app.post('/v1/experiment/update-meta', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentEvaluatorOld)), + ...(fetchMiddlewares(ExperimentController.prototype.updateExperimentMeta)), - async function ExperimentController_deleteExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_updateExperimentMeta(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, - evaluatorId: {"in":"path","name":"evaluatorId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"meta":{"ref":"Record_string.string_","required":true},"experimentId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6607,7 +6622,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'deleteExperimentEvaluatorOld', + methodName: 'updateExperimentMeta', controller, response, next, @@ -6619,14 +6634,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/query', + app.post('/v1/experiment', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(ExperimentController)), - ...(fetchMiddlewares(ExperimentController.prototype.getExperimentsOld)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentOld)), - async function ExperimentController_getExperimentsOld(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewExperimentOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"include":{"ref":"IncludeExperimentKeys"},"filter":{"ref":"ExperimentFilterNode","required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewExperimentParams"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6639,7 +6654,7 @@ export function RegisterRoutes(app: Router) { const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getExperimentsOld', + methodName: 'createNewExperimentOld', controller, response, next, @@ -6651,14 +6666,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset', + app.post('/v1/experiment/hypothesis', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.addDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.createNewExperimentHypothesis)), - async function ExperimentDatasetController_addDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createNewExperimentHypothesis(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"NewDatasetParams"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"status":{"dataType":"union","subSchemas":[{"dataType":"enum","enums":["PENDING"]},{"dataType":"enum","enums":["RUNNING"]},{"dataType":"enum","enums":["COMPLETED"]},{"dataType":"enum","enums":["FAILED"]}],"required":true},"providerKeyId":{"dataType":"string","required":true},"promptVersion":{"dataType":"string","required":true},"model":{"dataType":"string","required":true},"experimentId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6668,10 +6683,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'addDataset', + methodName: 'createNewExperimentHypothesis', controller, response, next, @@ -6683,14 +6698,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/random', + app.post('/v1/experiment/hypothesis/:hypothesisId/scores/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.addRandomDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentHypothesisScores)), - async function ExperimentDatasetController_addRandomDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentHypothesisScores(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"ref":"RandomDatasetParams"}, + hypothesisId: {"in":"path","name":"hypothesisId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6700,10 +6715,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'addRandomDataset', + methodName: 'getExperimentHypothesisScores', controller, response, next, @@ -6715,14 +6730,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/query', + app.get('/v1/experiment/:experimentId/evaluators', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDatasets)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentEvaluators)), - async function ExperimentDatasetController_getDatasets(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentEvaluators(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"promptVersionId":{"dataType":"string"}}}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6732,10 +6747,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getDatasets', + methodName: 'getExperimentEvaluators', controller, response, next, @@ -6747,16 +6762,15 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/row/insert', + app.post('/v1/experiment/:experimentId/evaluators/run', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.insertDatasetRow)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.runExperimentEvaluatorsOld)), - async function ExperimentDatasetController_insertDatasetRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_runExperimentEvaluatorsOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"originalColumnId":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true},"inputRecordId":{"dataType":"string","required":true}}}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, - datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6765,10 +6779,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'insertDatasetRow', + methodName: 'runExperimentEvaluatorsOld', controller, response, next, @@ -6780,17 +6794,16 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/version/:promptVersionId/row/new', + app.post('/v1/experiment/:experimentId/evaluators', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.createDatasetRow)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.createExperimentEvaluatorOld)), - async function ExperimentDatasetController_createDatasetRow(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_createExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"sourceRequest":{"dataType":"string"},"inputs":{"ref":"Record_string.string_","required":true}}}, + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"evaluatorId":{"dataType":"string","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, - datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, - promptVersionId: {"in":"path","name":"promptVersionId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6799,10 +6812,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'createDatasetRow', + methodName: 'createExperimentEvaluatorOld', controller, response, next, @@ -6814,15 +6827,16 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/inputs/query', + app.delete('/v1/experiment/:experimentId/evaluators/:evaluatorId', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.getDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.deleteExperimentEvaluatorOld)), - async function ExperimentDatasetController_getDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_deleteExperimentEvaluatorOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { + experimentId: {"in":"path","name":"experimentId","required":true,"dataType":"string"}, + evaluatorId: {"in":"path","name":"evaluatorId","required":true,"dataType":"string"}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, - datasetId: {"in":"path","name":"datasetId","required":true,"dataType":"string"}, }; // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa @@ -6831,10 +6845,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'getDataset', + methodName: 'deleteExperimentEvaluatorOld', controller, response, next, @@ -6846,14 +6860,14 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa - app.post('/v1/experiment/dataset/:datasetId/mutate', + app.post('/v1/experiment/query', authenticateMiddleware([{"api_key":[]}]), - ...(fetchMiddlewares(ExperimentDatasetController)), - ...(fetchMiddlewares(ExperimentDatasetController.prototype.mutateDataset)), + ...(fetchMiddlewares(ExperimentController)), + ...(fetchMiddlewares(ExperimentController.prototype.getExperimentsOld)), - async function ExperimentDatasetController_mutateDataset(request: ExRequest, response: ExResponse, next: any) { + async function ExperimentController_getExperimentsOld(request: ExRequest, response: ExResponse, next: any) { const args: Record = { - requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"removeRequests":{"dataType":"array","array":{"dataType":"string"},"required":true},"addRequests":{"dataType":"array","array":{"dataType":"string"},"required":true}}}, + requestBody: {"in":"body","name":"requestBody","required":true,"dataType":"nestedObjectLiteral","nestedProperties":{"include":{"ref":"IncludeExperimentKeys"},"filter":{"ref":"ExperimentFilterNode","required":true}}}, request: {"in":"request","name":"request","required":true,"dataType":"object"}, }; @@ -6863,10 +6877,10 @@ export function RegisterRoutes(app: Router) { try { validatedArgs = templateService.getValidatedArgs({ args, request, response }); - const controller = new ExperimentDatasetController(); + const controller = new ExperimentController(); await templateService.apiHandler({ - methodName: 'mutateDataset', + methodName: 'getExperimentsOld', controller, response, next, @@ -8445,6 +8459,131 @@ export function RegisterRoutes(app: Router) { } }); // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/org-name/query', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getOrgName)), + + async function PiController_getOrgName(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getOrgName', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/total-costs', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getTotalCosts)), + + async function PiController_getTotalCosts(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getTotalCosts', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/total_requests', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getTotalRequests)), + + async function PiController_getTotalRequests(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getTotalRequests', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + app.post('/v1/pi/costs-over-time/query', + authenticateMiddleware([{"api_key":[]}]), + ...(fetchMiddlewares(PiController)), + ...(fetchMiddlewares(PiController.prototype.getCostsOverTime)), + + async function PiController_getCostsOverTime(request: ExRequest, response: ExResponse, next: any) { + const args: Record = { + requestBody: {"in":"body","name":"requestBody","required":true,"ref":"DataOverTimeRequest"}, + request: {"in":"request","name":"request","required":true,"dataType":"object"}, + }; + + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa + + let validatedArgs: any[] = []; + try { + validatedArgs = templateService.getValidatedArgs({ args, request, response }); + + const controller = new PiController(); + + await templateService.apiHandler({ + methodName: 'getCostsOverTime', + controller, + response, + next, + validatedArgs, + successStatus: undefined, + }); + } catch (err) { + return next(err); + } + }); + // WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa app.get('/v1/settings/query', authenticateMiddleware([{"api_key":[]}]), ...(fetchMiddlewares(SettingController)), diff --git a/valhalla/jawn/src/tsoa-build/public/swagger.json b/valhalla/jawn/src/tsoa-build/public/swagger.json index bab2b06d5..bde361282 100644 --- a/valhalla/jawn/src/tsoa-build/public/swagger.json +++ b/valhalla/jawn/src/tsoa-build/public/swagger.json @@ -4567,20 +4567,16 @@ } ] }, - "ResultSuccess__tableId-string--experimentId-string__": { + "ResultSuccess__datasetId-string__": { "properties": { "data": { "properties": { - "experimentId": { - "type": "string" - }, - "tableId": { + "datasetId": { "type": "string" } }, "required": [ - "experimentId", - "tableId" + "datasetId" ], "type": "object" }, @@ -4599,109 +4595,197 @@ "type": "object", "additionalProperties": false }, - "Result__tableId-string--experimentId-string_.string_": { + "Result__datasetId-string_.string_": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess__tableId-string--experimentId-string__" + "$ref": "#/components/schemas/ResultSuccess__datasetId-string__" }, { "$ref": "#/components/schemas/ResultError_string_" } ] }, - "CreateExperimentTableParams": { + "DatasetMetadata": { "properties": { - "datasetId": { - "type": "string" - }, - "experimentMetadata": { - "$ref": "#/components/schemas/Record_string.any_" - }, "promptVersionId": { "type": "string" }, - "newHeliconeTemplate": { + "inputRecordsIds": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object", + "additionalProperties": false + }, + "NewDatasetParams": { + "properties": { + "datasetName": { "type": "string" }, - "isMajorVersion": { - "type": "boolean" + "requestIds": { + "items": { + "type": "string" + }, + "type": "array" }, - "promptSubversionMetadata": { - "$ref": "#/components/schemas/Record_string.any_" + "datasetType": { + "type": "string", + "enum": [ + "experiment", + "helicone" + ] }, - "experimentTableMetadata": { - "$ref": "#/components/schemas/Record_string.any_" + "meta": { + "$ref": "#/components/schemas/DatasetMetadata" } }, "required": [ - "datasetId", - "experimentMetadata", - "promptVersionId", - "newHeliconeTemplate", - "isMajorVersion", - "promptSubversionMetadata" + "datasetName", + "requestIds", + "datasetType" ], "type": "object", "additionalProperties": false }, - "ExperimentTableColumn": { + "Partial_TimestampOperators_": { "properties": { - "id": { + "gte": { "type": "string" }, - "columnName": { + "lte": { "type": "string" }, - "columnType": { + "lt": { "type": "string" }, - "hypothesisId": { + "gt": { "type": "string" + } + }, + "type": "object", + "description": "Make all properties in T optional" + }, + "Partial_RequestTableToOperators_": { + "properties": { + "prompt": { + "$ref": "#/components/schemas/Partial_TextOperators_" }, - "cells": { - "items": { - "properties": { - "metadata": { - "$ref": "#/components/schemas/Record_string.any_" - }, - "value": { - "type": "string", - "nullable": true - }, - "requestId": { - "type": "string" - }, - "rowIndex": { - "type": "number", - "format": "double" - }, - "id": { - "type": "string" - } - }, - "required": [ - "value", - "rowIndex", - "id" - ], - "type": "object" - }, - "type": "array" + "created_at": { + "$ref": "#/components/schemas/Partial_TimestampOperators_" }, - "metadata": { - "$ref": "#/components/schemas/Record_string.any_" + "user_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "auth_hash": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "org_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "node_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "model": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "modelOverride": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "path": { + "$ref": "#/components/schemas/Partial_TextOperators_" + }, + "prompt_id": { + "$ref": "#/components/schemas/Partial_TextOperators_" + } + }, + "type": "object", + "description": "Make all properties in T optional" + }, + "Pick_FilterLeaf.request-or-prompts_versions_": { + "properties": { + "request": { + "$ref": "#/components/schemas/Partial_RequestTableToOperators_" + }, + "prompts_versions": { + "$ref": "#/components/schemas/Partial_PromptVersionsToOperators_" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "FilterLeafSubset_request-or-prompts_versions_": { + "$ref": "#/components/schemas/Pick_FilterLeaf.request-or-prompts_versions_" + }, + "DatasetFilterNode": { + "anyOf": [ + { + "$ref": "#/components/schemas/FilterLeafSubset_request-or-prompts_versions_" + }, + { + "$ref": "#/components/schemas/DatasetFilterBranch" + }, + { + "type": "string", + "enum": [ + "all" + ] + } + ] + }, + "DatasetFilterBranch": { + "properties": { + "right": { + "$ref": "#/components/schemas/DatasetFilterNode" + }, + "operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "left": { + "$ref": "#/components/schemas/DatasetFilterNode" } }, "required": [ - "id", - "columnName", - "columnType", - "cells" + "right", + "operator", + "left" + ], + "type": "object" + }, + "RandomDatasetParams": { + "properties": { + "datasetName": { + "type": "string" + }, + "filter": { + "$ref": "#/components/schemas/DatasetFilterNode" + }, + "offset": { + "type": "number", + "format": "double" + }, + "limit": { + "type": "number", + "format": "double" + } + }, + "required": [ + "datasetName", + "filter" ], "type": "object", "additionalProperties": false }, - "ExperimentTable": { + "DatasetResult": { "properties": { "id": { "type": "string" @@ -4709,32 +4793,28 @@ "name": { "type": "string" }, - "experimentId": { + "created_at": { "type": "string" }, - "columns": { - "items": { - "$ref": "#/components/schemas/ExperimentTableColumn" - }, - "type": "array" - }, - "metadata": { - "$ref": "#/components/schemas/Record_string.any_" + "meta": { + "$ref": "#/components/schemas/DatasetMetadata" } }, "required": [ "id", "name", - "experimentId", - "columns" + "created_at" ], "type": "object", "additionalProperties": false }, - "ResultSuccess_ExperimentTable_": { + "ResultSuccess_DatasetResult-Array_": { "properties": { "data": { - "$ref": "#/components/schemas/ExperimentTable" + "items": { + "$ref": "#/components/schemas/DatasetResult" + }, + "type": "array" }, "error": { "type": "number", @@ -4751,22 +4831,250 @@ "type": "object", "additionalProperties": false }, - "Result_ExperimentTable.string_": { + "Result_DatasetResult-Array.string_": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess_ExperimentTable_" + "$ref": "#/components/schemas/ResultSuccess_DatasetResult-Array_" }, { "$ref": "#/components/schemas/ResultError_string_" } ] }, - "ExperimentTableSimplified": { + "ResultSuccess___-Array_": { "properties": { - "id": { - "type": "string" - }, - "name": { + "data": { + "items": { + "properties": {}, + "type": "object" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result___-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess___-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "ResultSuccess__tableId-string--experimentId-string__": { + "properties": { + "data": { + "properties": { + "experimentId": { + "type": "string" + }, + "tableId": { + "type": "string" + } + }, + "required": [ + "experimentId", + "tableId" + ], + "type": "object" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result__tableId-string--experimentId-string_.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess__tableId-string--experimentId-string__" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "CreateExperimentTableParams": { + "properties": { + "datasetId": { + "type": "string" + }, + "experimentMetadata": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "promptVersionId": { + "type": "string" + }, + "newHeliconeTemplate": { + "type": "string" + }, + "isMajorVersion": { + "type": "boolean" + }, + "promptSubversionMetadata": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "experimentTableMetadata": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "datasetId", + "experimentMetadata", + "promptVersionId", + "newHeliconeTemplate", + "isMajorVersion", + "promptSubversionMetadata" + ], + "type": "object", + "additionalProperties": false + }, + "ExperimentTableColumn": { + "properties": { + "id": { + "type": "string" + }, + "columnName": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "hypothesisId": { + "type": "string" + }, + "cells": { + "items": { + "properties": { + "metadata": { + "$ref": "#/components/schemas/Record_string.any_" + }, + "value": { + "type": "string", + "nullable": true + }, + "requestId": { + "type": "string" + }, + "rowIndex": { + "type": "number", + "format": "double" + }, + "id": { + "type": "string" + } + }, + "required": [ + "value", + "rowIndex", + "id" + ], + "type": "object" + }, + "type": "array" + }, + "metadata": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "id", + "columnName", + "columnType", + "cells" + ], + "type": "object", + "additionalProperties": false + }, + "ExperimentTable": { + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "experimentId": { + "type": "string" + }, + "columns": { + "items": { + "$ref": "#/components/schemas/ExperimentTableColumn" + }, + "type": "array" + }, + "metadata": { + "$ref": "#/components/schemas/Record_string.any_" + } + }, + "required": [ + "id", + "name", + "experimentId", + "columns" + ], + "type": "object", + "additionalProperties": false + }, + "ResultSuccess_ExperimentTable_": { + "properties": { + "data": { + "$ref": "#/components/schemas/ExperimentTable" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result_ExperimentTable.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess_ExperimentTable_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, + "ExperimentTableSimplified": { + "properties": { + "id": { + "type": "string" + }, + "name": { "type": "string" }, "experimentId": { @@ -5335,404 +5643,33 @@ "allOf": [ { "$ref": "#/components/schemas/ExperimentScores" - } - ], - "nullable": true - }, - "tableId": { - "type": "string", - "nullable": true - } - }, - "required": [ - "id", - "organization", - "dataset", - "meta", - "createdAt", - "hypotheses", - "scores", - "tableId" - ], - "type": "object", - "additionalProperties": false - }, - "ResultSuccess_Experiment-Array_": { - "properties": { - "data": { - "items": { - "$ref": "#/components/schemas/Experiment" - }, - "type": "array" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result_Experiment-Array.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess_Experiment-Array_" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, - "Partial_ExperimentToOperators_": { - "properties": { - "id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "prompt_v2": { - "$ref": "#/components/schemas/Partial_TextOperators_" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Pick_FilterLeaf.experiment_": { - "properties": { - "experiment": { - "$ref": "#/components/schemas/Partial_ExperimentToOperators_" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "FilterLeafSubset_experiment_": { - "$ref": "#/components/schemas/Pick_FilterLeaf.experiment_" - }, - "ExperimentFilterNode": { - "anyOf": [ - { - "$ref": "#/components/schemas/FilterLeafSubset_experiment_" - }, - { - "$ref": "#/components/schemas/ExperimentFilterBranch" - }, - { - "type": "string", - "enum": [ - "all" - ] - } - ] - }, - "ExperimentFilterBranch": { - "properties": { - "right": { - "$ref": "#/components/schemas/ExperimentFilterNode" - }, - "operator": { - "type": "string", - "enum": [ - "or", - "and" - ] - }, - "left": { - "$ref": "#/components/schemas/ExperimentFilterNode" - } - }, - "required": [ - "right", - "operator", - "left" - ], - "type": "object" - }, - "IncludeExperimentKeys": { - "properties": { - "inputs": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - }, - "promptVersion": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - }, - "responseBodies": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - }, - "score": { - "type": "boolean", - "enum": [ - true - ], - "nullable": false - } - }, - "type": "object", - "additionalProperties": false - }, - "ResultSuccess__datasetId-string__": { - "properties": { - "data": { - "properties": { - "datasetId": { - "type": "string" - } - }, - "required": [ - "datasetId" - ], - "type": "object" - }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true - } - }, - "required": [ - "data", - "error" - ], - "type": "object", - "additionalProperties": false - }, - "Result__datasetId-string_.string_": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess__datasetId-string__" - }, - { - "$ref": "#/components/schemas/ResultError_string_" - } - ] - }, - "DatasetMetadata": { - "properties": { - "promptVersionId": { - "type": "string" - }, - "inputRecordsIds": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "type": "object", - "additionalProperties": false - }, - "NewDatasetParams": { - "properties": { - "datasetName": { - "type": "string" - }, - "requestIds": { - "items": { - "type": "string" - }, - "type": "array" - }, - "datasetType": { - "type": "string", - "enum": [ - "experiment", - "helicone" - ] - }, - "meta": { - "$ref": "#/components/schemas/DatasetMetadata" - } - }, - "required": [ - "datasetName", - "requestIds", - "datasetType" - ], - "type": "object", - "additionalProperties": false - }, - "Partial_TimestampOperators_": { - "properties": { - "gte": { - "type": "string" - }, - "lte": { - "type": "string" - }, - "lt": { - "type": "string" - }, - "gt": { - "type": "string" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Partial_RequestTableToOperators_": { - "properties": { - "prompt": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "created_at": { - "$ref": "#/components/schemas/Partial_TimestampOperators_" - }, - "user_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "auth_hash": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "org_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "node_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "model": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "modelOverride": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "path": { - "$ref": "#/components/schemas/Partial_TextOperators_" - }, - "prompt_id": { - "$ref": "#/components/schemas/Partial_TextOperators_" - } - }, - "type": "object", - "description": "Make all properties in T optional" - }, - "Pick_FilterLeaf.request-or-prompts_versions_": { - "properties": { - "request": { - "$ref": "#/components/schemas/Partial_RequestTableToOperators_" - }, - "prompts_versions": { - "$ref": "#/components/schemas/Partial_PromptVersionsToOperators_" - } - }, - "type": "object", - "description": "From T, pick a set of properties whose keys are in the union K" - }, - "FilterLeafSubset_request-or-prompts_versions_": { - "$ref": "#/components/schemas/Pick_FilterLeaf.request-or-prompts_versions_" - }, - "DatasetFilterNode": { - "anyOf": [ - { - "$ref": "#/components/schemas/FilterLeafSubset_request-or-prompts_versions_" - }, - { - "$ref": "#/components/schemas/DatasetFilterBranch" - }, - { - "type": "string", - "enum": [ - "all" - ] - } - ] - }, - "DatasetFilterBranch": { - "properties": { - "right": { - "$ref": "#/components/schemas/DatasetFilterNode" - }, - "operator": { - "type": "string", - "enum": [ - "or", - "and" - ] - }, - "left": { - "$ref": "#/components/schemas/DatasetFilterNode" - } - }, - "required": [ - "right", - "operator", - "left" - ], - "type": "object" - }, - "RandomDatasetParams": { - "properties": { - "datasetName": { - "type": "string" - }, - "filter": { - "$ref": "#/components/schemas/DatasetFilterNode" - }, - "offset": { - "type": "number", - "format": "double" - }, - "limit": { - "type": "number", - "format": "double" - } - }, - "required": [ - "datasetName", - "filter" - ], - "type": "object", - "additionalProperties": false - }, - "DatasetResult": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "created_at": { - "type": "string" + } + ], + "nullable": true }, - "meta": { - "$ref": "#/components/schemas/DatasetMetadata" + "tableId": { + "type": "string", + "nullable": true } }, "required": [ "id", - "name", - "created_at" + "organization", + "dataset", + "meta", + "createdAt", + "hypotheses", + "scores", + "tableId" ], "type": "object", "additionalProperties": false }, - "ResultSuccess_DatasetResult-Array_": { + "ResultSuccess_Experiment-Array_": { "properties": { "data": { "items": { - "$ref": "#/components/schemas/DatasetResult" + "$ref": "#/components/schemas/Experiment" }, "type": "array" }, @@ -5751,50 +5688,113 @@ "type": "object", "additionalProperties": false }, - "Result_DatasetResult-Array.string_": { + "Result_Experiment-Array.string_": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess_DatasetResult-Array_" + "$ref": "#/components/schemas/ResultSuccess_Experiment-Array_" }, { "$ref": "#/components/schemas/ResultError_string_" } ] }, - "ResultSuccess___-Array_": { + "Partial_ExperimentToOperators_": { "properties": { - "data": { - "items": { - "properties": {}, - "type": "object" - }, - "type": "array" + "id": { + "$ref": "#/components/schemas/Partial_TextOperators_" }, - "error": { - "type": "number", - "enum": [ - null - ], - "nullable": true + "prompt_v2": { + "$ref": "#/components/schemas/Partial_TextOperators_" } }, - "required": [ - "data", - "error" - ], "type": "object", - "additionalProperties": false + "description": "Make all properties in T optional" }, - "Result___-Array.string_": { + "Pick_FilterLeaf.experiment_": { + "properties": { + "experiment": { + "$ref": "#/components/schemas/Partial_ExperimentToOperators_" + } + }, + "type": "object", + "description": "From T, pick a set of properties whose keys are in the union K" + }, + "FilterLeafSubset_experiment_": { + "$ref": "#/components/schemas/Pick_FilterLeaf.experiment_" + }, + "ExperimentFilterNode": { "anyOf": [ { - "$ref": "#/components/schemas/ResultSuccess___-Array_" + "$ref": "#/components/schemas/FilterLeafSubset_experiment_" }, { - "$ref": "#/components/schemas/ResultError_string_" + "$ref": "#/components/schemas/ExperimentFilterBranch" + }, + { + "type": "string", + "enum": [ + "all" + ] } ] }, + "ExperimentFilterBranch": { + "properties": { + "right": { + "$ref": "#/components/schemas/ExperimentFilterNode" + }, + "operator": { + "type": "string", + "enum": [ + "or", + "and" + ] + }, + "left": { + "$ref": "#/components/schemas/ExperimentFilterNode" + } + }, + "required": [ + "right", + "operator", + "left" + ], + "type": "object" + }, + "IncludeExperimentKeys": { + "properties": { + "inputs": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + }, + "promptVersion": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + }, + "responseBodies": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + }, + "score": { + "type": "boolean", + "enum": [ + true + ], + "nullable": false + } + }, + "type": "object", + "additionalProperties": false + }, "HeliconeDatasetMetadata": { "properties": { "promptVersionId": { @@ -7713,6 +7713,52 @@ } ] }, + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + "properties": { + "data": { + "items": { + "properties": { + "created_at_trunc": { + "type": "string" + }, + "cost": { + "type": "number", + "format": "double" + } + }, + "required": [ + "created_at_trunc", + "cost" + ], + "type": "object" + }, + "type": "array" + }, + "error": { + "type": "number", + "enum": [ + null + ], + "nullable": true + } + }, + "required": [ + "data", + "error" + ], + "type": "object", + "additionalProperties": false + }, + "Result__cost-number--created_at_trunc-string_-Array.string_": { + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess__cost-number--created_at_trunc-string_-Array_" + }, + { + "$ref": "#/components/schemas/ResultError_string_" + } + ] + }, "LlmType": { "type": "string", "enum": [ @@ -13390,206 +13436,139 @@ "api_key": [] } ], - "parameters": [] - } - }, - "/v1/experiment/new-empty": { - "post": { - "operationId": "CreateNewEmptyExperiment", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result__experimentId-string_.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "datasetId": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/Record_string.string_" - } - }, - "required": [ - "datasetId", - "metadata" - ], - "type": "object" - } - } - } - } - } - }, - "/v1/experiment/table/new": { - "post": { - "operationId": "CreateNewExperimentTable", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result__tableId-string--experimentId-string_.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateExperimentTableParams" - } - } - } - } + "parameters": [] } }, - "/v1/experiment/table/{experimentTableId}/query": { + "/v1/experiment/dataset": { "post": { - "operationId": "GetExperimentTableById", + "operationId": "AddDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTable.string_" + "$ref": "#/components/schemas/Result__datasetId-string_.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NewDatasetParams" + } } } - ] + } } }, - "/v1/experiment/table/{experimentTableId}/metadata/query": { + "/v1/experiment/dataset/random": { "post": { - "operationId": "GetExperimentTableMetadata", + "operationId": "AddRandomDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTableSimplified.string_" + "$ref": "#/components/schemas/Result__datasetId-string_.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RandomDatasetParams" + } } } - ] + } } }, - "/v1/experiment/tables/query": { + "/v1/experiment/dataset/query": { "post": { - "operationId": "GetExperimentTables", + "operationId": "GetDatasets", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_ExperimentTableSimplified-Array.string_" + "$ref": "#/components/schemas/Result_DatasetResult-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { "api_key": [] } ], - "parameters": [] + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "promptVersionId": { + "type": "string" + } + }, + "type": "object" + } + } + } + } } }, - "/v1/experiment/table/{experimentTableId}/cell": { + "/v1/experiment/dataset/{datasetId}/row/insert": { "post": { - "operationId": "CreateExperimentCell", + "operationId": "InsertDatasetRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_string.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -13599,7 +13578,7 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "datasetId", "required": true, "schema": { "type": "string" @@ -13612,45 +13591,44 @@ "application/json": { "schema": { "properties": { - "value": { - "type": "string", - "nullable": true + "originalColumnId": { + "type": "string" }, - "rowIndex": { - "type": "number", - "format": "double" + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" }, - "columnId": { + "inputRecordId": { "type": "string" } }, "required": [ - "value", - "rowIndex", - "columnId" + "inputs", + "inputRecordId" ], "type": "object" } } } } - }, - "patch": { - "operationId": "UpdateExperimentCell", + } + }, + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + "post": { + "operationId": "CreateDatasetRow", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_string.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -13660,7 +13638,15 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "datasetId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "promptVersionId", "required": true, "schema": { "type": "string" @@ -13673,24 +13659,15 @@ "application/json": { "schema": { "properties": { - "updateInputs": { - "type": "boolean" - }, - "metadata": { - "type": "string" - }, - "value": { - "type": "string" - }, - "status": { + "sourceRequest": { "type": "string" }, - "cellId": { - "type": "string" + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" } }, "required": [ - "cellId" + "inputs" ], "type": "object" } @@ -13699,23 +13676,23 @@ } } }, - "/v1/experiment/table/{experimentTableId}/column": { + "/v1/experiment/dataset/{datasetId}/inputs/query": { "post": { - "operationId": "CreateExperimentColumn", + "operationId": "GetDataset", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_PromptInputRecord-Array.string_" } } } } }, "tags": [ - "Experiment" + "Dataset" ], "security": [ { @@ -13725,41 +13702,61 @@ "parameters": [ { "in": "path", - "name": "experimentTableId", + "name": "datasetId", "required": true, "schema": { "type": "string" } } + ] + } + }, + "/v1/experiment/dataset/{datasetId}/mutate": { + "post": { + "operationId": "MutateDataset", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result___-Array.string_" + } + } + } + } + }, + "tags": [ + "Dataset" + ], + "security": [ + { + "api_key": [] + } ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "inputKeys": { + "removeRequests": { "items": { "type": "string" }, "type": "array" }, - "promptVersionId": { - "type": "string" - }, - "hypothesisId": { - "type": "string" - }, - "columnType": { - "type": "string" - }, - "columnName": { - "type": "string" + "addRequests": { + "items": { + "type": "string" + }, + "type": "array" } }, "required": [ - "columnType", - "columnName" + "removeRequests", + "addRequests" ], "type": "object" } @@ -13768,16 +13765,16 @@ } } }, - "/v1/experiment/table/{experimentTableId}/row/new": { + "/v1/experiment/new-empty": { "post": { - "operationId": "CreateExperimentTableRow", + "operationId": "CreateNewEmptyExperiment", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result__experimentId-string_.string_" } } } @@ -13791,34 +13788,23 @@ "api_key": [] } ], - "parameters": [ - { - "in": "path", - "name": "experimentTableId", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "sourceRequest": { + "datasetId": { "type": "string" }, - "promptVersionId": { - "type": "string" + "metadata": { + "$ref": "#/components/schemas/Record_string.string_" } }, "required": [ - "promptVersionId" + "datasetId", + "metadata" ], "type": "object" } @@ -13827,16 +13813,52 @@ } } }, - "/v1/experiment/table/{experimentTableId}/row/{rowIndex}": { - "delete": { - "operationId": "DeleteExperimentTableRow", + "/v1/experiment/table/new": { + "post": { + "operationId": "CreateNewExperimentTable", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__tableId-string--experimentId-string_.string_" + } + } + } + } + }, + "tags": [ + "Experiment" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateExperimentTableParams" + } + } + } + } + } + }, + "/v1/experiment/table/{experimentTableId}/query": { + "post": { + "operationId": "GetExperimentTableById", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_ExperimentTable.string_" } } } @@ -13858,29 +13880,20 @@ "schema": { "type": "string" } - }, - { - "in": "path", - "name": "rowIndex", - "required": true, - "schema": { - "format": "double", - "type": "number" - } } ] } }, - "/v1/experiment/table/{experimentTableId}/row/insert/batch": { + "/v1/experiment/table/{experimentTableId}/metadata/query": { "post": { - "operationId": "CreateExperimentTableRowWithCellsBatch", + "operationId": "GetExperimentTableMetadata", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_null.string_" + "$ref": "#/components/schemas/Result_ExperimentTableSimplified.string_" } } } @@ -13903,87 +13916,19 @@ "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "rows": { - "items": { - "properties": { - "sourceRequest": { - "type": "string" - }, - "cells": { - "items": { - "properties": { - "metadata": {}, - "value": { - "type": "string", - "nullable": true - }, - "columnId": { - "type": "string" - } - }, - "required": [ - "value", - "columnId" - ], - "type": "object" - }, - "type": "array" - }, - "datasetId": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "inputRecordId": { - "type": "string" - } - }, - "required": [ - "cells", - "datasetId", - "inputs", - "inputRecordId" - ], - "type": "object" - }, - "type": "array" - } - }, - "required": [ - "rows" - ], - "type": "object" - } - } - } - } + ] } }, - "/v1/experiment/update-meta": { + "/v1/experiment/tables/query": { "post": { - "operationId": "UpdateExperimentMeta", + "operationId": "GetExperimentTables", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/ResultSuccess_unknown_" - }, - { - "$ref": "#/components/schemas/ResultError_PostgrestError_" - } - ] + "$ref": "#/components/schemas/Result_ExperimentTableSimplified-Array.string_" } } } @@ -13997,41 +13942,19 @@ "api_key": [] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "meta": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "experimentId": { - "type": "string" - } - }, - "required": [ - "meta", - "experimentId" - ], - "type": "object" - } - } - } - } + "parameters": [] } }, - "/v1/experiment": { + "/v1/experiment/table/{experimentTableId}/cell": { "post": { - "operationId": "CreateNewExperimentOld", + "operationId": "CreateExperimentCell", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__experimentId-string_.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14045,29 +13968,54 @@ "api_key": [] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewExperimentParams" + "properties": { + "value": { + "type": "string", + "nullable": true + }, + "rowIndex": { + "type": "number", + "format": "double" + }, + "columnId": { + "type": "string" + } + }, + "required": [ + "value", + "rowIndex", + "columnId" + ], + "type": "object" } } } } - } - }, - "/v1/experiment/hypothesis": { - "post": { - "operationId": "CreateNewExperimentHypothesis", + }, + "patch": { + "operationId": "UpdateExperimentCell", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__hypothesisId-string_.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14081,41 +14029,40 @@ "api_key": [] } ], - "parameters": [], + "parameters": [ + { + "in": "path", + "name": "experimentTableId", + "required": true, + "schema": { + "type": "string" + } + } + ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "status": { - "type": "string", - "enum": [ - "PENDING", - "RUNNING", - "COMPLETED", - "FAILED" - ] + "updateInputs": { + "type": "boolean" }, - "providerKeyId": { + "metadata": { "type": "string" }, - "promptVersion": { + "value": { "type": "string" }, - "model": { + "status": { "type": "string" }, - "experimentId": { + "cellId": { "type": "string" } }, "required": [ - "status", - "providerKeyId", - "promptVersion", - "model", - "experimentId" + "cellId" ], "type": "object" } @@ -14124,16 +14071,16 @@ } } }, - "/v1/experiment/hypothesis/{hypothesisId}/scores/query": { + "/v1/experiment/table/{experimentTableId}/column": { "post": { - "operationId": "GetExperimentHypothesisScores", + "operationId": "CreateExperimentColumn", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__runsCount-number--scores-Record_string.Score__.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } @@ -14150,51 +14097,52 @@ "parameters": [ { "in": "path", - "name": "hypothesisId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } } - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "inputKeys": { + "items": { + "type": "string" + }, + "type": "array" + }, + "promptVersionId": { + "type": "string" + }, + "hypothesisId": { + "type": "string" + }, + "columnType": { + "type": "string" + }, + "columnName": { + "type": "string" + } + }, + "required": [ + "columnType", + "columnName" + ], + "type": "object" + } + } + } + } } }, - "/v1/experiment/{experimentId}/evaluators": { - "get": { - "operationId": "GetExperimentEvaluators", - "responses": { - "200": { - "description": "Ok", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Result_EvaluatorResult-Array.string_" - } - } - } - } - }, - "tags": [ - "Experiment" - ], - "security": [ - { - "api_key": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "experimentId", - "required": true, - "schema": { - "type": "string" - } - } - ] - }, + "/v1/experiment/table/{experimentTableId}/row/new": { "post": { - "operationId": "CreateExperimentEvaluatorOld", + "operationId": "CreateExperimentTableRow", "responses": { "200": { "description": "Ok", @@ -14218,7 +14166,7 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" @@ -14231,12 +14179,18 @@ "application/json": { "schema": { "properties": { - "evaluatorId": { + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "sourceRequest": { + "type": "string" + }, + "promptVersionId": { "type": "string" } }, "required": [ - "evaluatorId" + "promptVersionId" ], "type": "object" } @@ -14245,9 +14199,9 @@ } } }, - "/v1/experiment/{experimentId}/evaluators/run": { - "post": { - "operationId": "RunExperimentEvaluatorsOld", + "/v1/experiment/table/{experimentTableId}/row/{rowIndex}": { + "delete": { + "operationId": "DeleteExperimentTableRow", "responses": { "200": { "description": "Ok", @@ -14271,18 +14225,27 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } + }, + { + "in": "path", + "name": "rowIndex", + "required": true, + "schema": { + "format": "double", + "type": "number" + } } ] } }, - "/v1/experiment/{experimentId}/evaluators/{evaluatorId}": { - "delete": { - "operationId": "DeleteExperimentEvaluatorOld", + "/v1/experiment/table/{experimentTableId}/row/insert/batch": { + "post": { + "operationId": "CreateExperimentTableRowWithCellsBatch", "responses": { "200": { "description": "Ok", @@ -14306,33 +14269,93 @@ "parameters": [ { "in": "path", - "name": "experimentId", + "name": "experimentTableId", "required": true, "schema": { "type": "string" } - }, - { - "in": "path", - "name": "evaluatorId", - "required": true, - "schema": { - "type": "string" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "rows": { + "items": { + "properties": { + "sourceRequest": { + "type": "string" + }, + "cells": { + "items": { + "properties": { + "metadata": {}, + "value": { + "type": "string", + "nullable": true + }, + "columnId": { + "type": "string" + } + }, + "required": [ + "value", + "columnId" + ], + "type": "object" + }, + "type": "array" + }, + "datasetId": { + "type": "string" + }, + "inputs": { + "$ref": "#/components/schemas/Record_string.string_" + }, + "inputRecordId": { + "type": "string" + } + }, + "required": [ + "cells", + "datasetId", + "inputs", + "inputRecordId" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "rows" + ], + "type": "object" + } } } - ] + } } }, - "/v1/experiment/query": { + "/v1/experiment/update-meta": { "post": { - "operationId": "GetExperimentsOld", + "operationId": "UpdateExperimentMeta", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_Experiment-Array.string_" + "anyOf": [ + { + "$ref": "#/components/schemas/ResultSuccess_unknown_" + }, + { + "$ref": "#/components/schemas/ResultError_PostgrestError_" + } + ] } } } @@ -14353,15 +14376,16 @@ "application/json": { "schema": { "properties": { - "include": { - "$ref": "#/components/schemas/IncludeExperimentKeys" + "meta": { + "$ref": "#/components/schemas/Record_string.string_" }, - "filter": { - "$ref": "#/components/schemas/ExperimentFilterNode" + "experimentId": { + "type": "string" } }, "required": [ - "filter" + "meta", + "experimentId" ], "type": "object" } @@ -14370,23 +14394,23 @@ } } }, - "/v1/experiment/dataset": { + "/v1/experiment": { "post": { - "operationId": "AddDataset", + "operationId": "CreateNewExperimentOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__datasetId-string_.string_" + "$ref": "#/components/schemas/Result__experimentId-string_.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14399,30 +14423,30 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewDatasetParams" + "$ref": "#/components/schemas/NewExperimentParams" } } } } } }, - "/v1/experiment/dataset/random": { + "/v1/experiment/hypothesis": { "post": { - "operationId": "AddRandomDataset", + "operationId": "CreateNewExperimentHypothesis", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result__datasetId-string_.string_" + "$ref": "#/components/schemas/Result__hypothesisId-string_.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14435,71 +14459,128 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/RandomDatasetParams" + "properties": { + "status": { + "type": "string", + "enum": [ + "PENDING", + "RUNNING", + "COMPLETED", + "FAILED" + ] + }, + "providerKeyId": { + "type": "string" + }, + "promptVersion": { + "type": "string" + }, + "model": { + "type": "string" + }, + "experimentId": { + "type": "string" + } + }, + "required": [ + "status", + "providerKeyId", + "promptVersion", + "model", + "experimentId" + ], + "type": "object" } } } } } }, - "/v1/experiment/dataset/query": { + "/v1/experiment/hypothesis/{hypothesisId}/scores/query": { "post": { - "operationId": "GetDatasets", + "operationId": "GetExperimentHypothesisScores", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__runsCount-number--scores-Record_string.Score__.string_" + } + } + } + } + }, + "tags": [ + "Experiment" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "hypothesisId", + "required": true, + "schema": { + "type": "string" + } + } + ] + } + }, + "/v1/experiment/{experimentId}/evaluators": { + "get": { + "operationId": "GetExperimentEvaluators", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_DatasetResult-Array.string_" + "$ref": "#/components/schemas/Result_EvaluatorResult-Array.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { "api_key": [] } ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "promptVersionId": { - "type": "string" - } - }, - "type": "object" - } + "parameters": [ + { + "in": "path", + "name": "experimentId", + "required": true, + "schema": { + "type": "string" } } - } - } - }, - "/v1/experiment/dataset/{datasetId}/row/insert": { + ] + }, "post": { - "operationId": "InsertDatasetRow", + "operationId": "CreateExperimentEvaluatorOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_string.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14509,7 +14590,7 @@ "parameters": [ { "in": "path", - "name": "datasetId", + "name": "experimentId", "required": true, "schema": { "type": "string" @@ -14522,19 +14603,12 @@ "application/json": { "schema": { "properties": { - "originalColumnId": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - }, - "inputRecordId": { + "evaluatorId": { "type": "string" } }, "required": [ - "inputs", - "inputRecordId" + "evaluatorId" ], "type": "object" } @@ -14543,23 +14617,23 @@ } } }, - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + "/v1/experiment/{experimentId}/evaluators/run": { "post": { - "operationId": "CreateDatasetRow", + "operationId": "RunExperimentEvaluatorsOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_string.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14569,61 +14643,32 @@ "parameters": [ { "in": "path", - "name": "datasetId", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "promptVersionId", + "name": "experimentId", "required": true, "schema": { "type": "string" } } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "sourceRequest": { - "type": "string" - }, - "inputs": { - "$ref": "#/components/schemas/Record_string.string_" - } - }, - "required": [ - "inputs" - ], - "type": "object" - } - } - } - } + ] } }, - "/v1/experiment/dataset/{datasetId}/inputs/query": { - "post": { - "operationId": "GetDataset", + "/v1/experiment/{experimentId}/evaluators/{evaluatorId}": { + "delete": { + "operationId": "DeleteExperimentEvaluatorOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result_PromptInputRecord-Array.string_" + "$ref": "#/components/schemas/Result_null.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14633,7 +14678,15 @@ "parameters": [ { "in": "path", - "name": "datasetId", + "name": "experimentId", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "evaluatorId", "required": true, "schema": { "type": "string" @@ -14642,23 +14695,23 @@ ] } }, - "/v1/experiment/dataset/{datasetId}/mutate": { + "/v1/experiment/query": { "post": { - "operationId": "MutateDataset", + "operationId": "GetExperimentsOld", "responses": { "200": { "description": "Ok", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Result___-Array.string_" + "$ref": "#/components/schemas/Result_Experiment-Array.string_" } } } } }, "tags": [ - "Dataset" + "Experiment" ], "security": [ { @@ -14672,22 +14725,15 @@ "application/json": { "schema": { "properties": { - "removeRequests": { - "items": { - "type": "string" - }, - "type": "array" + "include": { + "$ref": "#/components/schemas/IncludeExperimentKeys" }, - "addRequests": { - "items": { - "type": "string" - }, - "type": "array" + "filter": { + "$ref": "#/components/schemas/ExperimentFilterNode" } }, "required": [ - "removeRequests", - "addRequests" + "filter" ], "type": "object" } @@ -16753,6 +16799,133 @@ } } }, + "/v1/pi/org-name/query": { + "post": { + "operationId": "GetOrgName", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_string.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/total-costs": { + "post": { + "operationId": "GetTotalCosts", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_number.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/total_requests": { + "post": { + "operationId": "GetTotalRequests", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result_number.string_" + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [] + } + }, + "/v1/pi/costs-over-time/query": { + "post": { + "operationId": "GetCostsOverTime", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Result__cost-number--created_at_trunc-string_-Array.string_" + }, + "examples": { + "Example 1": { + "value": { + "userFilter": "all", + "timeFilter": { + "start": "2024-01-01", + "end": "2024-01-31" + }, + "dbIncrement": "day", + "timeZoneDifference": 0 + } + } + } + } + } + } + }, + "tags": [ + "PI" + ], + "security": [ + { + "api_key": [] + } + ], + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataOverTimeRequest" + } + } + } + } + } + }, "/v1/settings/query": { "get": { "operationId": "GetSettings", diff --git a/web/lib/clients/jawnTypes/private.ts b/web/lib/clients/jawnTypes/private.ts index 9edb00ad0..1ae4e696a 100644 --- a/web/lib/clients/jawnTypes/private.ts +++ b/web/lib/clients/jawnTypes/private.ts @@ -301,27 +301,6 @@ export interface paths { "/v1/integration/slack/channels": { get: operations["GetSlackChannels"]; }; - "/v1/experiment/dataset": { - post: operations["AddDataset"]; - }; - "/v1/experiment/dataset/random": { - post: operations["AddRandomDataset"]; - }; - "/v1/experiment/dataset/query": { - post: operations["GetDatasets"]; - }; - "/v1/experiment/dataset/{datasetId}/row/insert": { - post: operations["InsertDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { - post: operations["CreateDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/inputs/query": { - post: operations["GetDataset"]; - }; - "/v1/experiment/dataset/{datasetId}/mutate": { - post: operations["MutateDataset"]; - }; "/v1/experiment/new-empty": { post: operations["CreateNewEmptyExperiment"]; }; @@ -378,6 +357,27 @@ export interface paths { "/v1/experiment/query": { post: operations["GetExperimentsOld"]; }; + "/v1/experiment/dataset": { + post: operations["AddDataset"]; + }; + "/v1/experiment/dataset/random": { + post: operations["AddRandomDataset"]; + }; + "/v1/experiment/dataset/query": { + post: operations["GetDatasets"]; + }; + "/v1/experiment/dataset/{datasetId}/row/insert": { + post: operations["InsertDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + post: operations["CreateDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/inputs/query": { + post: operations["GetDataset"]; + }; + "/v1/experiment/dataset/{datasetId}/mutate": { + post: operations["MutateDataset"]; + }; "/v1/helicone-dataset": { post: operations["AddHeliconeDataset"]; }; @@ -523,6 +523,18 @@ export interface paths { "/v1/pi/session": { post: operations["AddSession"]; }; + "/v1/pi/org-name/query": { + post: operations["GetOrgName"]; + }; + "/v1/pi/total-costs": { + post: operations["GetTotalCosts"]; + }; + "/v1/pi/total_requests": { + post: operations["GetTotalRequests"]; + }; + "/v1/pi/costs-over-time/query": { + post: operations["GetCostsOverTime"]; + }; "/v1/settings/query": { get: operations["GetSettings"]; }; @@ -2372,64 +2384,6 @@ Json: JsonObject; error: null; }; "Result_Array__id-string--name-string__.string_": components["schemas"]["ResultSuccess_Array__id-string--name-string___"] | components["schemas"]["ResultError_string_"]; - "ResultSuccess__datasetId-string__": { - data: { - datasetId: string; - }; - /** @enum {number|null} */ - error: null; - }; - "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; - DatasetMetadata: { - promptVersionId?: string; - inputRecordsIds?: string[]; - }; - NewDatasetParams: { - datasetName: string; - requestIds: string[]; - /** @enum {string} */ - datasetType: "experiment" | "helicone"; - meta?: components["schemas"]["DatasetMetadata"]; - }; - /** @description From T, pick a set of properties whose keys are in the union K */ - "Pick_FilterLeaf.request-or-prompts_versions_": { - request?: components["schemas"]["Partial_RequestTableToOperators_"]; - prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; - }; - "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; - DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; - DatasetFilterBranch: { - right: components["schemas"]["DatasetFilterNode"]; - /** @enum {string} */ - operator: "or" | "and"; - left: components["schemas"]["DatasetFilterNode"]; - }; - RandomDatasetParams: { - datasetName: string; - filter: components["schemas"]["DatasetFilterNode"]; - /** Format: double */ - offset?: number; - /** Format: double */ - limit?: number; - }; - DatasetResult: { - id: string; - name: string; - created_at: string; - meta?: components["schemas"]["DatasetMetadata"]; - }; - "ResultSuccess_DatasetResult-Array_": { - data: components["schemas"]["DatasetResult"][]; - /** @enum {number|null} */ - error: null; - }; - "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; - "ResultSuccess___-Array_": { - data: Record[]; - /** @enum {number|null} */ - error: null; - }; - "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; "ResultSuccess__tableId-string--experimentId-string__": { data: { experimentId: string; @@ -2659,6 +2613,64 @@ Json: JsonObject; /** @enum {boolean} */ score?: true; }; + "ResultSuccess__datasetId-string__": { + data: { + datasetId: string; + }; + /** @enum {number|null} */ + error: null; + }; + "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; + DatasetMetadata: { + promptVersionId?: string; + inputRecordsIds?: string[]; + }; + NewDatasetParams: { + datasetName: string; + requestIds: string[]; + /** @enum {string} */ + datasetType: "experiment" | "helicone"; + meta?: components["schemas"]["DatasetMetadata"]; + }; + /** @description From T, pick a set of properties whose keys are in the union K */ + "Pick_FilterLeaf.request-or-prompts_versions_": { + request?: components["schemas"]["Partial_RequestTableToOperators_"]; + prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; + }; + "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; + DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; + DatasetFilterBranch: { + right: components["schemas"]["DatasetFilterNode"]; + /** @enum {string} */ + operator: "or" | "and"; + left: components["schemas"]["DatasetFilterNode"]; + }; + RandomDatasetParams: { + datasetName: string; + filter: components["schemas"]["DatasetFilterNode"]; + /** Format: double */ + offset?: number; + /** Format: double */ + limit?: number; + }; + DatasetResult: { + id: string; + name: string; + created_at: string; + meta?: components["schemas"]["DatasetMetadata"]; + }; + "ResultSuccess_DatasetResult-Array_": { + data: components["schemas"]["DatasetResult"][]; + /** @enum {number|null} */ + error: null; + }; + "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess___-Array_": { + data: Record[]; + /** @enum {number|null} */ + error: null; + }; + "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; HeliconeDatasetMetadata: { promptVersionId?: string; inputRecordsIds?: string[]; @@ -3138,6 +3150,16 @@ Json: JsonObject; error: null; }; "Result__apiKey-string_.string_": components["schemas"]["ResultSuccess__apiKey-string__"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + data: { + created_at_trunc: string; + /** Format: double */ + cost: number; + }[]; + /** @enum {number|null} */ + error: null; + }; + "Result__cost-number--created_at_trunc-string_-Array.string_": components["schemas"]["ResultSuccess__cost-number--created_at_trunc-string_-Array_"] | components["schemas"]["ResultError_string_"]; }; responses: { }; @@ -5023,134 +5045,6 @@ export interface operations { }; }; }; - AddDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["NewDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - AddRandomDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["RandomDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - GetDatasets: { - requestBody: { - content: { - "application/json": { - promptVersionId?: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; - }; - }; - }; - }; - InsertDatasetRow: { - parameters: { - path: { - datasetId: string; - }; - }; - requestBody: { - content: { - "application/json": { - originalColumnId?: string; - inputs: components["schemas"]["Record_string.string_"]; - inputRecordId: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - CreateDatasetRow: { - parameters: { - path: { - datasetId: string; - promptVersionId: string; - }; - }; - requestBody: { - content: { - "application/json": { - sourceRequest?: string; - inputs: components["schemas"]["Record_string.string_"]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - GetDataset: { - parameters: { - path: { - datasetId: string; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; - }; - }; - }; - }; - MutateDataset: { - requestBody: { - content: { - "application/json": { - removeRequests: string[]; - addRequests: string[]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result___-Array.string_"]; - }; - }; - }; - }; CreateNewEmptyExperiment: { requestBody: { content: { @@ -5514,6 +5408,134 @@ export interface operations { }; }; }; + AddDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["NewDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + AddRandomDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["RandomDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + GetDatasets: { + requestBody: { + content: { + "application/json": { + promptVersionId?: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; + }; + }; + }; + }; + InsertDatasetRow: { + parameters: { + path: { + datasetId: string; + }; + }; + requestBody: { + content: { + "application/json": { + originalColumnId?: string; + inputs: components["schemas"]["Record_string.string_"]; + inputRecordId: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + CreateDatasetRow: { + parameters: { + path: { + datasetId: string; + promptVersionId: string; + }; + }; + requestBody: { + content: { + "application/json": { + sourceRequest?: string; + inputs: components["schemas"]["Record_string.string_"]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetDataset: { + parameters: { + path: { + datasetId: string; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; + }; + }; + }; + }; + MutateDataset: { + requestBody: { + content: { + "application/json": { + removeRequests: string[]; + addRequests: string[]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result___-Array.string_"]; + }; + }; + }; + }; AddHeliconeDataset: { requestBody: { content: { @@ -5661,11 +5683,6 @@ export interface operations { }; }; GetTotalRequests: { - requestBody: { - content: { - "application/json": components["schemas"]["DataIsBeautifulRequestBody"]; - }; - }; responses: { /** @description Ok */ 200: { @@ -6304,6 +6321,41 @@ export interface operations { }; }; }; + GetOrgName: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetTotalCosts: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_number.string_"]; + }; + }; + }; + }; + GetCostsOverTime: { + requestBody: { + content: { + "application/json": components["schemas"]["DataOverTimeRequest"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__cost-number--created_at_trunc-string_-Array.string_"]; + }; + }; + }; + }; GetSettings: { responses: { /** @description Ok */ diff --git a/web/lib/clients/jawnTypes/public.ts b/web/lib/clients/jawnTypes/public.ts index 5b20d59ee..0f7b89456 100644 --- a/web/lib/clients/jawnTypes/public.ts +++ b/web/lib/clients/jawnTypes/public.ts @@ -256,6 +256,27 @@ export interface paths { "/v1/integration/slack/channels": { get: operations["GetSlackChannels"]; }; + "/v1/experiment/dataset": { + post: operations["AddDataset"]; + }; + "/v1/experiment/dataset/random": { + post: operations["AddRandomDataset"]; + }; + "/v1/experiment/dataset/query": { + post: operations["GetDatasets"]; + }; + "/v1/experiment/dataset/{datasetId}/row/insert": { + post: operations["InsertDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { + post: operations["CreateDatasetRow"]; + }; + "/v1/experiment/dataset/{datasetId}/inputs/query": { + post: operations["GetDataset"]; + }; + "/v1/experiment/dataset/{datasetId}/mutate": { + post: operations["MutateDataset"]; + }; "/v1/experiment/new-empty": { post: operations["CreateNewEmptyExperiment"]; }; @@ -312,27 +333,6 @@ export interface paths { "/v1/experiment/query": { post: operations["GetExperimentsOld"]; }; - "/v1/experiment/dataset": { - post: operations["AddDataset"]; - }; - "/v1/experiment/dataset/random": { - post: operations["AddRandomDataset"]; - }; - "/v1/experiment/dataset/query": { - post: operations["GetDatasets"]; - }; - "/v1/experiment/dataset/{datasetId}/row/insert": { - post: operations["InsertDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/version/{promptVersionId}/row/new": { - post: operations["CreateDatasetRow"]; - }; - "/v1/experiment/dataset/{datasetId}/inputs/query": { - post: operations["GetDataset"]; - }; - "/v1/experiment/dataset/{datasetId}/mutate": { - post: operations["MutateDataset"]; - }; "/v1/helicone-dataset": { post: operations["AddHeliconeDataset"]; }; @@ -478,6 +478,18 @@ export interface paths { "/v1/pi/session": { post: operations["AddSession"]; }; + "/v1/pi/org-name/query": { + post: operations["GetOrgName"]; + }; + "/v1/pi/total-costs": { + post: operations["GetTotalCosts"]; + }; + "/v1/pi/total_requests": { + post: operations["GetTotalRequests"]; + }; + "/v1/pi/costs-over-time/query": { + post: operations["GetCostsOverTime"]; + }; "/v1/settings/query": { get: operations["GetSettings"]; }; @@ -1943,6 +1955,85 @@ Json: JsonObject; error: null; }; "Result_Array__id-string--name-string__.string_": components["schemas"]["ResultSuccess_Array__id-string--name-string___"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess__datasetId-string__": { + data: { + datasetId: string; + }; + /** @enum {number|null} */ + error: null; + }; + "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; + DatasetMetadata: { + promptVersionId?: string; + inputRecordsIds?: string[]; + }; + NewDatasetParams: { + datasetName: string; + requestIds: string[]; + /** @enum {string} */ + datasetType: "experiment" | "helicone"; + meta?: components["schemas"]["DatasetMetadata"]; + }; + /** @description Make all properties in T optional */ + Partial_TimestampOperators_: { + gte?: string; + lte?: string; + lt?: string; + gt?: string; + }; + /** @description Make all properties in T optional */ + Partial_RequestTableToOperators_: { + prompt?: components["schemas"]["Partial_TextOperators_"]; + created_at?: components["schemas"]["Partial_TimestampOperators_"]; + user_id?: components["schemas"]["Partial_TextOperators_"]; + auth_hash?: components["schemas"]["Partial_TextOperators_"]; + org_id?: components["schemas"]["Partial_TextOperators_"]; + id?: components["schemas"]["Partial_TextOperators_"]; + node_id?: components["schemas"]["Partial_TextOperators_"]; + model?: components["schemas"]["Partial_TextOperators_"]; + modelOverride?: components["schemas"]["Partial_TextOperators_"]; + path?: components["schemas"]["Partial_TextOperators_"]; + prompt_id?: components["schemas"]["Partial_TextOperators_"]; + }; + /** @description From T, pick a set of properties whose keys are in the union K */ + "Pick_FilterLeaf.request-or-prompts_versions_": { + request?: components["schemas"]["Partial_RequestTableToOperators_"]; + prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; + }; + "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; + DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; + DatasetFilterBranch: { + right: components["schemas"]["DatasetFilterNode"]; + /** @enum {string} */ + operator: "or" | "and"; + left: components["schemas"]["DatasetFilterNode"]; + }; + RandomDatasetParams: { + datasetName: string; + filter: components["schemas"]["DatasetFilterNode"]; + /** Format: double */ + offset?: number; + /** Format: double */ + limit?: number; + }; + DatasetResult: { + id: string; + name: string; + created_at: string; + meta?: components["schemas"]["DatasetMetadata"]; + }; + "ResultSuccess_DatasetResult-Array_": { + data: components["schemas"]["DatasetResult"][]; + /** @enum {number|null} */ + error: null; + }; + "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess___-Array_": { + data: Record[]; + /** @enum {number|null} */ + error: null; + }; + "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; "ResultSuccess__tableId-string--experimentId-string__": { data: { experimentId: string; @@ -2172,85 +2263,6 @@ Json: JsonObject; /** @enum {boolean} */ score?: true; }; - "ResultSuccess__datasetId-string__": { - data: { - datasetId: string; - }; - /** @enum {number|null} */ - error: null; - }; - "Result__datasetId-string_.string_": components["schemas"]["ResultSuccess__datasetId-string__"] | components["schemas"]["ResultError_string_"]; - DatasetMetadata: { - promptVersionId?: string; - inputRecordsIds?: string[]; - }; - NewDatasetParams: { - datasetName: string; - requestIds: string[]; - /** @enum {string} */ - datasetType: "experiment" | "helicone"; - meta?: components["schemas"]["DatasetMetadata"]; - }; - /** @description Make all properties in T optional */ - Partial_TimestampOperators_: { - gte?: string; - lte?: string; - lt?: string; - gt?: string; - }; - /** @description Make all properties in T optional */ - Partial_RequestTableToOperators_: { - prompt?: components["schemas"]["Partial_TextOperators_"]; - created_at?: components["schemas"]["Partial_TimestampOperators_"]; - user_id?: components["schemas"]["Partial_TextOperators_"]; - auth_hash?: components["schemas"]["Partial_TextOperators_"]; - org_id?: components["schemas"]["Partial_TextOperators_"]; - id?: components["schemas"]["Partial_TextOperators_"]; - node_id?: components["schemas"]["Partial_TextOperators_"]; - model?: components["schemas"]["Partial_TextOperators_"]; - modelOverride?: components["schemas"]["Partial_TextOperators_"]; - path?: components["schemas"]["Partial_TextOperators_"]; - prompt_id?: components["schemas"]["Partial_TextOperators_"]; - }; - /** @description From T, pick a set of properties whose keys are in the union K */ - "Pick_FilterLeaf.request-or-prompts_versions_": { - request?: components["schemas"]["Partial_RequestTableToOperators_"]; - prompts_versions?: components["schemas"]["Partial_PromptVersionsToOperators_"]; - }; - "FilterLeafSubset_request-or-prompts_versions_": components["schemas"]["Pick_FilterLeaf.request-or-prompts_versions_"]; - DatasetFilterNode: components["schemas"]["FilterLeafSubset_request-or-prompts_versions_"] | components["schemas"]["DatasetFilterBranch"] | "all"; - DatasetFilterBranch: { - right: components["schemas"]["DatasetFilterNode"]; - /** @enum {string} */ - operator: "or" | "and"; - left: components["schemas"]["DatasetFilterNode"]; - }; - RandomDatasetParams: { - datasetName: string; - filter: components["schemas"]["DatasetFilterNode"]; - /** Format: double */ - offset?: number; - /** Format: double */ - limit?: number; - }; - DatasetResult: { - id: string; - name: string; - created_at: string; - meta?: components["schemas"]["DatasetMetadata"]; - }; - "ResultSuccess_DatasetResult-Array_": { - data: components["schemas"]["DatasetResult"][]; - /** @enum {number|null} */ - error: null; - }; - "Result_DatasetResult-Array.string_": components["schemas"]["ResultSuccess_DatasetResult-Array_"] | components["schemas"]["ResultError_string_"]; - "ResultSuccess___-Array_": { - data: Record[]; - /** @enum {number|null} */ - error: null; - }; - "Result___-Array.string_": components["schemas"]["ResultSuccess___-Array_"] | components["schemas"]["ResultError_string_"]; HeliconeDatasetMetadata: { promptVersionId?: string; inputRecordsIds?: string[]; @@ -2730,6 +2742,16 @@ Json: JsonObject; error: null; }; "Result__apiKey-string_.string_": components["schemas"]["ResultSuccess__apiKey-string__"] | components["schemas"]["ResultError_string_"]; + "ResultSuccess__cost-number--created_at_trunc-string_-Array_": { + data: { + created_at_trunc: string; + /** Format: double */ + cost: number; + }[]; + /** @enum {number|null} */ + error: null; + }; + "Result__cost-number--created_at_trunc-string_-Array.string_": components["schemas"]["ResultSuccess__cost-number--created_at_trunc-string_-Array_"] | components["schemas"]["ResultError_string_"]; /** @enum {string} */ LlmType: "chat" | "completion"; FunctionCall: { @@ -4780,6 +4802,134 @@ export interface operations { }; }; }; + AddDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["NewDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + AddRandomDataset: { + requestBody: { + content: { + "application/json": components["schemas"]["RandomDatasetParams"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__datasetId-string_.string_"]; + }; + }; + }; + }; + GetDatasets: { + requestBody: { + content: { + "application/json": { + promptVersionId?: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; + }; + }; + }; + }; + InsertDatasetRow: { + parameters: { + path: { + datasetId: string; + }; + }; + requestBody: { + content: { + "application/json": { + originalColumnId?: string; + inputs: components["schemas"]["Record_string.string_"]; + inputRecordId: string; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + CreateDatasetRow: { + parameters: { + path: { + datasetId: string; + promptVersionId: string; + }; + }; + requestBody: { + content: { + "application/json": { + sourceRequest?: string; + inputs: components["schemas"]["Record_string.string_"]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetDataset: { + parameters: { + path: { + datasetId: string; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; + }; + }; + }; + }; + MutateDataset: { + requestBody: { + content: { + "application/json": { + removeRequests: string[]; + addRequests: string[]; + }; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result___-Array.string_"]; + }; + }; + }; + }; CreateNewEmptyExperiment: { requestBody: { content: { @@ -5143,134 +5293,6 @@ export interface operations { }; }; }; - AddDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["NewDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - AddRandomDataset: { - requestBody: { - content: { - "application/json": components["schemas"]["RandomDatasetParams"]; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result__datasetId-string_.string_"]; - }; - }; - }; - }; - GetDatasets: { - requestBody: { - content: { - "application/json": { - promptVersionId?: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_DatasetResult-Array.string_"]; - }; - }; - }; - }; - InsertDatasetRow: { - parameters: { - path: { - datasetId: string; - }; - }; - requestBody: { - content: { - "application/json": { - originalColumnId?: string; - inputs: components["schemas"]["Record_string.string_"]; - inputRecordId: string; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - CreateDatasetRow: { - parameters: { - path: { - datasetId: string; - promptVersionId: string; - }; - }; - requestBody: { - content: { - "application/json": { - sourceRequest?: string; - inputs: components["schemas"]["Record_string.string_"]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_string.string_"]; - }; - }; - }; - }; - GetDataset: { - parameters: { - path: { - datasetId: string; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result_PromptInputRecord-Array.string_"]; - }; - }; - }; - }; - MutateDataset: { - requestBody: { - content: { - "application/json": { - removeRequests: string[]; - addRequests: string[]; - }; - }; - }; - responses: { - /** @description Ok */ - 200: { - content: { - "application/json": components["schemas"]["Result___-Array.string_"]; - }; - }; - }; - }; AddHeliconeDataset: { requestBody: { content: { @@ -5418,11 +5440,6 @@ export interface operations { }; }; GetTotalRequests: { - requestBody: { - content: { - "application/json": components["schemas"]["DataIsBeautifulRequestBody"]; - }; - }; responses: { /** @description Ok */ 200: { @@ -6061,6 +6078,41 @@ export interface operations { }; }; }; + GetOrgName: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_string.string_"]; + }; + }; + }; + }; + GetTotalCosts: { + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result_number.string_"]; + }; + }; + }; + }; + GetCostsOverTime: { + requestBody: { + content: { + "application/json": components["schemas"]["DataOverTimeRequest"]; + }; + }; + responses: { + /** @description Ok */ + 200: { + content: { + "application/json": components["schemas"]["Result__cost-number--created_at_trunc-string_-Array.string_"]; + }; + }; + }; + }; GetSettings: { responses: { /** @description Ok */