Skip to content

Commit 20d23b9

Browse files
Nina KollmanNina Kollman
authored andcommitted
git push
1 parent b1b12a1 commit 20d23b9

File tree

5 files changed

+3
-185
lines changed

5 files changed

+3
-185
lines changed

packages/sample-app/src/simple_experiment_test.ts

Lines changed: 0 additions & 115 deletions
This file was deleted.

packages/traceloop-sdk/src/lib/client/evaluator/evaluator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { TraceloopClient } from "../traceloop-client";
22
import { BaseDatasetEntity } from "../dataset/base-dataset";
3-
import { SSEClient } from "../stream/sse-client";
43
import type {
54
EvaluatorRunOptions,
65
TriggerEvaluatorRequest,

packages/traceloop-sdk/src/lib/client/experiment/experiment.ts

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ export class Experiment {
139139
}
140140
}
141141

142-
// 5. Return comprehensive results
143142
return {
144143
results: taskResults,
145144
errors: taskErrors,
@@ -232,41 +231,6 @@ export class Experiment {
232231
return rows;
233232
}
234233

235-
/**
236-
* Parse JSONL format data into array of objects
237-
* Equivalent to Python's _parse_jsonl_to_rows method
238-
*/
239-
static parseJsonlToRows(jsonlData: string): Record<string, any>[] {
240-
if (!jsonlData || jsonlData.trim() === '') {
241-
return [];
242-
}
243-
244-
const lines = jsonlData.trim().split('\n');
245-
const results: Record<string, any>[] = [];
246-
247-
for (let i = 0; i < lines.length; i++) {
248-
const line = lines[i].trim();
249-
250-
// Skip empty lines
251-
if (line === '') {
252-
continue;
253-
}
254-
255-
try {
256-
const parsed = JSON.parse(line);
257-
258-
// Only add non-null objects
259-
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
260-
results.push(parsed);
261-
}
262-
} catch (error) {
263-
// Log parsing errors but continue processing
264-
console.warn(`Skipping invalid JSON line ${i + 1}: ${line}`, error);
265-
}
266-
}
267-
268-
return results;
269-
}
270234

271235
/**
272236
* Get dataset rows for experiment execution
@@ -312,34 +276,4 @@ export class Experiment {
312276
}
313277
}
314278

315-
/**
316-
* Get experiment results
317-
*/
318-
async getExperimentResults(experimentId: string, runId?: string): Promise<TaskResponse[]> {
319-
if (!experimentId) {
320-
throw new Error('Experiment ID is required');
321-
}
322-
323-
let url = `/v2/experiments/${experimentId}/results`;
324-
if (runId) {
325-
url += `?run_id=${encodeURIComponent(runId)}`;
326-
}
327-
328-
const response = await this.client.get(url);
329-
const data = await this.handleResponse(response);
330-
331-
if (!data.results || !Array.isArray(data.results)) {
332-
return [];
333-
}
334-
335-
return data.results.map((result: any) => ({
336-
input: result.input,
337-
output: result.output,
338-
evaluations: result.evaluations,
339-
error: result.error,
340-
metadata: result.metadata,
341-
timestamp: result.timestamp
342-
}));
343-
}
344-
345-
}
279+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { SSEClient } from "./sse-client";
1+
export { SSEClient } from "./sse-client";

packages/traceloop-sdk/src/lib/interfaces/experiment.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ export interface CreateTaskRequest {
8484

8585
export interface CreateTaskResponse {
8686
id: string;
87-
}
87+
}

0 commit comments

Comments
 (0)