Skip to content

Commit

Permalink
[ez] Minor code sample updates (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
saqadri authored Dec 24, 2024
2 parents d4cc9aa + 065ff86 commit bb6450c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions website/docs/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ const client = new AutoEval({
});

// Lastmile client (REST API wrappers)
const client2 = new Lastmile({
const restClient = new Lastmile({
bearerToken: "api_token_if_LASTMILE_API_TOKEN_not_set",
})
});
```

</TabItem>
Expand Down
8 changes: 4 additions & 4 deletions website/docs/autoeval/datasets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ print(dataset_id)
import { AutoEval } from "lastmile/lib/auto_eval";

const client = new AutoEval({ apiKey: "api_token_if_LASTMILE_API_TOKEN_not_set" });
const datasetCSV = "path_to_dataset.csv"
const datasetCSV = "path_to_dataset.csv";
const datasetId = await client.uploadDataset({
filePath: datasetCSV,
name: "My New Dataset",
description: "This Dataset is the latest batch of application trace data"
})
});

console.log(datasetId)
console.log(datasetId);
```

</TabItem>
Expand Down Expand Up @@ -115,7 +115,7 @@ const data = await client.downloadDataset(
/*outputFilePath*/ "optional_path_to_save_file"
);

console.table(data)
console.table(data);
```

</TabItem>
Expand Down
18 changes: 9 additions & 9 deletions website/docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ print(f'Evlauation result:', result)`,
{
language: "javascript",
label: "node.js",
code: `import { AutoEval, Metric, BuiltinMetrics } from "lastmile/lib/auto_eval";;
code: `import { AutoEval, Metric, BuiltinMetrics } from "lastmile/lib/auto_eval";
const client = new AutoEval();
const result = await client.evaluateData(
/*data*/ [
{
input: "Where did the author grow up?",
output: "France",
ground_truth: "England",
},
],
/*metrics*/ [BuiltinMetrics.FAITHFULNESS]
/*data*/ [
{
input: "Where did the author grow up?",
output: "France",
ground_truth: "England",
},
],
/*metrics*/ [BuiltinMetrics.FAITHFULNESS]
);
console.table(result);
Expand Down
16 changes: 8 additions & 8 deletions website/docs/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ const expectedResponse = "England"
const llmResponse = "France"

const result = await client.evaluateData(
/*data*/ [
{
input: query,
output: llmResponse,
ground_truth: expectedResponse,
},
],
/*metrics*/ [BuiltinMetrics.FAITHFULNESS]
/*data*/ [
{
input: query,
output: llmResponse,
ground_truth: expectedResponse,
},
],
/*metrics*/ [BuiltinMetrics.FAITHFULNESS]
);

console.table(result);
Expand Down

0 comments on commit bb6450c

Please sign in to comment.