-
Notifications
You must be signed in to change notification settings - Fork 2k
Revise FactCheckingEvaluator #4675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ | |
* @author Eddú Meléndez | ||
* @author Mark Pollack | ||
* @author guan xu | ||
* @author Yanming Zhou | ||
* @see Evaluator | ||
* @see EvaluationRequest | ||
* @see EvaluationResponse | ||
|
@@ -97,7 +98,9 @@ public class FactCheckingEvaluator implements Evaluator { | |
* the default evaluation prompt suitable for general purpose LLMs. | ||
* @param chatClientBuilder The builder for the ChatClient used to perform the | ||
* evaluation | ||
* @deprecated in favor of {@link #builder(ChatClient.Builder)} | ||
*/ | ||
@Deprecated(forRemoval = true) | ||
public FactCheckingEvaluator(ChatClient.Builder chatClientBuilder) { | ||
this(chatClientBuilder, null); | ||
} | ||
|
@@ -108,7 +111,9 @@ public FactCheckingEvaluator(ChatClient.Builder chatClientBuilder) { | |
* @param chatClientBuilder The builder for the ChatClient used to perform the | ||
* evaluation | ||
* @param evaluationPrompt The prompt text to use for evaluation | ||
* @deprecated in favor of {@link #builder(ChatClient.Builder)} | ||
*/ | ||
@Deprecated | ||
public FactCheckingEvaluator(ChatClient.Builder chatClientBuilder, @Nullable String evaluationPrompt) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could it be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep this as is until we can completely remove it right after 1.1.0-M4. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realise this is the constructor used by the builder for instantiation. We should mark this private then. |
||
Assert.notNull(chatClientBuilder, "chatClientBuilder cannot be null"); | ||
this.chatClientBuilder = chatClientBuilder; | ||
|
@@ -123,7 +128,9 @@ public FactCheckingEvaluator(ChatClient.Builder chatClientBuilder, @Nullable Str | |
* @return A FactCheckingEvaluator configured for Bespoke Minicheck | ||
*/ | ||
public static FactCheckingEvaluator forBespokeMinicheck(ChatClient.Builder chatClientBuilder) { | ||
return new FactCheckingEvaluator(chatClientBuilder, BESPOKE_EVALUATION_PROMPT_TEXT); | ||
return FactCheckingEvaluator.builder(chatClientBuilder) | ||
.evaluationPrompt(BESPOKE_EVALUATION_PROMPT_TEXT) | ||
.build(); | ||
} | ||
|
||
/** | ||
|
@@ -149,8 +156,8 @@ public EvaluationResponse evaluate(EvaluationRequest evaluationRequest) { | |
return new EvaluationResponse(passing, "", Collections.emptyMap()); | ||
} | ||
|
||
public static FactCheckingEvaluator.Builder builder() { | ||
return new FactCheckingEvaluator.Builder(); | ||
public static FactCheckingEvaluator.Builder builder(ChatClient.Builder chatClientBuilder) { | ||
return new FactCheckingEvaluator.Builder().chatClientBuilder(chatClientBuilder); | ||
} | ||
|
||
public static final class Builder { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be removed instead of deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We keep the deprecations latest for one release (even for milestone) before removing.