Package xyz.tcheeric.jev
Record Class JevConfig
java.lang.Object
java.lang.Record
xyz.tcheeric.jev.JevConfig
public record JevConfig(URI baseUri, String apiToken, String model, Duration requestTimeout, RetryPolicy retryPolicy)
extends Record
Everything the client needs that is not a question: where the evaluator lives, which model
answers, how long to wait, and how hard to retry.
The bearer token is passed in rather than read here, but the intended source is the environment. It is never logged and never appears in an exception message.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapiToken()Returns the value of theapiTokenrecord component.baseUri()Returns the value of thebaseUrirecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.model()Returns the value of themodelrecord component.static JevConfigThe public evaluator atDEFAULT_BASE_URI.static JevConfigReturns the value of therequestTimeoutrecord component.Returns the value of theretryPolicyrecord component.toString()Keeps the token out of logs and crash dumps.withRequestTimeout(Duration requestTimeout) withRetryPolicy(RetryPolicy retryPolicy)
-
Field Details
-
DEFAULT_MODEL
A pinned, versioned model. The moving aliasesjev-latestandjev-previeware refused, because an upstream release would silently change answers a consumer has already calibrated thresholds against. The API's own docs give the same advice to anyone who has tuned confidence thresholds.- See Also:
-
DEFAULT_BASE_URI
-
DEFAULT_REQUEST_TIMEOUT
-
-
Constructor Details
-
JevConfig
public JevConfig(URI baseUri, String apiToken, String model, Duration requestTimeout, RetryPolicy retryPolicy) Creates an instance of aJevConfigrecord class.- Parameters:
baseUri- the value for thebaseUrirecord componentapiToken- the value for theapiTokenrecord componentmodel- the value for themodelrecord componentrequestTimeout- the value for therequestTimeoutrecord componentretryPolicy- the value for theretryPolicyrecord component
-
-
Method Details
-
of
-
of
The public evaluator atDEFAULT_BASE_URI. -
withModel
-
withRequestTimeout
-
withRetryPolicy
-
toString
Keeps the token out of logs and crash dumps. A record's generated toString would print it. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
baseUri
Returns the value of thebaseUrirecord component.- Returns:
- the value of the
baseUrirecord component
-
apiToken
Returns the value of theapiTokenrecord component.- Returns:
- the value of the
apiTokenrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
requestTimeout
Returns the value of therequestTimeoutrecord component.- Returns:
- the value of the
requestTimeoutrecord component
-
retryPolicy
Returns the value of theretryPolicyrecord component.- Returns:
- the value of the
retryPolicyrecord component
-