Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 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,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
Expand All @@ -28,7 +28,7 @@ export async function fetchTestcasesPage(
cursor: string | null,
): Promise<TestcasesPage> {
const response = await axios.post(
`${getAgentaApiUrl()}/preview/testcases/query`,
`${getAgentaApiUrl()}/testcases/query`,
{
testset_revision_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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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},
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
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
8 changes: 4 additions & 4 deletions web/oss/src/lib/hooks/usePreviewEvaluations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
)

Expand Down Expand Up @@ -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) => {
Expand Down
Loading
Loading