Skip to content

JudgmentLabs/judgeval-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

105 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Judgeval Java SDK

Maven Central javadoc License

Installation

Find the latest version on Maven Central.

Maven:

<dependency>
    <groupId>com.judgmentlabs</groupId>
    <artifactId>judgeval-java</artifactId>
    <version>LATEST_VERSION</version>
</dependency>

Gradle:

implementation 'com.judgmentlabs:judgeval-java:LATEST_VERSION'

Usage

Tracer

Judgeval client = Judgeval.builder()
    .apiKey(System.getenv("JUDGMENT_API_KEY"))
    .organizationId(System.getenv("JUDGMENT_ORG_ID"))
    .build();

Tracer tracer = client.tracer()
    .create()
    .projectName("my-project")
    .build();

tracer.span("operation", () -> {
    // your code here
});

Scorer

BaseScorer scorer = client.scorers()
    .builtIn()
    .answerCorrectness()
    .threshold(0.8)
    .build();

Example example = Example.builder()
    .property("input", "What is 2+2?")
    .property("actual_output", "4")
    .property("expected_output", "4")
    .build();

tracer.asyncEvaluate(scorer, example);

Documentation

License

Apache 2.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •