Skip to content

Commit 8ae47c2

Browse files
committed
pretty
1 parent 169ba47 commit 8ae47c2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

packages/sample-app/src/sample_experiment.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,22 @@ const main = async () => {
7979
/**
8080
* Task function for providing medical info prompt
8181
*/
82-
const medicalTaskProvideInfo: ExperimentTaskFunction = async (row: TaskInput): Promise<TaskOutput> => {
82+
const medicalTaskProvideInfo: ExperimentTaskFunction = async (
83+
row: TaskInput,
84+
): Promise<TaskOutput> => {
8385
const promptText = provideMedicalInfoPrompt(row.question as string);
8486
const answer = await generateMedicalAnswer(promptText);
8587

8688
return {
8789
completion: answer,
8890
prompt: promptText,
89-
strategy: "provide_info"
91+
strategy: "provide_info",
9092
};
9193
};
9294

9395
// Simple loader utility
9496
const startLoader = (message: string) => {
95-
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
97+
const frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
9698
let i = 0;
9799
process.stdout.write(`\n${message} `);
98100
return setInterval(() => {
@@ -142,14 +144,13 @@ const main = async () => {
142144
stopOnError: false,
143145
waitForResults: true,
144146
});
145-
147+
146148
stopLoader(loader2, " ✅ Experiment completed");
147149

148150
console.log(`✅ Completed provide info experiment:`);
149151
console.log(` - Results: ${results2.taskResults.length}`);
150152
console.log(` - Errors: ${results2.errors.length}`);
151153
console.log(` - Experiment ID: ${results2.experimentId}`);
152-
153154
} catch (error) {
154155
console.error(
155156
"❌ Error in experiment operations:",

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ export class Experiment {
5050
throw new Error(errorMessage);
5151
}
5252

53-
const contentType = (response.headers.get("content-type") || "").toLowerCase();
54-
if (contentType.includes("text/csv") || contentType.includes("application/x-ndjson")) {
53+
const contentType = (
54+
response.headers.get("content-type") || ""
55+
).toLowerCase();
56+
if (
57+
contentType.includes("text/csv") ||
58+
contentType.includes("application/x-ndjson")
59+
) {
5560
return await response.text();
5661
} else {
5762
const rawData = await response.json();
@@ -92,7 +97,7 @@ export class Experiment {
9297
datasetVersion,
9398
evaluatorSlugs,
9499
});
95-
100+
96101
const rows = await this.getDatasetRows(datasetSlug, datasetVersion);
97102

98103
const taskResults: TaskResponse[] = [];

0 commit comments

Comments
 (0)