Package org.springframework.ai.qianfan
Class QianFanChatOptions
java.lang.Object
org.springframework.ai.qianfan.QianFanChatOptions
- All Implemented Interfaces:
ChatOptions
,ModelOptions
QianFanChatOptions represents the options for performing chat completion using the
QianFan API. It provides methods to set and retrieve various options like model,
frequency penalty, max tokens, etc.
- Since:
- 1.0
- Author:
- Geng Rong
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic QianFanChatOptions.Builder
builder()
copy()
Returns a copy of thisChatOptions
.boolean
static QianFanChatOptions
fromOptions
(QianFanChatOptions fromOptions) Returns the frequency penalty to use for the chat.Returns the maximum number of tokens to use for the chat.getModel()
Returns the model to use for the chat.Returns the presence penalty to use for the chat.getStop()
Returns the stop sequences to use for the chat.Returns the temperature to use for the chat.getTopK()
Returns the top K to use for the chat.getTopP()
Returns the top P to use for the chat.int
hashCode()
void
setFrequencyPenalty
(Double frequencyPenalty) void
setMaxTokens
(Integer maxTokens) void
void
setPresencePenalty
(Double presencePenalty) void
setResponseFormat
(QianFanApi.ChatCompletionRequest.ResponseFormat responseFormat) void
void
setStopSequences
(List<String> stopSequences) void
setTemperature
(Double temperature) void
-
Constructor Details
-
QianFanChatOptions
public QianFanChatOptions()
-
-
Method Details
-
builder
-
fromOptions
-
getModel
Description copied from interface:ChatOptions
Returns the model to use for the chat.- Specified by:
getModel
in interfaceChatOptions
- Returns:
- the model to use for the chat
-
setModel
-
getFrequencyPenalty
Description copied from interface:ChatOptions
Returns the frequency penalty to use for the chat.- Specified by:
getFrequencyPenalty
in interfaceChatOptions
- Returns:
- the frequency penalty to use for the chat
-
setFrequencyPenalty
-
getMaxTokens
Description copied from interface:ChatOptions
Returns the maximum number of tokens to use for the chat.- Specified by:
getMaxTokens
in interfaceChatOptions
- Returns:
- the maximum number of tokens to use for the chat
-
setMaxTokens
-
getPresencePenalty
Description copied from interface:ChatOptions
Returns the presence penalty to use for the chat.- Specified by:
getPresencePenalty
in interfaceChatOptions
- Returns:
- the presence penalty to use for the chat
-
setPresencePenalty
-
getResponseFormat
-
setResponseFormat
-
getStopSequences
Description copied from interface:ChatOptions
Returns the stop sequences to use for the chat.- Specified by:
getStopSequences
in interfaceChatOptions
- Returns:
- the stop sequences to use for the chat
-
setStopSequences
-
getStop
-
setStop
-
getTemperature
Description copied from interface:ChatOptions
Returns the temperature to use for the chat.- Specified by:
getTemperature
in interfaceChatOptions
- Returns:
- the temperature to use for the chat
-
setTemperature
-
getTopP
Description copied from interface:ChatOptions
Returns the top P to use for the chat.- Specified by:
getTopP
in interfaceChatOptions
- Returns:
- the top P to use for the chat
-
setTopP
-
getTopK
Description copied from interface:ChatOptions
Returns the top K to use for the chat.- Specified by:
getTopK
in interfaceChatOptions
- Returns:
- the top K to use for the chat
-
hashCode
public int hashCode() -
equals
-
copy
Description copied from interface:ChatOptions
Returns a copy of thisChatOptions
.- Specified by:
copy
in interfaceChatOptions
- Returns:
- a copy of this
ChatOptions
-