Record Class LmStudioSettings
java.lang.Object
java.lang.Record
fr.tiogars.chat.domains.lmstudio.models.LmStudioSettings
-
Constructor Summary
ConstructorsConstructorDescriptionLmStudioSettings(@NotBlank @Size(max=2048) String baseUrl, @NotBlank @Size(max=255) String model, @Positive int timeoutSeconds, @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token) Creates an instance of aLmStudioSettingsrecord class.LmStudioSettings(String baseUrl, String model, int timeoutSeconds) -
Method Summary
Modifier and TypeMethodDescription@NotBlank @Size(max=2048) StringbaseUrl()Returns the value of thebaseUrlrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@AssertTrue(message="baseUrl must be an absolute HTTP(S) URL without credentials, query or fragment") booleanboolean@NotBlank @Size(max=255) Stringmodel()Returns the value of themodelrecord component.@Positive intReturns the value of thetimeoutSecondsrecord component.@Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") Stringtoken()Returns the value of thetokenrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
LmStudioSettings
-
LmStudioSettings
public LmStudioSettings(@NotBlank @Size(max=2048) @NotBlank @Size(max=2048) String baseUrl, @NotBlank @Size(max=255) @NotBlank @Size(max=255) String model, @Positive @Positive int timeoutSeconds, @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token) Creates an instance of aLmStudioSettingsrecord class.- Parameters:
baseUrl- the value for thebaseUrlrecord componentmodel- the value for themodelrecord componenttimeoutSeconds- the value for thetimeoutSecondsrecord componenttoken- the value for thetokenrecord component
-
-
Method Details
-
isTokenConfigured
public boolean isTokenConfigured() -
toString
-
isBaseUrlValid
@AssertTrue(message="baseUrl must be an absolute HTTP(S) URL without credentials, query or fragment") public @AssertTrue(message="baseUrl must be an absolute HTTP(S) URL without credentials, query or fragment") boolean isBaseUrlValid() -
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
baseUrl
Returns the value of thebaseUrlrecord component.- Returns:
- the value of the
baseUrlrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
timeoutSeconds
@Positive public @Positive int timeoutSeconds()Returns the value of thetimeoutSecondsrecord component.- Returns:
- the value of the
timeoutSecondsrecord component
-
token
@Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?", message="token must be a valid LM Studio API token") public @Size(max=4096) @Pattern(regexp="(?:[A-Za-z0-9._~+/:\\-]+=*)?",message="token must be a valid LM Studio API token") String token()Returns the value of thetokenrecord component.- Returns:
- the value of the
tokenrecord component
-