Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class AnthropicChatProperties {
private final AnthropicChatOptions options = AnthropicChatOptions.builder()
.model(AnthropicChatModel.DEFAULT_MODEL_NAME)
.maxTokens(AnthropicChatModel.DEFAULT_MAX_TOKENS)
.temperature(AnthropicChatModel.DEFAULT_TEMPERATURE)
.build();

public AnthropicChatOptions getOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ public class AzureOpenAiChatProperties {

public static final String DEFAULT_DEPLOYMENT_NAME = "gpt-4o";

private static final Double DEFAULT_TEMPERATURE = 0.7;

@NestedConfigurationProperty
private final AzureOpenAiChatOptions options = AzureOpenAiChatOptions.builder()
.deploymentName(DEFAULT_DEPLOYMENT_NAME)
.temperature(DEFAULT_TEMPERATURE)
.build();

public AzureOpenAiChatOptions getOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public class DeepSeekChatProperties extends DeepSeekParentProperties {

public static final String DEFAULT_CHAT_MODEL = DeepSeekApi.ChatModel.DEEPSEEK_CHAT.getValue();

private static final Double DEFAULT_TEMPERATURE = 1D;

public static final String DEFAULT_COMPLETIONS_PATH = "/chat/completions";

public static final String DEFAULT_BETA_PREFIX_PATH = "/beta";
Expand All @@ -49,10 +47,7 @@ public class DeepSeekChatProperties extends DeepSeekParentProperties {
private String betaPrefixPath = DEFAULT_BETA_PREFIX_PATH;

@NestedConfigurationProperty
private final DeepSeekChatOptions options = DeepSeekChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
.temperature(DEFAULT_TEMPERATURE)
.build();
private final DeepSeekChatOptions options = DeepSeekChatOptions.builder().model(DEFAULT_CHAT_MODEL).build();

public DeepSeekChatOptions getOptions() {
return this.options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ public class MiniMaxChatProperties extends MiniMaxParentProperties {

public static final String DEFAULT_CHAT_MODEL = MiniMaxApi.ChatModel.ABAB_5_5_Chat.value;

private static final Double DEFAULT_TEMPERATURE = 0.7;

@NestedConfigurationProperty
private final MiniMaxChatOptions options = MiniMaxChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
.temperature(DEFAULT_TEMPERATURE)
.build();
private final MiniMaxChatOptions options = MiniMaxChatOptions.builder().model(DEFAULT_CHAT_MODEL).build();

public MiniMaxChatOptions getOptions() {
return this.options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,13 @@ public class MistralAiChatProperties extends MistralAiParentProperties {

public static final String DEFAULT_CHAT_MODEL = MistralAiApi.ChatModel.SMALL.getValue();

private static final Double DEFAULT_TEMPERATURE = 0.7;

private static final Double DEFAULT_TOP_P = 1.0;

private static final Boolean IS_ENABLED = false;

@NestedConfigurationProperty
private final MistralAiChatOptions options = MistralAiChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
.temperature(DEFAULT_TEMPERATURE)
.safePrompt(!IS_ENABLED)
.topP(DEFAULT_TOP_P)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ public class OCICohereChatModelProperties {

private static final String DEFAULT_SERVING_MODE = ServingMode.ON_DEMAND.getMode();

private static final Double DEFAULT_TEMPERATURE = 0.7;

@NestedConfigurationProperty
private final OCICohereChatOptions options = OCICohereChatOptions.builder()
.servingMode(DEFAULT_SERVING_MODE)
.temperature(DEFAULT_TEMPERATURE)
.build();

public OCICohereChatOptions getOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ public class OpenAiSdkChatProperties extends AbstractOpenAiSdkOptions {

public static final String DEFAULT_CHAT_MODEL = OpenAiSdkChatOptions.DEFAULT_CHAT_MODEL;

private static final Double DEFAULT_TEMPERATURE = 1.0;

@NestedConfigurationProperty
private final OpenAiSdkChatOptions options = OpenAiSdkChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
.temperature(DEFAULT_TEMPERATURE)
.build();
private final OpenAiSdkChatOptions options = OpenAiSdkChatOptions.builder().model(DEFAULT_CHAT_MODEL).build();

public OpenAiSdkChatOptions getOptions() {
return this.options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ public class OpenAiAudioTranscriptionProperties extends OpenAiParentProperties {

public static final String DEFAULT_TRANSCRIPTION_MODEL = OpenAiAudioApi.TranscriptionModels.WHISPER_1.getValue();

private static final Double DEFAULT_TEMPERATURE = 0.7;

private static final OpenAiAudioApi.TranscriptResponseFormat DEFAULT_RESPONSE_FORMAT = OpenAiAudioApi.TranscriptResponseFormat.TEXT;

@NestedConfigurationProperty
private final OpenAiAudioTranscriptionOptions options = OpenAiAudioTranscriptionOptions.builder()
.model(DEFAULT_TRANSCRIPTION_MODEL)
.temperature(DEFAULT_TEMPERATURE.floatValue())
.responseFormat(DEFAULT_RESPONSE_FORMAT)
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ public class ZhiPuAiChatProperties extends ZhiPuAiParentProperties {

public static final String DEFAULT_CHAT_MODEL = ZhiPuAiApi.ChatModel.GLM_4_Air.value;

private static final Double DEFAULT_TEMPERATURE = 0.7;

@NestedConfigurationProperty
private final ZhiPuAiChatOptions options = ZhiPuAiChatOptions.builder()
.model(DEFAULT_CHAT_MODEL)
.temperature(DEFAULT_TEMPERATURE)
.build();
private final ZhiPuAiChatOptions options = ZhiPuAiChatOptions.builder().model(DEFAULT_CHAT_MODEL).build();

public ZhiPuAiChatOptions getOptions() {
return this.options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ public class AnthropicChatModel implements ChatModel {

public static final Integer DEFAULT_MAX_TOKENS = 500;

public static final Double DEFAULT_TEMPERATURE = 0.8;

private static final Logger logger = LoggerFactory.getLogger(AnthropicChatModel.class);

private static final ChatModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultChatModelObservationConvention();
Expand Down Expand Up @@ -879,7 +877,6 @@ public static final class Builder {
private AnthropicChatOptions defaultOptions = AnthropicChatOptions.builder()
.model(DEFAULT_MODEL_NAME)
.maxTokens(DEFAULT_MAX_TOKENS)
.temperature(DEFAULT_TEMPERATURE)
.build();

private RetryTemplate retryTemplate = RetryUtils.DEFAULT_RETRY_TEMPLATE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ public class AzureOpenAiChatModel implements ChatModel {

private static final String DEFAULT_DEPLOYMENT_NAME = "gpt-4o";

private static final Double DEFAULT_TEMPERATURE = 0.7;

private static final ChatModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultChatModelObservationConvention();

private static final ToolCallingManager DEFAULT_TOOL_CALLING_MANAGER = ToolCallingManager.builder().build();
Expand Down Expand Up @@ -1003,7 +1001,6 @@ public static final class Builder {

private AzureOpenAiChatOptions defaultOptions = AzureOpenAiChatOptions.builder()
.deploymentName(DEFAULT_DEPLOYMENT_NAME)
.temperature(DEFAULT_TEMPERATURE)
.build();

private ToolCallingManager toolCallingManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public class OCICohereChatModel implements ChatModel {

private static final ChatModelObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultChatModelObservationConvention();

private static final Double DEFAULT_TEMPERATURE = 0.7;

/**
* The {@link GenerativeAiInference} client used to interact with OCI GenAI service.
*/
Expand Down Expand Up @@ -247,7 +245,7 @@ private ChatRequest newChatRequest(OCICohereChatOptions options, Message message
.maxTokens(options.getMaxTokens())
.topK(options.getTopK())
.topP(options.getTopP())
.temperature(Objects.requireNonNullElse(options.getTemperature(), DEFAULT_TEMPERATURE))
.temperature(options.getTemperature())
.preambleOverride(options.getPreambleOverride())
.stopSequences(options.getStopSequences())
.documents(options.getDocuments())
Expand Down