Skip to content

Commit 87f48ed

Browse files
committed
Add example downloading feedback an druns from test project (#117)
1 parent 410a7c6 commit 87f48ed

File tree

4 files changed

+387
-2
lines changed

4 files changed

+387
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Test and benchmark your LLM systems using methods in these evaluation recipes:
4242
- [Unit Testing with Pytest](./testing-examples/pytest-ut/): write individual unit tests and log assertions as feedback.
4343
- [Evaluating Existing Runs](./testing-examples/evaluate-existing-test-project/evaluate_runs.ipynb): add ai-assisted feedback and evaluation metrics to existing run traces.
4444
- [Naming Test Projects](./testing-examples/naming-test-projects/naming-test-projects.md): manually name your tests with `run_on_dataset(..., project_name='my-project-name')`
45+
- [How to download feedback and examples from a test project](./testing-examples/download-feedback-and-examples/download_example.ipynb): export the predictions, evaluation results, and other information to programmatically add to your reports.
4546

4647

4748
### TypeScript / JavaScript Testing Examples

feedback-examples/nextjs/app/api/trace/route.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ const langsmithClient = new Client();
1010
* This handler retrieves a LangSmith trace URL for the given run.
1111
* It isn't used by default, but if you'd like to turn it on, set
1212
* "showTraceUrls" to true in app/page.tsx.
13-
*/
13+
* Note that currently (2023/08/18) this will raise an error if the
14+
* run is still waiting to be committed to the database.
15+
* @param {NextRequest} req
16+
* @returns {Promise<NextResponse>}
17+
**/
1418
export async function GET(req: NextRequest) {
1519
try {
1620
const runId = req.nextUrl.searchParams.get("run_id");
1721
if (!runId) {
1822
return NextResponse.json(
1923
{ error: "You must provide a run id." },
20-
{ status: 400 },
24+
{ status: 400 }
2125
);
2226
}
2327
const traceUrl = await langsmithClient.shareRun(runId);

testing-examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ sidebar_position: 4
1212
- [Unit Testing with Pytest](./pytest-ut/): write individual unit tests and log assertions as feedback.
1313
- [Evaluating Existing Runs](./evaluate-existing-test-project/evaluate_runs.ipynb): add ai-assisted feedback and evaluation metrics to existing run traces.
1414
- [Naming Test Projects](./naming-test-projects/naming-test-projects.md): manually name your tests with `run_on_dataset(..., project_name='my-project-name')`
15+
- [How to download feedback and examples from a test project](./download-feedback-and-examples/download_example.ipynb): export the predictions, evaluation results, and other information to programmatically add to your reports.

0 commit comments

Comments
 (0)