Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const testWithHumanFixtures = baseTest.extend<HumanEvaluationFixtures>({
runs: SnakeToCamelCaseKeys<EvaluationRun>[]
count: number
}>(page, {
route: `/api/preview/evaluations/runs/query`,
route: `/api/evaluations/runs/query`,
method: "POST",
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
})
Expand Down
2 changes: 1 addition & 1 deletion web/oss/src/components/EvalRunDetails/atoms/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions web/oss/src/components/EvalRunDetails/atoms/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion web/oss/src/components/EvalRunDetails/atoms/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion web/oss/src/components/EvalRunDetails/atoms/references.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
)
Expand Down
4 changes: 2 additions & 2 deletions web/oss/src/components/EvalRunDetails/atoms/runMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const runMetricsBatchFetcher = createBatchFetcher<RunMetricsBatchRequest, any[]>
},
}

const response = await axios.post(`/preview/evaluations/metrics/query`, basePayload, {
const response = await axios.post(`/evaluations/metrics/query`, basePayload, {
params: {project_id: entry.projectId},
})

Expand All @@ -544,7 +544,7 @@ const runMetricsBatchFetcher = createBatchFetcher<RunMetricsBatchRequest, any[]>
if (entry.needsTemporal) {
try {
const temporalResponse = await axios.post(
`/preview/evaluations/metrics/query`,
`/evaluations/metrics/query`,
{
...basePayload,
metrics: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const evaluatorFetchBatcher = createBatchFetcher<EvaluatorFetchRequest, Evaluato
payload.evaluator = {flags}
}

const response = await axios.post(`/preview/simple/evaluators/query`, payload, {
const response = await axios.post(`/simple/evaluators/query`, payload, {
params: {project_id: projectId},
})
const rawEvaluators = Array.isArray(response?.data?.evaluators)
Expand Down
4 changes: 2 additions & 2 deletions web/oss/src/components/EvalRunDetails/atoms/table/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const ensureEvaluatorRevisions = async ({

try {
const response = await axios.post(
`/preview/evaluators/revisions/retrieve`,
`/evaluators/revisions/retrieve`,
payload,
{
params: {project_id: projectId},
Expand Down Expand Up @@ -268,7 +268,7 @@ const ensureEvaluatorRevisions = async ({
})
}
await axios.patch(
`/preview/evaluations/runs/${encodeURIComponent(runId)}`,
`/evaluations/runs/${encodeURIComponent(runId)}`,
{run: patchedRun},
{
params: {project_id: projectId},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const fetchEvaluationScenarioWindow = async ({
}

const response = await axios.post<ScenariosResponse>(
`/preview/evaluations/scenarios/query`,
`/evaluations/scenarios/query`,
payload,
{
params: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
})
Expand Down
6 changes: 3 additions & 3 deletions web/oss/src/components/References/atoms/entityReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async function fetchRevisionsForCascader(
testsetId: string,
): Promise<RevisionListItem[]> {
const response = await axios.post(
`${getAgentaApiUrl()}/preview/testsets/revisions/query`,
`${getAgentaApiUrl()}/testsets/revisions/query`,
{
testset_refs: [{id: testsetId}],
windowing: {limit: 100, order: "descending"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions web/oss/src/components/TestcasesTableNew/hooks/api.ts
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ 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
}

/**
* Fetch paginated testcases using /preview/testcases/query endpoint
* Uses testset_revision_ref.id to fetch testcases for a specific revision
* Fetch paginated testcases using /testcases/query endpoint
* Uses testset_revision_id to fetch testcases for a specific revision
*/
export async function fetchTestcasesPage(
projectId: string,
revisionId: string,
cursor: string | null,
): Promise<TestcasesPage> {
const response = await axios.post(
`${getAgentaApiUrl()}/preview/testcases/query`,
`${getAgentaApiUrl()}/testcases/query`,
{
testset_revision_ref: {id: revisionId},
windowing: {
Expand Down Expand Up @@ -58,7 +58,7 @@ export async function fetchTestcasesPage(
*/
export async function fetchTestsetName(projectId: string, testsetId: string): Promise<string> {
const response = await axios.post(
`${getAgentaApiUrl()}/preview/testsets/query`,
`${getAgentaApiUrl()}/testsets/query`,
{
testset_refs: [{id: testsetId}],
windowing: {limit: 1},
Expand All @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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: {
Expand Down
6 changes: 3 additions & 3 deletions web/oss/src/components/TestsetsTable/atoms/fetchTestsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ({
Expand Down Expand Up @@ -82,9 +82,9 @@ 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()}/preview/testsets/query`,
`${getAgentaApiUrl()}/testsets/query`,
queryPayload,
{
params: {project_id: projectId},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ const CreateTestsetFromApi: React.FC<Props> = ({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": {
Expand Down
2 changes: 1 addition & 1 deletion web/oss/src/lib/hooks/useAnnotations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const getPreviewRunBatcherCore = () => {
}

const response = await axios.post(
`/preview/evaluations/runs/query`,
`/evaluations/runs/query`,
payload,
{
params: {project_id: projectId},
Expand Down
Loading