Package akka.javasdk.agent
Record Class ModelProvider.HuggingFace
- All Implemented Interfaces:
ModelProvider
- Enclosing interface:
ModelProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface akka.javasdk.agent.ModelProvider
ModelProvider.Anthropic, ModelProvider.Custom, ModelProvider.FromConfig, ModelProvider.GoogleAIGemini, ModelProvider.HuggingFace, ModelProvider.LocalAI, ModelProvider.Ollama, ModelProvider.OpenAi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessToken
record component.baseUrl()
Returns the value of thebaseUrl
record component.Returns the value of theconnectionTimeout
record component.final boolean
Indicates whether some other object is "equal to" this one.static ModelProvider.HuggingFace
fromConfig
(com.typesafe.config.Config config) final int
hashCode()
Returns a hash code value for this object.int
Returns the value of themaxNewTokens
record component.int
Returns the value of themaxRetries
record component.modelId()
Returns the value of themodelId
record component.Returns the value of theresponseTimeout
record component.double
Returns the value of thetemperature
record component.double
topP()
Returns the value of thetopP
record component.final String
toString()
Returns a string representation of this record class.withAccessToken
(String accessToken) withBaseUrl
(String baseUrl) withConnectionTimeout
(Duration connectionTimeout) withMaxNewTokens
(Integer maxNewTokens) withMaxRetries
(int maxRetries) withModelId
(String modelId) withResponseTimeout
(Duration responseTimeout) withTemperature
(Double temperature)
-
Constructor Details
-
HuggingFace
public HuggingFace(String accessToken, String modelId, String baseUrl, double temperature, double topP, int maxNewTokens, Duration connectionTimeout, Duration responseTimeout, int maxRetries) Creates an instance of aHuggingFace
record class.- Parameters:
accessToken
- the value for theaccessToken
record componentmodelId
- the value for themodelId
record componentbaseUrl
- the value for thebaseUrl
record componenttemperature
- the value for thetemperature
record componenttopP
- the value for thetopP
record componentmaxNewTokens
- the value for themaxNewTokens
record componentconnectionTimeout
- the value for theconnectionTimeout
record componentresponseTimeout
- the value for theresponseTimeout
record componentmaxRetries
- the value for themaxRetries
record component
-
-
Method Details
-
fromConfig
-
withAccessToken
-
withModelId
-
withBaseUrl
-
withTemperature
-
withTopP
-
withMaxNewTokens
-
withConnectionTimeout
-
withResponseTimeout
-
withMaxRetries
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
accessToken
Returns the value of theaccessToken
record component.- Returns:
- the value of the
accessToken
record component
-
modelId
Returns the value of themodelId
record component.- Returns:
- the value of the
modelId
record component
-
baseUrl
Returns the value of thebaseUrl
record component.- Returns:
- the value of the
baseUrl
record component
-
temperature
public double temperature()Returns the value of thetemperature
record component.- Returns:
- the value of the
temperature
record component
-
topP
public double topP()Returns the value of thetopP
record component.- Returns:
- the value of the
topP
record component
-
maxNewTokens
public int maxNewTokens()Returns the value of themaxNewTokens
record component.- Returns:
- the value of the
maxNewTokens
record component
-
connectionTimeout
Returns the value of theconnectionTimeout
record component.- Returns:
- the value of the
connectionTimeout
record component
-
responseTimeout
Returns the value of theresponseTimeout
record component.- Returns:
- the value of the
responseTimeout
record component
-
maxRetries
public int maxRetries()Returns the value of themaxRetries
record component.- Returns:
- the value of the
maxRetries
record component
-