Package com.langchain.smith.example
Class RecordExperimentExampleKt
-
- All Implemented Interfaces:
public final class RecordExperimentExampleKt
-
-
Method Summary
-
-
Method Detail
-
main
final static Unit main()
Demonstrates how to record experiments in LangSmith using datasets, sessions, and runs.
This example is inspired by the Python implementation at: https://github.com/jacoblee93/langsmith-rest-experiments
This example shows:
Defining experiment results with inputs, reference outputs, and actual outputs
Getting or creating a dataset by name
Generating deterministic example IDs using UUID v5
Creating or updating examples in the dataset with idempotent IDs
Creating an experiment session to group experiment runs
Logging mocked LLM runs with inputs, outputs, and metadata
Using LLM-as-judge evaluators to compare actual vs reference outputs
Set these environment variables before running:
LANGSMITH_API_KEY: Your LangSmith API key
./gradlew :langsmith-java-example:run -Pexample=RecordExperiment
-
-
-
-