Skip to content

Commit e60488d

Browse files
address review comments
1 parent fe88a8b commit e60488d

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/agentevals/api/streaming_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ async def prepare_evaluation(request: PrepareEvaluationRequest):
280280
})
281281

282282
return StandardResponse(data=PrepareEvaluationData(
283-
eval_set_url=f"http://localhost:8001/api/streaming/download/{os.path.basename(eval_set_file)}",
283+
eval_set_url=f"/api/streaming/download/{os.path.basename(eval_set_file)}",
284284
trace_urls=[
285-
f"http://localhost:8001/api/streaming/download/{os.path.basename(tf['file_path'])}"
285+
f"/api/streaming/download/{os.path.basename(tf['file_path'])}"
286286
for tf in trace_files
287287
],
288288
num_traces=len(trace_files),

ui/src/api/client.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RunResult, EvalConfig, TraceResult, StandardResponse } from '../lib/types';
1+
import type { RunResult, EvalConfig, TraceResult, MetricMetadata, StandardResponse } from '../lib/types';
22
import { config } from '../config';
33

44
const API_BASE_URL = `${config.api.baseUrl}/api`;
@@ -150,22 +150,22 @@ export async function evaluateTracesStreaming(
150150
}
151151
}
152152

153-
export async function listMetrics() {
153+
export async function listMetrics(): Promise<MetricMetadata[]> {
154154
try {
155155
const response = await fetch(`${API_BASE_URL}/metrics`);
156156

157157
if (!response.ok) {
158158
throw new Error(`Failed to fetch metrics: ${response.statusText}`);
159159
}
160160

161-
return unwrap(response);
161+
return unwrap<MetricMetadata[]>(response);
162162
} catch (error) {
163163
console.error('Failed to list metrics:', error);
164164
throw error;
165165
}
166166
}
167167

168-
export async function validateEvalSet(evalSetFile: File) {
168+
export async function validateEvalSet(evalSetFile: File): Promise<{ valid: boolean; evalSetId?: string; numCases?: number; errors?: string[] }> {
169169
const formData = new FormData();
170170
formData.append('eval_set_file', evalSetFile);
171171

@@ -179,7 +179,7 @@ export async function validateEvalSet(evalSetFile: File) {
179179
throw new Error(`Failed to validate eval set: ${response.statusText}`);
180180
}
181181

182-
return unwrap(response);
182+
return unwrap<{ valid: boolean; evalSetId?: string; numCases?: number; errors?: string[] }>(response);
183183
} catch (error) {
184184
console.error('Failed to validate eval set:', error);
185185
throw error;
@@ -247,18 +247,18 @@ export async function loadBugReport(
247247
throw new Error(errorMessage);
248248
}
249249

250-
return unwrap(response);
250+
return unwrap<{ loadedSessions: string[]; count: number }>(response);
251251
}
252252

253-
export async function healthCheck() {
253+
export async function healthCheck(): Promise<{ status: string; version: string }> {
254254
try {
255255
const response = await fetch(`${API_BASE_URL}/health`);
256256

257257
if (!response.ok) {
258258
throw new Error(`Health check failed: ${response.statusText}`);
259259
}
260260

261-
return unwrap(response);
261+
return unwrap<{ status: string; version: string }>(response);
262262
} catch (error) {
263263
console.error('Health check failed:', error);
264264
throw error;

0 commit comments

Comments
 (0)