Specify dependencies
Dependencies can be specified using either Maven or Gradle. The LangSmith Java SDK requires Java 8 or later.Maven
Add the LangSmith Java SDK to yourpom.xml:
Gradle
Add the LangSmith Java SDK to yourbuild.gradle.kts or build.gradle:
Specify environment variables
The LangSmith Java SDK configures itself through environment variables. See the Environment Variables reference to configure additional variables for tracing. Example.env file:
LangsmithOkHttpClient.fromEnv().
Example file directory:
Next
After you configure your Java application with the LangSmith SDK, you can:- Log traces to a specific project
- Track costs and usage
- Create and manage datasets
- Query and export traces
- Manage prompts programmatically