From 43509463c0e5f2c75ecdfa3a77d5e7d68b5fefdb Mon Sep 17 00:00:00 2001 From: jangjohn Date: Fri, 6 Mar 2026 02:44:12 +0900 Subject: [PATCH 1/3] fix: remove /preview/ prefix from frontend API calls --- .../acceptance/human-annotation/tests.ts | 2 +- .../DeleteEvaluationModalContent.tsx | 2 +- .../EvalRunDetails/atoms/annotations.ts | 2 +- .../EvalRunDetails/atoms/metricProcessor.ts | 6 ++-- .../EvalRunDetails/atoms/metrics.ts | 8 +++--- .../components/EvalRunDetails/atoms/query.ts | 2 +- .../EvalRunDetails/atoms/references.ts | 2 +- .../atoms/runInvocationAction.ts | 2 +- .../EvalRunDetails/atoms/runMetrics.ts | 4 +-- .../EvalRunDetails/atoms/scenarioSteps.ts | 2 +- .../EvalRunDetails/atoms/table/evaluators.ts | 2 +- .../EvalRunDetails/atoms/table/run.ts | 4 +-- .../EvalRunDetails/atoms/table/scenarios.ts | 2 +- .../EvalRunDetails/atoms/table/testcases.ts | 2 +- .../EvalRunDetails/atoms/testsetDetails.ts | 2 +- .../components/CompareRunsMenu.tsx | 2 +- .../components/GeneralSection.tsx | 2 +- .../utils/runHelpers.ts | 2 +- .../References/atoms/entityReferences.ts | 6 ++-- .../AddToTestsetDrawer/atoms/cascaderState.ts | 2 +- .../assets/AnnotateDrawerTitle/index.tsx | 2 +- .../components/TestcasesTableNew/hooks/api.ts | 8 +++--- .../atoms/fetchTestsetRevisions.ts | 2 +- .../TestsetsTable/atoms/fetchTestsets.ts | 2 +- .../testset/modals/CreateTestsetFromApi.tsx | 4 +-- web/oss/src/lib/hooks/useAnnotations/index.ts | 2 +- .../assets/previewRunBatcher.ts | 2 +- .../assets/previewRunsRequest.ts | 2 +- .../lib/hooks/usePreviewEvaluations/index.ts | 8 +++--- web/oss/src/services/annotations/api/index.ts | 10 +++---- web/oss/src/services/evaluations/api/index.ts | 14 +++++----- .../services/evaluations/invocations/api.ts | 8 +++--- .../src/services/evaluations/results/api.ts | 2 +- .../src/services/evaluations/scenarios/api.ts | 8 +++--- .../src/services/evaluations/workerUtils.ts | 10 +++---- web/oss/src/services/evaluators/index.ts | 18 ++++++------ web/oss/src/services/onlineEvaluations/api.ts | 12 ++++---- web/oss/src/services/queries/api/index.ts | 2 +- web/oss/src/services/runMetrics/api/index.ts | 2 +- web/oss/src/services/testsets/api/index.ts | 28 +++++++++---------- web/oss/src/services/tools/api/index.ts | 2 +- web/oss/src/services/tracing/api/index.ts | 8 +++--- web/oss/src/services/workflows/invoke.ts | 2 +- web/oss/src/state/entities/testcase/api.ts | 2 +- .../state/entities/testcase/paginatedStore.ts | 2 +- .../src/state/entities/testcase/queries.ts | 2 +- .../state/entities/testcase/testcaseEntity.ts | 2 +- .../src/state/entities/testset/controller.ts | 2 +- .../state/entities/testset/paginatedStore.ts | 2 +- .../state/entities/testset/revisionEntity.ts | 6 ++-- web/oss/src/state/entities/testset/store.ts | 10 +++---- web/oss/src/state/evaluators/atoms.ts | 4 +-- .../playwright/acceptance/testsset/index.ts | 2 +- .../agenta-entities/src/testcase/api/api.ts | 8 +++--- .../src/testcase/state/store.ts | 2 +- .../agenta-entities/src/testset/api/api.ts | 18 ++++++------ .../src/testset/api/mutations.ts | 28 +++++++++---------- .../src/testset/state/paginatedStore.ts | 2 +- .../src/testset/state/revisionMolecule.ts | 2 +- .../agenta-entities/src/trace/api/api.ts | 6 ++-- .../fixtures/base.fixture/apiHelpers/index.ts | 4 +-- 61 files changed, 160 insertions(+), 160 deletions(-) diff --git a/web/ee/tests/playwright/acceptance/human-annotation/tests.ts b/web/ee/tests/playwright/acceptance/human-annotation/tests.ts index 5200108d2d..c61a77f264 100644 --- a/web/ee/tests/playwright/acceptance/human-annotation/tests.ts +++ b/web/ee/tests/playwright/acceptance/human-annotation/tests.ts @@ -18,7 +18,7 @@ const testWithHumanFixtures = baseTest.extend({ runs: SnakeToCamelCaseKeys[] count: number }>(page, { - route: `/api/preview/evaluations/runs/query`, + route: `/api/evaluations/runs/query`, method: "POST", }) diff --git a/web/oss/src/components/DeleteEvaluationModal/DeleteEvaluationModalContent.tsx b/web/oss/src/components/DeleteEvaluationModal/DeleteEvaluationModalContent.tsx index f4347f8a0e..3862d60bad 100644 --- a/web/oss/src/components/DeleteEvaluationModal/DeleteEvaluationModalContent.tsx +++ b/web/oss/src/components/DeleteEvaluationModal/DeleteEvaluationModalContent.tsx @@ -20,7 +20,7 @@ interface DeleteEvaluationModalContentProps { const deletePreviewRuns = async (projectId: string | null | undefined, runIds: string[]) => { if (!projectId || runIds.length === 0) return - await axios.delete(`/preview/evaluations/runs/`, { + await axios.delete(`/evaluations/runs/`, { params: {project_id: projectId}, data: {run_ids: runIds}, }) diff --git a/web/oss/src/components/EvalRunDetails/atoms/annotations.ts b/web/oss/src/components/EvalRunDetails/atoms/annotations.ts index 2cc359c3ca..94efbfb9ce 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/annotations.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/annotations.ts @@ -62,7 +62,7 @@ export const evaluationAnnotationBatcherFamily = atomFamily( try { const response = await axios.post( - `/preview/annotations/query`, + `/annotations/query`, {annotation_links: annotationLinks}, { params: {project_id: projectId}, diff --git a/web/oss/src/components/EvalRunDetails/atoms/metricProcessor.ts b/web/oss/src/components/EvalRunDetails/atoms/metricProcessor.ts index 5b87a390e3..8f6fd09baf 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/metricProcessor.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/metricProcessor.ts @@ -483,7 +483,7 @@ export const createMetricProcessor = ({ const params = new URLSearchParams() params.set("project_id", projectId) const response = await axios.post( - `/preview/evaluations/metrics/refresh`, + `/evaluations/metrics/refresh`, { metrics: { run_id: runId, @@ -540,7 +540,7 @@ export const createMetricProcessor = ({ const params = new URLSearchParams() params.set("project_id", projectId) const response = await axios.post( - `/preview/evaluations/metrics/refresh`, + `/evaluations/metrics/refresh`, { metrics: { run_id: runId, @@ -671,7 +671,7 @@ export const createMetricProcessor = ({ const params = new URLSearchParams() params.set("project_id", projectId) const response = await axios.post( - `/preview/evaluations/metrics/refresh`, + `/evaluations/metrics/refresh`, { metrics: { run_id: runId, diff --git a/web/oss/src/components/EvalRunDetails/atoms/metrics.ts b/web/oss/src/components/EvalRunDetails/atoms/metrics.ts index cf39fca18a..38b9acdebb 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/metrics.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/metrics.ts @@ -694,7 +694,7 @@ export const evaluationMetricBatcherFamily = atomFamily(({runId}: {runId?: strin } const response = await axios.post( - `/preview/evaluations/metrics/query`, + `/evaluations/metrics/query`, { metrics: { ...metricPayload, @@ -876,7 +876,7 @@ export const runLevelMetricQueryAtomFamily = atomFamily(({runId}: {runId?: strin if (!projectId || !effectiveRunId) return null const response = await axios.post( - `/preview/evaluations/metrics/query`, + `/evaluations/metrics/query`, { metrics: { run_ids: [effectiveRunId], @@ -920,7 +920,7 @@ export const triggerMetricsRefresh = async ({ // Refresh scenario-level metrics if scenarioId is provided if (scenarioId) { await axios.post( - `/preview/evaluations/metrics/refresh`, + `/evaluations/metrics/refresh`, { metrics: { run_id: runId, @@ -932,7 +932,7 @@ export const triggerMetricsRefresh = async ({ } // Refresh run-level metrics (without scenario_id) await axios.post( - `/preview/evaluations/metrics/refresh`, + `/evaluations/metrics/refresh`, { metrics: { run_id: runId, diff --git a/web/oss/src/components/EvalRunDetails/atoms/query.ts b/web/oss/src/components/EvalRunDetails/atoms/query.ts index ca041c26cf..763f340791 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/query.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/query.ts @@ -402,7 +402,7 @@ const evaluationQueryRevisionBatchFetcher = createBatchFetcher< if (variantRefs.length) body.query_variant_refs = variantRefs if (queryRefs.length) body.query_refs = queryRefs - const response = await axios.post("/preview/queries/revisions/query", body, { + const response = await axios.post("/queries/revisions/query", body, { params: {project_id: projectId}, _ignoreError: true, } as any) diff --git a/web/oss/src/components/EvalRunDetails/atoms/references.ts b/web/oss/src/components/EvalRunDetails/atoms/references.ts index ea6b4d5b6d..b35b40f272 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/references.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/references.ts @@ -166,7 +166,7 @@ export const testsetReferenceQueryAtomFamily = atomFamily((testsetId: string | n queryFn: async () => { if (!projectId || !testsetId) return null try { - const response = await axios.get(`/preview/testsets/${testsetId}`, { + const response = await axios.get(`/testsets/${testsetId}`, { params: {project_id: projectId}, _ignoreError: true, } as any) diff --git a/web/oss/src/components/EvalRunDetails/atoms/runInvocationAction.ts b/web/oss/src/components/EvalRunDetails/atoms/runInvocationAction.ts index 7111288ce7..9695265c23 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/runInvocationAction.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/runInvocationAction.ts @@ -229,7 +229,7 @@ export const triggerRunInvocationAtom = atom( if (testcaseId) { try { const testcaseResponse = await axios.post( - `/preview/testcases/query`, + `/testcases/query`, {testcase_ids: [testcaseId]}, {params: {project_id: projectId}}, ) diff --git a/web/oss/src/components/EvalRunDetails/atoms/runMetrics.ts b/web/oss/src/components/EvalRunDetails/atoms/runMetrics.ts index 9aa1fbe606..85c3b61a47 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/runMetrics.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/runMetrics.ts @@ -517,7 +517,7 @@ const runMetricsBatchFetcher = createBatchFetcher }, } - const response = await axios.post(`/preview/evaluations/metrics/query`, basePayload, { + const response = await axios.post(`/evaluations/metrics/query`, basePayload, { params: {project_id: entry.projectId}, }) @@ -544,7 +544,7 @@ const runMetricsBatchFetcher = createBatchFetcher if (entry.needsTemporal) { try { const temporalResponse = await axios.post( - `/preview/evaluations/metrics/query`, + `/evaluations/metrics/query`, { ...basePayload, metrics: { diff --git a/web/oss/src/components/EvalRunDetails/atoms/scenarioSteps.ts b/web/oss/src/components/EvalRunDetails/atoms/scenarioSteps.ts index 566ddb321d..06e6f0ae5d 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/scenarioSteps.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/scenarioSteps.ts @@ -64,7 +64,7 @@ export const scenarioStepsBatcherFamily = atomFamily(({runId}: {runId?: string | } const response = await axios.post<{results?: any[]; steps?: any[]}>( - `/preview/evaluations/results/query?project_id=${projectId}`, + `/evaluations/results/query?project_id=${projectId}`, { result: { run_id: effectiveRunId, diff --git a/web/oss/src/components/EvalRunDetails/atoms/table/evaluators.ts b/web/oss/src/components/EvalRunDetails/atoms/table/evaluators.ts index ec93d0a556..ce8750fe25 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/table/evaluators.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/table/evaluators.ts @@ -178,7 +178,7 @@ const evaluatorFetchBatcher = createBatchFetcher( - `/preview/evaluations/scenarios/query`, + `/evaluations/scenarios/query`, payload, { params: { diff --git a/web/oss/src/components/EvalRunDetails/atoms/table/testcases.ts b/web/oss/src/components/EvalRunDetails/atoms/table/testcases.ts index 59eb685dad..ecd305a68a 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/table/testcases.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/table/testcases.ts @@ -56,7 +56,7 @@ export const evaluationTestcaseBatcherFamily = atomFamily(({runId}: {runId?: str } const response = await axios.post( - `/preview/testcases/query`, + `/testcases/query`, {testcase_ids: uniqueIds}, { params: {project_id: projectId}, diff --git a/web/oss/src/components/EvalRunDetails/atoms/testsetDetails.ts b/web/oss/src/components/EvalRunDetails/atoms/testsetDetails.ts index 3329ba5708..e770f1bcb7 100644 --- a/web/oss/src/components/EvalRunDetails/atoms/testsetDetails.ts +++ b/web/oss/src/components/EvalRunDetails/atoms/testsetDetails.ts @@ -78,7 +78,7 @@ export const simpleTestsetDetailsAtomFamily = atomFamily((testsetId: string | nu if (!enabled || !projectId || !testsetId) return null try { - const response = await axios.get(`/preview/simple/testsets/${testsetId}`, { + const response = await axios.get(`/simple/testsets/${testsetId}`, { params: {project_id: projectId}, _ignoreError: true, } as any) diff --git a/web/oss/src/components/EvalRunDetails/components/CompareRunsMenu.tsx b/web/oss/src/components/EvalRunDetails/components/CompareRunsMenu.tsx index cabd5a9cce..b041d462bf 100644 --- a/web/oss/src/components/EvalRunDetails/components/CompareRunsMenu.tsx +++ b/web/oss/src/components/EvalRunDetails/components/CompareRunsMenu.tsx @@ -561,7 +561,7 @@ const useTestsetNameMap = (testsetIds: string[]) => { const fetchNames = async () => { try { const response = await axios.post( - "/preview/testsets/query", + "/testsets/query", { testset_refs: memoizedIds.ids.map((id) => ({id})), include_archived: true, diff --git a/web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/GeneralSection.tsx b/web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/GeneralSection.tsx index 704f48373e..0ab70cb865 100644 --- a/web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/GeneralSection.tsx +++ b/web/oss/src/components/EvalRunDetails/components/views/ConfigurationView/components/GeneralSection.tsx @@ -83,7 +83,7 @@ const GeneralSection = ({runId, showActions = true, showHeader = true}: GeneralS string, any > - await axios.patch(`/preview/evaluations/runs/${runId}`, { + await axios.patch(`/evaluations/runs/${runId}`, { run: { ...base, id: runId, diff --git a/web/oss/src/components/EvaluationRunsTablePOC/utils/runHelpers.ts b/web/oss/src/components/EvaluationRunsTablePOC/utils/runHelpers.ts index 6487e93288..2fb39a2d4d 100644 --- a/web/oss/src/components/EvaluationRunsTablePOC/utils/runHelpers.ts +++ b/web/oss/src/components/EvaluationRunsTablePOC/utils/runHelpers.ts @@ -25,7 +25,7 @@ export const resolveRowAppId = ( export const deletePreviewRuns = async (projectId: string | null | undefined, runIds: string[]) => { if (!projectId || runIds.length === 0) return - await axios.delete(`/preview/evaluations/runs/`, { + await axios.delete(`/evaluations/runs/`, { params: {project_id: projectId}, data: {run_ids: runIds}, }) diff --git a/web/oss/src/components/References/atoms/entityReferences.ts b/web/oss/src/components/References/atoms/entityReferences.ts index c4d09759fc..62b6ac860f 100644 --- a/web/oss/src/components/References/atoms/entityReferences.ts +++ b/web/oss/src/components/References/atoms/entityReferences.ts @@ -149,7 +149,7 @@ const previewTestsetReferenceBatchFetcher = createBatchFetcher< try { const response = await axios.post( - "/preview/testsets/query", + "/testsets/query", { testset_refs: uniqueIds.map((id) => ({id})), include_archived: true, @@ -484,7 +484,7 @@ const evaluatorReferenceBatchFetcher = createBatchFetcher< try { const response = await axios.post( - "/preview/simple/evaluators/query", + "/simple/evaluators/query", { evaluator_refs: dedupRefs.map((ref) => ({ slug: ref.slug, @@ -968,7 +968,7 @@ const queryReferenceBatchFetcher = createBatchFetcher< try { const response = await axios.post( - "/preview/queries/query", + "/queries/query", { query_refs: dedupRefs.map((ref) => ({ id: ref.id, diff --git a/web/oss/src/components/SharedDrawers/AddToTestsetDrawer/atoms/cascaderState.ts b/web/oss/src/components/SharedDrawers/AddToTestsetDrawer/atoms/cascaderState.ts index 3c8827e208..3b3fb58e7a 100644 --- a/web/oss/src/components/SharedDrawers/AddToTestsetDrawer/atoms/cascaderState.ts +++ b/web/oss/src/components/SharedDrawers/AddToTestsetDrawer/atoms/cascaderState.ts @@ -134,7 +134,7 @@ async function fetchRevisionsForCascader( testsetId: string, ): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_refs: [{id: testsetId}], windowing: {limit: 100, order: "descending"}, diff --git a/web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsx b/web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsx index b84adbeb74..d75e0bcdc1 100644 --- a/web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsx +++ b/web/oss/src/components/SharedDrawers/AnnotateDrawer/assets/AnnotateDrawerTitle/index.tsx @@ -148,7 +148,7 @@ const AnnotateDrawerTitle = ({ // 2. Invalidate SWR cache for useAnnotations hook (used by TraceDrawer) await mutateCache( - (key) => Array.isArray(key) && key[0]?.includes("/preview/annotations/"), + (key) => Array.isArray(key) && key[0]?.includes("/annotations/"), undefined, {revalidate: true}, ) diff --git a/web/oss/src/components/TestcasesTableNew/hooks/api.ts b/web/oss/src/components/TestcasesTableNew/hooks/api.ts index 88b6c065a8..4f561a096f 100644 --- a/web/oss/src/components/TestcasesTableNew/hooks/api.ts +++ b/web/oss/src/components/TestcasesTableNew/hooks/api.ts @@ -12,7 +12,7 @@ export const PAGE_SIZE = 50 */ export async function fetchRevision(projectId: string, revisionId: string) { const response = await axios.get( - `${getAgentaApiUrl()}/preview/testsets/revisions/${revisionId}`, + `${getAgentaApiUrl()}/testsets/revisions/${revisionId}`, {params: {project_id: projectId, include_testcases: true}}, ) return response.data?.testset_revision @@ -28,7 +28,7 @@ export async function fetchTestcasesPage( cursor: string | null, ): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testcases/query`, + `${getAgentaApiUrl()}/testcases/query`, { testset_revision_id: revisionId, windowing: { @@ -58,7 +58,7 @@ export async function fetchTestcasesPage( */ export async function fetchTestsetName(projectId: string, testsetId: string): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/query`, + `${getAgentaApiUrl()}/testsets/query`, { testset_refs: [{id: testsetId}], windowing: {limit: 1}, @@ -77,7 +77,7 @@ export async function fetchRevisionsByTestsetId( testsetId: string, ): Promise<{id: string; version: number; created_at: string}[]> { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_refs: [{id: testsetId}], windowing: {limit: 100}, diff --git a/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts b/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts index 60e5716eed..2e9cdc3ea7 100644 --- a/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts +++ b/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts @@ -71,7 +71,7 @@ export const fetchTestsetRevisions = async ({ try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_refs: [{id: testsetId}], windowing: { diff --git a/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts b/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts index 31eb91c046..4d21ca3868 100644 --- a/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts +++ b/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts @@ -84,7 +84,7 @@ export const fetchTestsetsWindow = async ({ try { // Use /preview/testsets/query - returns Testset metadata without testcases const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/query`, + `${getAgentaApiUrl()}/testsets/query`, queryPayload, { params: {project_id: projectId}, diff --git a/web/oss/src/components/pages/testset/modals/CreateTestsetFromApi.tsx b/web/oss/src/components/pages/testset/modals/CreateTestsetFromApi.tsx index a387815f22..890a427bca 100644 --- a/web/oss/src/components/pages/testset/modals/CreateTestsetFromApi.tsx +++ b/web/oss/src/components/pages/testset/modals/CreateTestsetFromApi.tsx @@ -73,8 +73,8 @@ const CreateTestsetFromApi: React.FC = ({setCurrent, onCancel}) => { const [uploadType, setUploadType] = useState<"csv" | "json">("csv") const [selectedLang, setSelectedLang] = useState("python") - const uploadURI = `${getAgentaApiUrl()}/preview/simple/testsets/upload` - const jsonURI = `${getAgentaApiUrl()}/preview/simple/testsets/` + const uploadURI = `${getAgentaApiUrl()}/simple/testsets/upload` + const jsonURI = `${getAgentaApiUrl()}/simple/testsets/` const params = `{ "testset": { diff --git a/web/oss/src/lib/hooks/useAnnotations/index.ts b/web/oss/src/lib/hooks/useAnnotations/index.ts index e3b14dd40c..0bcf67c504 100644 --- a/web/oss/src/lib/hooks/useAnnotations/index.ts +++ b/web/oss/src/lib/hooks/useAnnotations/index.ts @@ -31,7 +31,7 @@ const useAnnotations = ({ const swrKey = waitUntil ? null - : [`/preview/annotations/?project_id=${projectId}`, JSON.stringify(queries)] + : [`/annotations/?project_id=${projectId}`, JSON.stringify(queries)] const swr = useSWR(swrKey, fetcher, { revalidateOnFocus: false, diff --git a/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunBatcher.ts b/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunBatcher.ts index de2b2eee2e..a6de512ebd 100644 --- a/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunBatcher.ts +++ b/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunBatcher.ts @@ -75,7 +75,7 @@ const getPreviewRunBatcherCore = () => { } const response = await axios.post( - `/preview/evaluations/runs/query`, + `/evaluations/runs/query`, payload, { params: {project_id: projectId}, diff --git a/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunsRequest.ts b/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunsRequest.ts index 0134201014..bdd50a8323 100644 --- a/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunsRequest.ts +++ b/web/oss/src/lib/hooks/usePreviewEvaluations/assets/previewRunsRequest.ts @@ -164,7 +164,7 @@ export const fetchPreviewRunsShared = async ( } const request = axios - .post(`/preview/evaluations/runs/query`, payload, { + .post(`/evaluations/runs/query`, payload, { params: queryParams, }) .then((response) => { diff --git a/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts b/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts index f2c98c87cb..d49462cb2e 100644 --- a/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts +++ b/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts @@ -129,7 +129,7 @@ interface PreviewEvaluationsQueryState { import {searchQueryAtom} from "./states/queryFilterAtoms" import {EnrichedEvaluationRun, EvaluationRun} from "./types" -const SCENARIOS_ENDPOINT = "/preview/evaluations/scenarios/" +const SCENARIOS_ENDPOINT = "/evaluations/scenarios/" /** * Custom hook to manage and enrich preview evaluation runs. @@ -365,7 +365,7 @@ const usePreviewEvaluations = ({ // Paginate through /preview/testcases/query until no more pages do { const response = await axios.post( - "/preview/testcases/query", + "/testcases/query", { testset_revision_id: revision.id, windowing: { @@ -414,7 +414,7 @@ const usePreviewEvaluations = ({ // 3. Invoke preview run endpoint (include project for backend routing) const response = await axios.post( - `/preview/evaluations/runs/?project_id=${projectId}`, + `/evaluations/runs/?project_id=${projectId}`, params, ) @@ -496,7 +496,7 @@ const usePreviewEvaluations = ({ ) // 7. Invoke the /results endpoint await axios - .post(`/preview/evaluations/results/?project_id=${projectId}`, { + .post(`/evaluations/results/?project_id=${projectId}`, { results: allSteps, }) // .then((res) => { diff --git a/web/oss/src/services/annotations/api/index.ts b/web/oss/src/services/annotations/api/index.ts index 39425e0e1a..cf62faf86c 100644 --- a/web/oss/src/services/annotations/api/index.ts +++ b/web/oss/src/services/annotations/api/index.ts @@ -20,7 +20,7 @@ export const queryAllAnnotations = async ( ): Promise => { const projectId = ensureProjectId() const base = getBaseUrl() - const url = new URL(`${base}/preview/annotations/query`) + const url = new URL(`${base}/annotations/query`) if (projectId) url.searchParams.set("project_id", projectId) const body = queries && Object.keys(queries).length > 0 ? queries : {} return fetchJson(url, {method: "POST", body: JSON.stringify(body)}) @@ -30,7 +30,7 @@ export const createAnnotation = async (annotationPayload: AnnotationDto) => { const {projectId} = getProjectValues() return await axios.post( - `${getAgentaApiUrl()}/preview/annotations/?project_id=${projectId}`, + `${getAgentaApiUrl()}/annotations/?project_id=${projectId}`, annotationPayload, ) } @@ -47,7 +47,7 @@ export const updateAnnotation = async ({ const {projectId} = getProjectValues() return await axios.patch( - `${getAgentaApiUrl()}/preview/annotations/${traceId}/${spanId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/annotations/${traceId}/${spanId}?project_id=${projectId}`, payload, ) } @@ -69,7 +69,7 @@ export const fetchAnnotation = async ({ } else { axios .get( - `${getAgentaApiUrl()}/preview/annotations/${traceId}/${spanId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/annotations/${traceId}/${spanId}?project_id=${projectId}`, {signal}, ) .then((response) => { @@ -83,6 +83,6 @@ export const deleteAnnotation = async ({traceId, spanId}: {traceId: string; span const {projectId} = getProjectValues() return await axios.delete( - `${getAgentaApiUrl()}/preview/annotations/${traceId}/${spanId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/annotations/${traceId}/${spanId}?project_id=${projectId}`, ) } diff --git a/web/oss/src/services/evaluations/api/index.ts b/web/oss/src/services/evaluations/api/index.ts index 7e67e74417..6d3b7c48e7 100644 --- a/web/oss/src/services/evaluations/api/index.ts +++ b/web/oss/src/services/evaluations/api/index.ts @@ -72,7 +72,7 @@ export const fetchEvaluation = async (evaluationId: string) => { const id = assertValidId(evaluationId) // Use preview API to query single evaluation by ID - const response = await axios.post(`/preview/evaluations/runs/query?project_id=${projectId}`, { + const response = await axios.post(`/evaluations/runs/query?project_id=${projectId}`, { run: { ids: [id], }, @@ -140,7 +140,7 @@ export const fetchEvaluationStatus = async (evaluationId: string) => { const id = assertValidId(evaluationId) // Use preview API to query single evaluation by ID - const response = await axios.post(`/preview/evaluations/runs/query?project_id=${projectId}`, { + const response = await axios.post(`/evaluations/runs/query?project_id=${projectId}`, { run: { ids: [id], }, @@ -187,7 +187,7 @@ export const createEvaluation = async (appId: string, evaluation: CreateEvaluati const name = "name" in evaluation ? evaluation.name : "Evaluation" // Default name for legacy variant // Use simple evaluations endpoint which auto-starts execution - return await axios.post(`/preview/simple/evaluations/?project_id=${projectId}`, { + return await axios.post(`/simple/evaluations/?project_id=${projectId}`, { evaluation: { name, data: { @@ -219,7 +219,7 @@ export const deleteEvaluations = async (evaluationsIds: string[]) => { const {projectId} = getProjectValues() // Use preview API to delete runs - return axios.delete(`/preview/evaluations/runs/?project_id=${projectId}`, { + return axios.delete(`/evaluations/runs/?project_id=${projectId}`, { data: {run_ids: evaluationsIds}, }) } @@ -234,7 +234,7 @@ export const fetchAllEvaluationScenarios = async (evaluationId: string) => { // Fetch evaluation and scenarios in parallel using preview API const [{data: scenariosResponse}, evaluation] = await Promise.all([ - axios.post(`/preview/evaluations/scenarios/query?project_id=${projectId}`, { + axios.post(`/evaluations/scenarios/query?project_id=${projectId}`, { scenario: { references: [{evaluation_run: {id}}], }, @@ -260,7 +260,7 @@ export const updateScenarioStatus = async ( status: EvaluationStatus, ) => { const {projectId} = getProjectValues() - return axios.patch(`/preview/evaluations/scenarios/?project_id=${projectId}`, { + return axios.patch(`/evaluations/scenarios/?project_id=${projectId}`, { scenarios: [{...scenario, status}], }) } @@ -290,7 +290,7 @@ export const fetchEvaluatonIdsByResource = async ({ }) // Use preview API to query runs by references - const response = await axios.post(`/preview/evaluations/runs/query?project_id=${projectId}`, { + const response = await axios.post(`/evaluations/runs/query?project_id=${projectId}`, { run: { references, }, diff --git a/web/oss/src/services/evaluations/invocations/api.ts b/web/oss/src/services/evaluations/invocations/api.ts index 3507a5f87d..dfdb00839a 100644 --- a/web/oss/src/services/evaluations/invocations/api.ts +++ b/web/oss/src/services/evaluations/invocations/api.ts @@ -10,7 +10,7 @@ import {getProjectValues} from "@/oss/state/project" import {queryStepResults} from "../results/api" -const RESULTS_ENDPOINT = "/preview/evaluations/results/" +const RESULTS_ENDPOINT = "/evaluations/results/" export interface InvocationReferences { application?: {id: string} @@ -270,7 +270,7 @@ const updateScenarioStatus = async ( const {projectId} = getProjectValues() try { - await axios.patch(`/preview/evaluations/scenarios/?project_id=${projectId}`, { + await axios.patch(`/evaluations/scenarios/?project_id=${projectId}`, { scenarios: [{id: scenarioId, status}], }) } catch (error) { @@ -288,7 +288,7 @@ const _checkAndUpdateRunStatus = async (runId: string): Promise => { try { // Query all scenarios for this run const scenariosResponse = await axios.post( - `/preview/evaluations/scenarios/query?project_id=${projectId}`, + `/evaluations/scenarios/query?project_id=${projectId}`, { scenario: {run_ids: [runId]}, windowing: {limit: 1000}, // Get all scenarios @@ -351,7 +351,7 @@ const _checkAndUpdateRunStatus = async (runId: string): Promise => { : EvaluationStatus.FINISHED // Update run status - await axios.patch(`/preview/evaluations/runs/${runId}?project_id=${projectId}`, { + await axios.patch(`/evaluations/runs/${runId}?project_id=${projectId}`, { run: {id: runId, status: runStatus}, }) diff --git a/web/oss/src/services/evaluations/results/api.ts b/web/oss/src/services/evaluations/results/api.ts index dbe4bb6f9b..1ad87a4e76 100644 --- a/web/oss/src/services/evaluations/results/api.ts +++ b/web/oss/src/services/evaluations/results/api.ts @@ -6,7 +6,7 @@ import axios from "@/oss/lib/api/assets/axiosConfig" import {getProjectValues} from "@/oss/state/project" -const RESULTS_ENDPOINT = "/preview/evaluations/results/" +const RESULTS_ENDPOINT = "/evaluations/results/" /** * Convert a hex string (32 chars) to UUID format (with dashes) diff --git a/web/oss/src/services/evaluations/scenarios/api.ts b/web/oss/src/services/evaluations/scenarios/api.ts index 292fb0d139..2509196fca 100644 --- a/web/oss/src/services/evaluations/scenarios/api.ts +++ b/web/oss/src/services/evaluations/scenarios/api.ts @@ -29,7 +29,7 @@ export const updateScenarioStatus = async (scenarioId: string, status: string): throw new Error("Invalid scenario ID format") } - await axios.patch(`/preview/evaluations/scenarios/?project_id=${projectId}`, { + await axios.patch(`/evaluations/scenarios/?project_id=${projectId}`, { scenarios: [{id: scenarioId, status}], }) } @@ -49,7 +49,7 @@ export const checkAndUpdateRunStatus = async (runId: string): Promise => { try { // Query all scenarios for this run const scenariosResponse = await axios.post( - `/preview/evaluations/scenarios/query?project_id=${projectId}`, + `/evaluations/scenarios/query?project_id=${projectId}`, { scenario: {run_ids: [runId]}, windowing: {limit: 1000}, @@ -86,7 +86,7 @@ export const checkAndUpdateRunStatus = async (runId: string): Promise => { // Fetch the existing run data first to preserve all fields const runResponse = await axios.post( - `/preview/evaluations/runs/query?project_id=${projectId}`, + `/evaluations/runs/query?project_id=${projectId}`, {run: {ids: [runId]}}, ) @@ -94,7 +94,7 @@ export const checkAndUpdateRunStatus = async (runId: string): Promise => { if (!existingRun) return // Update run status by sending the complete run object with only status changed - await axios.patch(`/preview/evaluations/runs/${runId}`, { + await axios.patch(`/evaluations/runs/${runId}`, { run: {...existingRun, id: runId, status: newRunStatus}, }) diff --git a/web/oss/src/services/evaluations/workerUtils.ts b/web/oss/src/services/evaluations/workerUtils.ts index f48a2cba9e..7a2a147f1d 100644 --- a/web/oss/src/services/evaluations/workerUtils.ts +++ b/web/oss/src/services/evaluations/workerUtils.ts @@ -14,7 +14,7 @@ export async function updateScenarioStatusRemote( try { // 1. Query results to validate scenario context (scenarios GET is deprecated) const res = await fetch( - `${apiUrl}/preview/evaluations/results/query?project_id=${projectId}`, + `${apiUrl}/evaluations/results/query?project_id=${projectId}`, { method: "POST", headers: { @@ -38,7 +38,7 @@ export async function updateScenarioStatusRemote( } if (!scenarioFull) scenarioFull = {id: scenarioId} scenarioFull.status = status - await fetch(`${apiUrl}/preview/evaluations/scenarios/?project_id=${projectId}`, { + await fetch(`${apiUrl}/evaluations/scenarios/?project_id=${projectId}`, { method: "PATCH", headers: { "Content-Type": "application/json", @@ -80,7 +80,7 @@ export async function upsertScenarioStep(params: { } = params try { const res = await fetch( - `${apiUrl}/preview/evaluations/results/query?project_id=${projectId}`, + `${apiUrl}/evaluations/results/query?project_id=${projectId}`, { method: "POST", headers: { @@ -113,7 +113,7 @@ export async function upsertScenarioStep(params: { span_id: spanId, references: {...((existing as any)?.references || {}), ...references}, } - await fetch(`${apiUrl}/preview/evaluations/results/?project_id=${projectId}`, { + await fetch(`${apiUrl}/evaluations/results/?project_id=${projectId}`, { method: "PATCH", headers: { "Content-Type": "application/json", @@ -143,7 +143,7 @@ export async function upsertScenarioStep(params: { ], } try { - await fetch(`${apiUrl}/preview/evaluations/results/?project_id=${projectId}`, { + await fetch(`${apiUrl}/evaluations/results/?project_id=${projectId}`, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/web/oss/src/services/evaluators/index.ts b/web/oss/src/services/evaluators/index.ts index 25fc082d1c..2db62b8dbb 100644 --- a/web/oss/src/services/evaluators/index.ts +++ b/web/oss/src/services/evaluators/index.ts @@ -33,7 +33,7 @@ export const createEvaluator = async (evaluatorPayload: EvaluatorResponseDto<"pa try { const data = await axios.post( - `${getAgentaApiUrl()}/preview/simple/evaluators/?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/?project_id=${projectId}`, evaluatorPayload, ) @@ -51,7 +51,7 @@ export const updateEvaluator = async ( try { const data = await axios.put( - `${getAgentaApiUrl()}/preview/simple/evaluators/${evaluatorId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/${evaluatorId}?project_id=${projectId}`, evaluatorPayload, ) @@ -68,7 +68,7 @@ export const fetchEvaluatorById = async (evaluatorId: string): Promise { const {projectId} = getProjectValues() const response = await axios.get( - `${getAgentaApiUrl()}/preview/simple/evaluators/templates?project_id=${projectId}&include_archived=${includeArchived}`, + `${getAgentaApiUrl()}/simple/evaluators/templates?project_id=${projectId}&include_archived=${includeArchived}`, ) const templates = response.data?.templates || [] @@ -150,7 +150,7 @@ export const fetchAllEvaluatorConfigs = async ( } const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/evaluators/query?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/query?project_id=${projectId}`, { include_archived: false, }, @@ -201,7 +201,7 @@ export const createEvaluatorConfig = async ( } const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/evaluators/?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/?project_id=${projectId}`, {evaluator: payload}, ) @@ -220,7 +220,7 @@ export const updateEvaluatorConfig = async ( const {projectId} = getProjectValues() const response = await axios.put( - `${getAgentaApiUrl()}/preview/simple/evaluators/${configId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/${configId}?project_id=${projectId}`, {evaluator: {...config, id: configId}}, ) @@ -236,7 +236,7 @@ export const deleteEvaluatorConfig = async (configId: string) => { const {projectId} = getProjectValues() return axios.post( - `${getAgentaApiUrl()}/preview/simple/evaluators/${configId}/archive?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/${configId}/archive?project_id=${projectId}`, ) } @@ -244,6 +244,6 @@ export const deleteHumanEvaluator = async (evaluatorId: string) => { const {projectId} = getProjectValues() return axios.post( - `${getAgentaApiUrl()}/preview/simple/evaluators/${evaluatorId}/archive?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/evaluators/${evaluatorId}/archive?project_id=${projectId}`, ) } diff --git a/web/oss/src/services/onlineEvaluations/api.ts b/web/oss/src/services/onlineEvaluations/api.ts index e0650b45d9..cbb091beb0 100644 --- a/web/oss/src/services/onlineEvaluations/api.ts +++ b/web/oss/src/services/onlineEvaluations/api.ts @@ -148,41 +148,41 @@ const getProjectUrl = (path: string) => { export const createSimpleQuery = async ( payload: SimpleQueryCreateRequest, ): Promise => { - const {data} = await axios.post(getProjectUrl("/preview/simple/queries/"), payload) + const {data} = await axios.post(getProjectUrl("/simple/queries/"), payload) return data as SimpleQueryResponse } export const retrieveQueryRevision = async ( payload: QueryRevisionRetrieveRequest, ): Promise => { - const {data} = await axios.post(getProjectUrl("/preview/queries/revisions/retrieve"), payload) + const {data} = await axios.post(getProjectUrl("/queries/revisions/retrieve"), payload) return data as QueryRevisionResponse } export const createSimpleEvaluation = async ( payload: SimpleEvaluationCreateRequest, ): Promise => { - const {data} = await axios.post(getProjectUrl("/preview/simple/evaluations/"), payload) + const {data} = await axios.post(getProjectUrl("/simple/evaluations/"), payload) return data as SimpleEvaluationResponse } export const querySimpleEvaluations = async ( payload?: SimpleEvaluationsQueryRequest, ): Promise => { - const url = getProjectUrl("/preview/simple/evaluations/query") + const url = getProjectUrl("/simple/evaluations/query") const body = payload ?? {} const {data} = await axios.post(url, body) return data as SimpleEvaluationsResponse } export const stopSimpleEvaluation = async (evaluationId: string) => { - const url = getProjectUrl(`/preview/simple/evaluations/${evaluationId}/stop`) + const url = getProjectUrl(`/simple/evaluations/${evaluationId}/stop`) const {data} = await axios.post(url) return data } export const startSimpleEvaluation = async (evaluationId: string) => { - const url = getProjectUrl(`/preview/simple/evaluations/${evaluationId}/start`) + const url = getProjectUrl(`/simple/evaluations/${evaluationId}/start`) const {data} = await axios.post(url) return data } diff --git a/web/oss/src/services/queries/api/index.ts b/web/oss/src/services/queries/api/index.ts index 3b3c5bf674..e6cae115ad 100644 --- a/web/oss/src/services/queries/api/index.ts +++ b/web/oss/src/services/queries/api/index.ts @@ -10,7 +10,7 @@ import type { QueriesResponse, } from "./types" -const base = () => `${getAgentaApiUrl()}/preview/queries` +const base = () => `${getAgentaApiUrl()}/queries` export async function createQuery(payload: QueryCreateRequest): Promise { const {projectId} = getProjectValues() diff --git a/web/oss/src/services/runMetrics/api/index.ts b/web/oss/src/services/runMetrics/api/index.ts index d2e714fcf4..f175601fdd 100644 --- a/web/oss/src/services/runMetrics/api/index.ts +++ b/web/oss/src/services/runMetrics/api/index.ts @@ -5,7 +5,7 @@ import {getProjectValues} from "@/oss/state/project" import {iqrsLevels, PERCENTILE_STOPS} from "./assets/contants" import {BasicStats} from "./types" -export const METRICS_ENDPOINT = "/preview/evaluations/metrics/" +export const METRICS_ENDPOINT = "/evaluations/metrics/" const fetchJSON = async (url: string, options: RequestInit) => { const res = await fetch(url, options) diff --git a/web/oss/src/services/testsets/api/index.ts b/web/oss/src/services/testsets/api/index.ts index 2ba65d348c..b49bed403a 100644 --- a/web/oss/src/services/testsets/api/index.ts +++ b/web/oss/src/services/testsets/api/index.ts @@ -16,7 +16,7 @@ export const fetchPreviewTestsets = async (payload: PreviewTestsetsQueryPayload const {projectId} = getProjectValues() const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/query?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/query?project_id=${projectId}`, payload, ) @@ -40,7 +40,7 @@ export async function createNewTestset( // Use /preview/simple/testsets endpoint - creates testset, variant, and revision in one call const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/?project_id=${projectId}`, { testset: { slug: baseSlug, @@ -80,7 +80,7 @@ export async function fetchSimpleTestset(testsetId: string) { const {projectId} = getProjectValues() const response = await axios.get( - `${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/${testsetId}?project_id=${projectId}`, ) return response.data?.testset @@ -97,7 +97,7 @@ export async function updateTestsetMetadata( const {projectId} = getProjectValues() const response = await axios.put( - `${getAgentaApiUrl()}/preview/testsets/${testsetId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/testsets/${testsetId}?project_id=${projectId}`, { testset: { id: testsetId, @@ -126,7 +126,7 @@ export async function renameTestset(testsetId: string, newName: string) { // Update with new name, preserving existing data const response = await axios.put( - `${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/${testsetId}?project_id=${projectId}`, { testset: { id: testsetId, @@ -158,7 +158,7 @@ export async function cloneTestset(sourceTestsetId: string, newName: string) { const baseSlug = newName.toLowerCase().replace(/\s+/g, "_") const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/?project_id=${projectId}`, { testset: { slug: baseSlug, @@ -207,7 +207,7 @@ export const uploadTestsetPreview = async ( } const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/upload?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/upload?project_id=${projectId}`, formData, { headers: { @@ -240,7 +240,7 @@ export const uploadTestsetRevisionPreview = async ( } const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}/upload?project_id=${projectId}`, + `${getAgentaApiUrl()}/simple/testsets/${testsetId}/upload?project_id=${projectId}`, formData, { headers: { @@ -259,7 +259,7 @@ export const deleteTestsets = async (ids: string[]) => { const results = await Promise.all( ids.map((id) => axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/${id}/archive`, + `${getAgentaApiUrl()}/simple/testsets/${id}/archive`, {}, {params: {project_id: projectId}}, ), @@ -289,7 +289,7 @@ export async function commitTestsetRevision( const {projectId} = getProjectValues() const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/commit?project_id=${projectId}`, + `${getAgentaApiUrl()}/testsets/revisions/commit?project_id=${projectId}`, { testset_revision_commit: { testset_id: testsetId, @@ -360,7 +360,7 @@ export async function patchTestsetRevision( const {projectId} = getProjectValues() const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/commit?project_id=${projectId}`, + `${getAgentaApiUrl()}/testsets/revisions/commit?project_id=${projectId}`, { testset_revision_commit: { testset_id: testsetId, @@ -405,7 +405,7 @@ export async function archiveTestsetRevision(revisionId: string) { const {projectId} = getProjectValues() const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/${revisionId}/archive?project_id=${projectId}`, + `${getAgentaApiUrl()}/testsets/revisions/${revisionId}/archive?project_id=${projectId}`, ) return response.data @@ -447,7 +447,7 @@ export async function downloadTestset( const {projectId} = getProjectValues() const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}/download`, + `${getAgentaApiUrl()}/simple/testsets/${testsetId}/download`, {}, { params: {project_id: projectId, file_type: fileType}, @@ -491,7 +491,7 @@ export async function downloadRevision( const {projectId} = getProjectValues() const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/${revisionId}/download`, + `${getAgentaApiUrl()}/testsets/revisions/${revisionId}/download`, {}, { params: {project_id: projectId, file_type: fileType, _t: Date.now()}, diff --git a/web/oss/src/services/tools/api/index.ts b/web/oss/src/services/tools/api/index.ts index 18c0fab46b..278ddf2a3c 100644 --- a/web/oss/src/services/tools/api/index.ts +++ b/web/oss/src/services/tools/api/index.ts @@ -20,7 +20,7 @@ import type { // - delete: DELETE data from server // - query: POST query with filters -const BASE = () => `${getAgentaApiUrl()}/preview/tools` +const BASE = () => `${getAgentaApiUrl()}/tools` // --- Catalog browse --- diff --git a/web/oss/src/services/tracing/api/index.ts b/web/oss/src/services/tracing/api/index.ts index ea4617e2f0..dfc8da6321 100644 --- a/web/oss/src/services/tracing/api/index.ts +++ b/web/oss/src/services/tracing/api/index.ts @@ -20,7 +20,7 @@ export const fetchAllPreviewTraces = async ( const applicationId = ensureAppId(appId) // New query endpoint expects POST with JSON body - const url = new URL(`${base}/preview/tracing/spans/query`) + const url = new URL(`${base}/tracing/spans/query`) if (projectId) url.searchParams.set("project_id", projectId) if (applicationId) url.searchParams.set("application_id", applicationId) @@ -52,7 +52,7 @@ export const fetchPreviewTrace = async (traceId: string) => { const base = getBaseUrl() const projectId = ensureProjectId() - const url = new URL(`${base}/preview/tracing/traces/${traceId}`) + const url = new URL(`${base}/tracing/traces/${traceId}`) if (projectId) url.searchParams.set("project_id", projectId) return fetchJson(url) @@ -62,7 +62,7 @@ export const deletePreviewTrace = async (traceId: string) => { const base = getBaseUrl() const projectId = ensureProjectId() - const url = new URL(`${base}/preview/tracing/traces/${traceId}`) + const url = new URL(`${base}/tracing/traces/${traceId}`) if (projectId) url.searchParams.set("project_id", projectId) return fetchJson(url, {method: "DELETE"}) @@ -138,7 +138,7 @@ export const fetchGenerationsDashboardData = async ( throw new DOMException("Aborted", "AbortError") } - const url = new URL(`${base}/preview/tracing/spans/analytics`) + const url = new URL(`${base}/tracing/spans/analytics`) if (projectId) url.searchParams.set("project_id", projectId) if (applicationId) url.searchParams.set("application_id", applicationId) diff --git a/web/oss/src/services/workflows/invoke.ts b/web/oss/src/services/workflows/invoke.ts index 855d57bf24..c3ee34e7f1 100644 --- a/web/oss/src/services/workflows/invoke.ts +++ b/web/oss/src/services/workflows/invoke.ts @@ -77,7 +77,7 @@ export const invokeEvaluator = async ({ const timeout = options?.timeout ?? DEFAULT_EVALUATOR_TIMEOUT const response = await axios.post( - `${getAgentaApiUrl()}/preview/workflows/invoke?project_id=${projectId}`, + `${getAgentaApiUrl()}/workflows/invoke?project_id=${projectId}`, request, { signal: options?.signal, diff --git a/web/oss/src/state/entities/testcase/api.ts b/web/oss/src/state/entities/testcase/api.ts index a5cb7abe97..2eed964263 100644 --- a/web/oss/src/state/entities/testcase/api.ts +++ b/web/oss/src/state/entities/testcase/api.ts @@ -14,7 +14,7 @@ export const fetchTestcase = async (params: { try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testcases/query`, + `${getAgentaApiUrl()}/testcases/query`, {testcase_ids: [testcaseId]}, {params: {project_id: projectId}}, ) diff --git a/web/oss/src/state/entities/testcase/paginatedStore.ts b/web/oss/src/state/entities/testcase/paginatedStore.ts index cff99c2eed..792ca4fcbc 100644 --- a/web/oss/src/state/entities/testcase/paginatedStore.ts +++ b/web/oss/src/state/entities/testcase/paginatedStore.ts @@ -229,7 +229,7 @@ async function fetchTestcasesPage({ } const response = await axios.post( - `${getAgentaApiUrl()}/preview/testcases/query`, + `${getAgentaApiUrl()}/testcases/query`, { testset_revision_id: meta.revisionId, windowing: windowingPayload, diff --git a/web/oss/src/state/entities/testcase/queries.ts b/web/oss/src/state/entities/testcase/queries.ts index 600b161342..61e97c3b58 100644 --- a/web/oss/src/state/entities/testcase/queries.ts +++ b/web/oss/src/state/entities/testcase/queries.ts @@ -152,7 +152,7 @@ export async function fetchTestcasesPage( cursor: string | null, ): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testcases/query`, + `${getAgentaApiUrl()}/testcases/query`, { testset_revision_id: revisionId, windowing: { diff --git a/web/oss/src/state/entities/testcase/testcaseEntity.ts b/web/oss/src/state/entities/testcase/testcaseEntity.ts index 98afa28292..de9efc0143 100644 --- a/web/oss/src/state/entities/testcase/testcaseEntity.ts +++ b/web/oss/src/state/entities/testcase/testcaseEntity.ts @@ -253,7 +253,7 @@ const testcaseBatchFetcher = createBatchFetcher< Array.from(byProject.entries()).map(async ([projectId, {ids, keys}]) => { try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testcases/query`, + `${getAgentaApiUrl()}/testcases/query`, {testcase_ids: ids}, {params: {project_id: projectId}}, ) diff --git a/web/oss/src/state/entities/testset/controller.ts b/web/oss/src/state/entities/testset/controller.ts index 0964fe6441..ce36d66f3f 100644 --- a/web/oss/src/state/entities/testset/controller.ts +++ b/web/oss/src/state/entities/testset/controller.ts @@ -144,7 +144,7 @@ export const revisionWithTestcasesQueryAtomFamily = atomFamily( try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_revision_refs: [{id: revisionId}], windowing: {limit: 1}, diff --git a/web/oss/src/state/entities/testset/paginatedStore.ts b/web/oss/src/state/entities/testset/paginatedStore.ts index 9aa3e89f3b..9df41acd53 100644 --- a/web/oss/src/state/entities/testset/paginatedStore.ts +++ b/web/oss/src/state/entities/testset/paginatedStore.ts @@ -196,7 +196,7 @@ async function fetchTestsetsPage({ try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/query`, + `${getAgentaApiUrl()}/testsets/query`, queryPayload, { params: {project_id: meta.projectId}, diff --git a/web/oss/src/state/entities/testset/revisionEntity.ts b/web/oss/src/state/entities/testset/revisionEntity.ts index 3367b06b90..265fee8f51 100644 --- a/web/oss/src/state/entities/testset/revisionEntity.ts +++ b/web/oss/src/state/entities/testset/revisionEntity.ts @@ -77,7 +77,7 @@ const revisionBatchFetcher = createBatchFetcher ({id})), windowing: {limit: validTestsetIds.length * 5, order: "descending"}, diff --git a/web/oss/src/state/entities/testset/store.ts b/web/oss/src/state/entities/testset/store.ts index 1aaf58ed5a..7a025cebdf 100644 --- a/web/oss/src/state/entities/testset/store.ts +++ b/web/oss/src/state/entities/testset/store.ts @@ -83,7 +83,7 @@ export interface VariantDetailParams { * Fetch a single revision by ID */ export async function fetchRevision({id, projectId}: RevisionDetailParams): Promise { - const response = await axios.get(`${getAgentaApiUrl()}/preview/testsets/revisions/${id}`, { + const response = await axios.get(`${getAgentaApiUrl()}/testsets/revisions/${id}`, { params: {project_id: projectId, include_testcases: false}, }) return revisionSchema.parse(response.data?.testset_revision ?? response.data) @@ -97,7 +97,7 @@ export async function fetchRevisionsList({ testsetId, }: RevisionListParams): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_refs: [{id: testsetId}], windowing: {limit: 100, order: "descending"}, @@ -132,7 +132,7 @@ export async function fetchTestsetsList({ } } - const response = await axios.post(`${getAgentaApiUrl()}/preview/testsets/query`, queryPayload, { + const response = await axios.post(`${getAgentaApiUrl()}/testsets/query`, queryPayload, { params: {project_id: projectId}, }) @@ -146,7 +146,7 @@ export async function fetchTestsetsList({ * Fetch a single testset by ID (metadata only) */ export async function fetchTestsetDetail({id, projectId}: TestsetDetailParams): Promise { - const response = await axios.get(`${getAgentaApiUrl()}/preview/testsets/${id}`, { + const response = await axios.get(`${getAgentaApiUrl()}/testsets/${id}`, { params: {project_id: projectId}, }) return testsetSchema.parse(response.data?.testset ?? response.data) @@ -156,7 +156,7 @@ export async function fetchTestsetDetail({id, projectId}: TestsetDetailParams): * Fetch a single variant by ID (contains name and description) */ export async function fetchVariantDetail({id, projectId}: VariantDetailParams): Promise { - const response = await axios.get(`${getAgentaApiUrl()}/preview/testsets/variants/${id}`, { + const response = await axios.get(`${getAgentaApiUrl()}/testsets/variants/${id}`, { params: {project_id: projectId}, }) return variantSchema.parse(response.data?.testset_variant ?? response.data) diff --git a/web/oss/src/state/evaluators/atoms.ts b/web/oss/src/state/evaluators/atoms.ts index 5c6b34c9e2..775d7f4a1d 100644 --- a/web/oss/src/state/evaluators/atoms.ts +++ b/web/oss/src/state/evaluators/atoms.ts @@ -156,7 +156,7 @@ export const evaluatorsQueryAtomFamily = atomFamily( : {} const response = await axios.post( - `/preview/simple/evaluators/query?project_id=${projectId}`, + `/simple/evaluators/query?project_id=${projectId}`, requestBody, ) let evaluators = (response?.data?.evaluators ?? []).map((item) => { @@ -219,7 +219,7 @@ export const evaluatorsQueryAtomFamily = atomFamily( try { const revisionResponse = await axios.post( - `/preview/evaluators/revisions/query?project_id=${projectId}`, + `/evaluators/revisions/query?project_id=${projectId}`, { evaluator_refs: revisionRefs, }, diff --git a/web/oss/tests/playwright/acceptance/testsset/index.ts b/web/oss/tests/playwright/acceptance/testsset/index.ts index b6cf95ac62..70a6050372 100644 --- a/web/oss/tests/playwright/acceptance/testsset/index.ts +++ b/web/oss/tests/playwright/acceptance/testsset/index.ts @@ -55,7 +55,7 @@ const testsetTests = () => { // 5. Fetch testset from API using preview endpoint const testsetResponse = await apiHelpers.waitForApiResponse<{testset: SimpleTestset}>({ - route: `/api/preview/simple/testsets/${testsetId}`, + route: `/api/simple/testsets/${testsetId}`, method: "GET", }) diff --git a/web/packages/agenta-entities/src/testcase/api/api.ts b/web/packages/agenta-entities/src/testcase/api/api.ts index 712f03ace4..c42fffd0b7 100644 --- a/web/packages/agenta-entities/src/testcase/api/api.ts +++ b/web/packages/agenta-entities/src/testcase/api/api.ts @@ -38,7 +38,7 @@ export async function fetchTestcase(params: TestcaseDetailParams): Promise { try { - const response = await axios.post(`${getAgentaApiUrl()}/preview/testcases/query`, query, { + const response = await axios.post(`${getAgentaApiUrl()}/testcases/query`, query, { params: {project_id: projectId}, }) diff --git a/web/packages/agenta-entities/src/testcase/state/store.ts b/web/packages/agenta-entities/src/testcase/state/store.ts index 883a71e031..3a4ca3143b 100644 --- a/web/packages/agenta-entities/src/testcase/state/store.ts +++ b/web/packages/agenta-entities/src/testcase/state/store.ts @@ -361,7 +361,7 @@ const testcaseBatchFetcher = createBatchFetcher< Array.from(byProject.entries()).map(async ([projectId, {ids, keys}]) => { try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testcases/query`, + `${getAgentaApiUrl()}/testcases/query`, {testcase_ids: ids}, {params: {project_id: projectId}}, ) diff --git a/web/packages/agenta-entities/src/testset/api/api.ts b/web/packages/agenta-entities/src/testset/api/api.ts index d98c9e1d07..480c7f5768 100644 --- a/web/packages/agenta-entities/src/testset/api/api.ts +++ b/web/packages/agenta-entities/src/testset/api/api.ts @@ -37,7 +37,7 @@ import type { * Fetch a single revision by ID */ export async function fetchRevision({id, projectId}: RevisionDetailParams): Promise { - const response = await axios.get(`${getAgentaApiUrl()}/preview/testsets/revisions/${id}`, { + const response = await axios.get(`${getAgentaApiUrl()}/testsets/revisions/${id}`, { params: {project_id: projectId, include_testcases: false}, }) const validated = safeParseWithLogging( @@ -59,7 +59,7 @@ export async function fetchRevisionWithTestcases({ projectId, }: RevisionDetailParams): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_revision_refs: [{id}], windowing: {limit: 1}, @@ -81,7 +81,7 @@ export async function fetchRevisionsList({ testsetId, }: RevisionListParams): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_refs: [{id: testsetId}], windowing: {limit: 100, order: "descending"}, @@ -108,7 +108,7 @@ export async function fetchLatestRevision({ testsetId, }: RevisionListParams): Promise { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_refs: [{id: testsetId}], windowing: {limit: 1, order: "descending"}, @@ -143,7 +143,7 @@ export async function fetchLatestRevisionsBatch( if (!projectId || testsetIds.length === 0) return results const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { // Use per-ref limit to get exactly 1 revision per testset testset_refs: testsetIds.map((id) => ({id, limit: 1})), @@ -189,7 +189,7 @@ export async function fetchRevisionsBatch( } const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, requestBody, {params: {project_id: projectId, include_testcases: false}}, ) @@ -232,7 +232,7 @@ export async function fetchTestsetsList({ } } - const response = await axios.post(`${getAgentaApiUrl()}/preview/testsets/query`, queryPayload, { + const response = await axios.post(`${getAgentaApiUrl()}/testsets/query`, queryPayload, { params: {project_id: projectId}, }) @@ -251,7 +251,7 @@ export async function fetchTestsetsList({ * Fetch a single testset by ID (metadata only) */ export async function fetchTestsetDetail({id, projectId}: TestsetDetailParams): Promise { - const response = await axios.get(`${getAgentaApiUrl()}/preview/testsets/${id}`, { + const response = await axios.get(`${getAgentaApiUrl()}/testsets/${id}`, { params: {project_id: projectId}, }) const validated = safeParseWithLogging( @@ -273,7 +273,7 @@ export async function fetchTestsetDetail({id, projectId}: TestsetDetailParams): * Fetch a single variant by ID (contains name and description) */ export async function fetchVariantDetail({id, projectId}: VariantDetailParams): Promise { - const response = await axios.get(`${getAgentaApiUrl()}/preview/testsets/variants/${id}`, { + const response = await axios.get(`${getAgentaApiUrl()}/testsets/variants/${id}`, { params: {project_id: projectId}, }) const validated = safeParseWithLogging( diff --git a/web/packages/agenta-entities/src/testset/api/mutations.ts b/web/packages/agenta-entities/src/testset/api/mutations.ts index d2fb916c29..eae259ee4c 100644 --- a/web/packages/agenta-entities/src/testset/api/mutations.ts +++ b/web/packages/agenta-entities/src/testset/api/mutations.ts @@ -36,7 +36,7 @@ export async function createTestset(params: { .replace(/[^a-z0-9_-]/g, "") const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/`, + `${getAgentaApiUrl()}/simple/testsets/`, { testset: { slug, @@ -76,7 +76,7 @@ export async function updateTestsetMetadata(params: { const {projectId, testsetId, name, description} = params const response = await axios.put( - `${getAgentaApiUrl()}/preview/testsets/${testsetId}`, + `${getAgentaApiUrl()}/testsets/${testsetId}`, { testset: { id: testsetId, @@ -102,7 +102,7 @@ export async function cloneTestset(params: { // Fetch the source testset const sourceResponse = await axios.get( - `${getAgentaApiUrl()}/preview/simple/testsets/${sourceTestsetId}`, + `${getAgentaApiUrl()}/simple/testsets/${sourceTestsetId}`, {params: {project_id: projectId}}, ) @@ -118,7 +118,7 @@ export async function cloneTestset(params: { .replace(/[^a-z0-9_-]/g, "") const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/`, + `${getAgentaApiUrl()}/simple/testsets/`, { testset: { slug, @@ -154,7 +154,7 @@ export async function archiveTestsets(params: {projectId: string; testsetIds: st const results = await Promise.all( testsetIds.map((id) => axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/${id}/archive`, + `${getAgentaApiUrl()}/simple/testsets/${id}/archive`, {}, {params: {project_id: projectId}}, ), @@ -188,7 +188,7 @@ export async function patchRevision(params: { const {projectId, testsetId, operations, message, baseRevisionId, name, description} = params const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/commit`, + `${getAgentaApiUrl()}/testsets/revisions/commit`, { testset_revision_commit: { testset_id: testsetId, @@ -234,7 +234,7 @@ export async function commitRevision(params: { const {projectId, testsetId, testcases, message} = params const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/commit`, + `${getAgentaApiUrl()}/testsets/revisions/commit`, { testset_revision_commit: { testset_id: testsetId, @@ -264,7 +264,7 @@ export async function archiveRevision(params: {projectId: string; revisionId: st validateUUID(revisionId, "revisionId") const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/${revisionId}/archive`, + `${getAgentaApiUrl()}/testsets/revisions/${revisionId}/archive`, {}, {params: {project_id: projectId}}, ) @@ -296,7 +296,7 @@ export async function uploadTestsetFile(params: { } const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/upload`, + `${getAgentaApiUrl()}/simple/testsets/upload`, formData, { params: {project_id: projectId}, @@ -328,7 +328,7 @@ export async function uploadRevisionFile(params: { } const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}/upload`, + `${getAgentaApiUrl()}/simple/testsets/${testsetId}/upload`, formData, { params: {project_id: projectId}, @@ -377,7 +377,7 @@ export async function downloadTestset(params: { const {projectId, testsetId, fileType = "csv", filename} = params const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}/download`, + `${getAgentaApiUrl()}/simple/testsets/${testsetId}/download`, {}, { params: {project_id: projectId, file_type: fileType}, @@ -411,7 +411,7 @@ export async function downloadRevision(params: { validateUUID(revisionId, "revisionId") const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/${revisionId}/download`, + `${getAgentaApiUrl()}/testsets/revisions/${revisionId}/download`, {}, { params: {project_id: projectId, file_type: fileType, _t: Date.now()}, @@ -435,7 +435,7 @@ export async function downloadRevision(params: { export async function fetchSimpleTestset(params: {projectId: string; testsetId: string}) { const {projectId, testsetId} = params - const response = await axios.get(`${getAgentaApiUrl()}/preview/simple/testsets/${testsetId}`, { + const response = await axios.get(`${getAgentaApiUrl()}/simple/testsets/${testsetId}`, { params: {project_id: projectId}, }) @@ -452,7 +452,7 @@ export async function queryPreviewTestsets(params: { const {projectId, payload = {}} = params const response = await axios.post( - `${getAgentaApiUrl()}/preview/simple/testsets/query`, + `${getAgentaApiUrl()}/simple/testsets/query`, payload, {params: {project_id: projectId}}, ) diff --git a/web/packages/agenta-entities/src/testset/state/paginatedStore.ts b/web/packages/agenta-entities/src/testset/state/paginatedStore.ts index b70f7110dd..71fcf88205 100644 --- a/web/packages/agenta-entities/src/testset/state/paginatedStore.ts +++ b/web/packages/agenta-entities/src/testset/state/paginatedStore.ts @@ -118,7 +118,7 @@ async function fetchTestsetsWindow( try { // Use POST to /preview/testsets/query with project_id as query param - let url = `${getAgentaApiUrl()}/preview/testsets/query?project_id=${projectId}` + let url = `${getAgentaApiUrl()}/testsets/query?project_id=${projectId}` // Add search term as query param if provided if (searchTerm) { diff --git a/web/packages/agenta-entities/src/testset/state/revisionMolecule.ts b/web/packages/agenta-entities/src/testset/state/revisionMolecule.ts index d2e89637bc..9777bddeca 100644 --- a/web/packages/agenta-entities/src/testset/state/revisionMolecule.ts +++ b/web/packages/agenta-entities/src/testset/state/revisionMolecule.ts @@ -179,7 +179,7 @@ const revisionWithTestcasesQueryAtomFamily = atomFamily((revisionId: string) => try { const response = await axios.post( - `${getAgentaApiUrl()}/preview/testsets/revisions/query`, + `${getAgentaApiUrl()}/testsets/revisions/query`, { testset_revision_refs: [{id: revisionId}], windowing: {limit: 1}, diff --git a/web/packages/agenta-entities/src/trace/api/api.ts b/web/packages/agenta-entities/src/trace/api/api.ts index 72f048d19c..4c3efba766 100644 --- a/web/packages/agenta-entities/src/trace/api/api.ts +++ b/web/packages/agenta-entities/src/trace/api/api.ts @@ -76,7 +76,7 @@ export async function fetchAllPreviewTraces( }) const response = await axios.post( - `${baseUrl}/preview/tracing/spans/query?${queryParams.toString()}`, + `${baseUrl}/tracing/spans/query?${queryParams.toString()}`, payload, ) @@ -107,7 +107,7 @@ export async function fetchPreviewTrace( if (projectId) queryParams.set("project_id", projectId) const response = await axios.get( - `${baseUrl}/preview/tracing/traces/${traceId}?${queryParams.toString()}`, + `${baseUrl}/tracing/traces/${traceId}?${queryParams.toString()}`, ) // API returns TracesResponse format with count and traces record @@ -128,7 +128,7 @@ export async function deletePreviewTrace(traceId: string, projectId: string): Pr if (projectId) queryParams.set("project_id", projectId) const response = await axios.delete( - `${baseUrl}/preview/tracing/traces/${traceId}?${queryParams.toString()}`, + `${baseUrl}/tracing/traces/${traceId}?${queryParams.toString()}`, ) return response.data diff --git a/web/tests/tests/fixtures/base.fixture/apiHelpers/index.ts b/web/tests/tests/fixtures/base.fixture/apiHelpers/index.ts index 513801b693..0f38329af7 100644 --- a/web/tests/tests/fixtures/base.fixture/apiHelpers/index.ts +++ b/web/tests/tests/fixtures/base.fixture/apiHelpers/index.ts @@ -85,7 +85,7 @@ export const getApp = async (page: Page, type: APP_TYPE = "completion") => { export const getTestsets = async (page: Page) => { // 2. Fetch testsets from API using preview endpoint const testsetsResponse = await waitForApiResponse<{testsets: testset[]}>(page, { - route: "/api/preview/testsets/query", + route: "/api/testsets/query", method: "POST", }) const response = await testsetsResponse @@ -130,7 +130,7 @@ export const getEvaluationRuns = async (page: Page) => { runs: SnakeToCamelCaseKeys[] count: number }>(page, { - route: `/api/preview/evaluations/runs/query`, + route: `/api/evaluations/runs/query`, method: "POST", }) From 6fe4f1c99761000abf58c7390b5ecf5e494e0fba Mon Sep 17 00:00:00 2001 From: jangjohn Date: Fri, 6 Mar 2026 11:33:32 +0900 Subject: [PATCH 2/3] fix: update stale comments referencing /preview/ paths --- web/oss/src/components/TestcasesTableNew/atoms/tableStore.ts | 2 +- web/oss/src/components/TestcasesTableNew/hooks/api.ts | 2 +- .../components/TestsetsTable/atoms/fetchTestsetRevisions.ts | 2 +- web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts | 4 ++-- web/oss/src/lib/hooks/usePreviewEvaluations/index.ts | 2 +- web/oss/src/services/evaluationRuns/api/index.ts | 2 +- web/oss/src/services/testsets/api/index.ts | 2 +- web/oss/src/state/entities/testcase/schema.ts | 2 +- web/oss/src/state/entities/testset/paginatedStore.ts | 4 ++-- web/oss/src/state/entities/testset/revisionSchema.ts | 2 +- web/oss/src/state/entities/trace/store.ts | 2 +- web/packages/agenta-entities/src/testcase/core/schema.ts | 2 +- web/packages/agenta-entities/src/testset/core/schema.ts | 2 +- .../agenta-entities/src/testset/state/paginatedStore.ts | 4 ++-- web/packages/agenta-entities/src/trace/state/store.ts | 2 +- 15 files changed, 18 insertions(+), 18 deletions(-) diff --git a/web/oss/src/components/TestcasesTableNew/atoms/tableStore.ts b/web/oss/src/components/TestcasesTableNew/atoms/tableStore.ts index db160caf32..bbadfbf9a1 100644 --- a/web/oss/src/components/TestcasesTableNew/atoms/tableStore.ts +++ b/web/oss/src/components/TestcasesTableNew/atoms/tableStore.ts @@ -109,7 +109,7 @@ export const testcasesRefreshTriggerAtom = testcase.paginated.refreshAtom export type {TestcasePaginatedMeta as TestcaseTableMeta, TestcaseTableRow} /** - * API response from /preview/testsets/{testset_id} + * API response from /testsets/{testset_id} */ export interface TestcaseRevisionResponse { id: string // revision ID diff --git a/web/oss/src/components/TestcasesTableNew/hooks/api.ts b/web/oss/src/components/TestcasesTableNew/hooks/api.ts index 4f561a096f..7ecded0fc9 100644 --- a/web/oss/src/components/TestcasesTableNew/hooks/api.ts +++ b/web/oss/src/components/TestcasesTableNew/hooks/api.ts @@ -19,7 +19,7 @@ export async function fetchRevision(projectId: string, revisionId: string) { } /** - * Fetch paginated testcases using /preview/testcases/query endpoint + * Fetch paginated testcases using /testcases/query endpoint * Uses testset_revision_id to fetch testcases for a specific revision */ export async function fetchTestcasesPage( diff --git a/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts b/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts index 2e9cdc3ea7..c50cce161d 100644 --- a/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts +++ b/web/oss/src/components/TestsetsTable/atoms/fetchTestsetRevisions.ts @@ -19,7 +19,7 @@ import {getAgentaApiUrl} from "@/oss/lib/helpers/api" import {getProjectValues} from "@/oss/state/project" /** - * Testset revision from /preview/testsets/revisions/query + * Testset revision from /testsets/revisions/query * * Note: We skip the variant layer entirely. The frontend works directly with * testsets and their revisions (2-level hierarchy instead of 3-level). diff --git a/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts b/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts index 4d21ca3868..b7e1265c83 100644 --- a/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts +++ b/web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts @@ -31,7 +31,7 @@ interface FetchTestsetsWindowParams { } /** - * Fetch testsets with server-side pagination via POST /preview/testsets/query + * Fetch testsets with server-side pagination via POST /testsets/query * Uses the lighter endpoint that returns metadata only (no testcases) */ export const fetchTestsetsWindow = async ({ @@ -82,7 +82,7 @@ export const fetchTestsetsWindow = async ({ } try { - // Use /preview/testsets/query - returns Testset metadata without testcases + // Use /testsets/query - returns Testset metadata without testcases const response = await axios.post( `${getAgentaApiUrl()}/testsets/query`, queryPayload, diff --git a/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts b/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts index d49462cb2e..835a22fc3c 100644 --- a/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts +++ b/web/oss/src/lib/hooks/usePreviewEvaluations/index.ts @@ -362,7 +362,7 @@ const usePreviewEvaluations = ({ const allTestcases: PreviewTestcase[] = [] let cursor: string | null = null - // Paginate through /preview/testcases/query until no more pages + // Paginate through /testcases/query until no more pages do { const response = await axios.post( "/testcases/query", diff --git a/web/oss/src/services/evaluationRuns/api/index.ts b/web/oss/src/services/evaluationRuns/api/index.ts index 350887acd4..096ac6e3d2 100644 --- a/web/oss/src/services/evaluationRuns/api/index.ts +++ b/web/oss/src/services/evaluationRuns/api/index.ts @@ -289,7 +289,7 @@ const buildMappings = ( * Builds the payload required for submitting multiple evaluation runs to the backend. * Each revision will be wrapped in its own run configuration. * This function returns an object with a `runs` array that can be sent to - * the POST `/preview/evaluations/runs/` endpoint. + * the POST `/evaluations/runs/` endpoint. * * @param name - Base name used in each run * @param testset - The testset being used in this evaluation (must include variantId & revisionId). diff --git a/web/oss/src/services/testsets/api/index.ts b/web/oss/src/services/testsets/api/index.ts index b49bed403a..2096a96ad1 100644 --- a/web/oss/src/services/testsets/api/index.ts +++ b/web/oss/src/services/testsets/api/index.ts @@ -38,7 +38,7 @@ export async function createNewTestset( const baseSlug = testsetName.toLowerCase().replace(/\s+/g, "_") - // Use /preview/simple/testsets endpoint - creates testset, variant, and revision in one call + // Use /simple/testsets endpoint - creates testset, variant, and revision in one call const response = await axios.post( `${getAgentaApiUrl()}/simple/testsets/?project_id=${projectId}`, { diff --git a/web/oss/src/state/entities/testcase/schema.ts b/web/oss/src/state/entities/testcase/schema.ts index c49e90e913..bc7a3faaa5 100644 --- a/web/oss/src/state/entities/testcase/schema.ts +++ b/web/oss/src/state/entities/testcase/schema.ts @@ -2,7 +2,7 @@ import {z} from "zod" /** * Zod schema for testcase entity based on backend API - * Endpoint: POST /preview/testcases/query + * Endpoint: POST /testcases/query * Response: TestcasesResponse { count, testcases: Testcase[] } * * Backend structure (Python): diff --git a/web/oss/src/state/entities/testset/paginatedStore.ts b/web/oss/src/state/entities/testset/paginatedStore.ts index 9df41acd53..4d64baf511 100644 --- a/web/oss/src/state/entities/testset/paginatedStore.ts +++ b/web/oss/src/state/entities/testset/paginatedStore.ts @@ -41,7 +41,7 @@ import {createPaginatedEntityStore} from "../shared" // ============================================================================ /** - * API response row from /preview/testsets/query + * API response row from /testsets/query */ export interface TestsetApiRow { id: string @@ -139,7 +139,7 @@ interface QueryWindowingPayload { } /** - * Fetch testsets with server-side pagination via POST /preview/testsets/query + * Fetch testsets with server-side pagination via POST /testsets/query */ async function fetchTestsetsPage({ meta, diff --git a/web/oss/src/state/entities/testset/revisionSchema.ts b/web/oss/src/state/entities/testset/revisionSchema.ts index 55219e65bd..810973551d 100644 --- a/web/oss/src/state/entities/testset/revisionSchema.ts +++ b/web/oss/src/state/entities/testset/revisionSchema.ts @@ -2,7 +2,7 @@ import {z} from "zod" /** * Zod schema for testset revision entity based on backend API - * Endpoint: POST /preview/testsets/revisions/query + * Endpoint: POST /testsets/revisions/query * Response: { testset_revisions: TestsetRevision[] } * * Revisions are immutable snapshots of testset data. diff --git a/web/oss/src/state/entities/trace/store.ts b/web/oss/src/state/entities/trace/store.ts index 58053bb417..a1b918881d 100644 --- a/web/oss/src/state/entities/trace/store.ts +++ b/web/oss/src/state/entities/trace/store.ts @@ -167,7 +167,7 @@ interface TracesApiResponse { /** * Batch fetcher that combines concurrent trace requests into a single API call - * Uses the /preview/tracing/spans/query endpoint with trace_id IN filter + * Uses the /tracing/spans/query endpoint with trace_id IN filter * Same pattern as evaluationTraceBatcherFamily in EvalRunDetails */ const traceBatchFetcher = createBatchFetcher< diff --git a/web/packages/agenta-entities/src/testcase/core/schema.ts b/web/packages/agenta-entities/src/testcase/core/schema.ts index 7d38a54dee..8494d748e0 100644 --- a/web/packages/agenta-entities/src/testcase/core/schema.ts +++ b/web/packages/agenta-entities/src/testcase/core/schema.ts @@ -137,7 +137,7 @@ export const windowingSchema = z.object({ }) /** - * Query request schema for POST /preview/testcases/query + * Query request schema for POST /testcases/query */ export const testcasesQueryRequestSchema = z.object({ testcase_ids: z.array(z.string()).optional(), diff --git a/web/packages/agenta-entities/src/testset/core/schema.ts b/web/packages/agenta-entities/src/testset/core/schema.ts index ce29a397a6..fd838c7b3d 100644 --- a/web/packages/agenta-entities/src/testset/core/schema.ts +++ b/web/packages/agenta-entities/src/testset/core/schema.ts @@ -37,7 +37,7 @@ import { /** * Complete revision schema matching backend API - * Endpoint: POST /preview/testsets/revisions/query + * Endpoint: POST /testsets/revisions/query * * Revisions are immutable snapshots of testset data. */ diff --git a/web/packages/agenta-entities/src/testset/state/paginatedStore.ts b/web/packages/agenta-entities/src/testset/state/paginatedStore.ts index 71fcf88205..bc75024702 100644 --- a/web/packages/agenta-entities/src/testset/state/paginatedStore.ts +++ b/web/packages/agenta-entities/src/testset/state/paginatedStore.ts @@ -76,7 +76,7 @@ interface FetchTestsetsWindowResponse { } /** - * Fetch testsets window from API using the preview/testsets/query endpoint + * Fetch testsets window from API using the testsets/query endpoint */ async function fetchTestsetsWindow( params: FetchTestsetsWindowParams, @@ -117,7 +117,7 @@ async function fetchTestsetsWindow( } try { - // Use POST to /preview/testsets/query with project_id as query param + // Use POST to /testsets/query with project_id as query param let url = `${getAgentaApiUrl()}/testsets/query?project_id=${projectId}` // Add search term as query param if provided diff --git a/web/packages/agenta-entities/src/trace/state/store.ts b/web/packages/agenta-entities/src/trace/state/store.ts index f0b55e023c..8273bd5e20 100644 --- a/web/packages/agenta-entities/src/trace/state/store.ts +++ b/web/packages/agenta-entities/src/trace/state/store.ts @@ -150,7 +150,7 @@ const spanBatchFetcher = createBatchFetcher< /** * Batch fetcher that combines concurrent trace requests into a single API call - * Uses the /preview/tracing/spans/query endpoint with trace_id IN filter + * Uses the /tracing/spans/query endpoint with trace_id IN filter */ const traceBatchFetcher = createBatchFetcher< TraceRequest, From 443b1f058878002b612596eac851ffab2c82aa71 Mon Sep 17 00:00:00 2001 From: jangjohn Date: Sun, 15 Mar 2026 14:11:51 +0900 Subject: [PATCH 3/3] fix: prettier formatting for mutations.ts --- .../src/testset/api/mutations.ts | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/web/packages/agenta-entities/src/testset/api/mutations.ts b/web/packages/agenta-entities/src/testset/api/mutations.ts index eae259ee4c..cf116abd69 100644 --- a/web/packages/agenta-entities/src/testset/api/mutations.ts +++ b/web/packages/agenta-entities/src/testset/api/mutations.ts @@ -295,14 +295,10 @@ export async function uploadTestsetFile(params: { formData.append("testset_name", testsetName) } - const response = await axios.post( - `${getAgentaApiUrl()}/simple/testsets/upload`, - formData, - { - params: {project_id: projectId}, - headers: {"Content-Type": "multipart/form-data"}, - }, - ) + const response = await axios.post(`${getAgentaApiUrl()}/simple/testsets/upload`, formData, { + params: {project_id: projectId}, + headers: {"Content-Type": "multipart/form-data"}, + }) return response.data } @@ -451,11 +447,9 @@ export async function queryPreviewTestsets(params: { }) { const {projectId, payload = {}} = params - const response = await axios.post( - `${getAgentaApiUrl()}/simple/testsets/query`, - payload, - {params: {project_id: projectId}}, - ) + const response = await axios.post(`${getAgentaApiUrl()}/simple/testsets/query`, payload, { + params: {project_id: projectId}, + }) return response.data }