Skip to content

Commit 4493d68

Browse files
authored
Merge pull request #1834 from Wal8800/fix-streaming-model-reasoning
fix: disable topK for anthropic streaming model
2 parents 3954173 + 2b05b33 commit 4493d68

File tree

1 file changed

+4
-0
lines changed
  • model-providers/anthropic/runtime/src/main/java/io/quarkiverse/langchain4j/anthropic/runtime

1 file changed

+4
-0
lines changed

model-providers/anthropic/runtime/src/main/java/io/quarkiverse/langchain4j/anthropic/runtime/AnthropicRecorder.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ public Supplier<StreamingChatModel> streamingChatModel(String configName) {
141141

142142
ChatModelConfig.ThinkingConfig thinkingConfig = chatModelConfig.thinking();
143143
if (thinkingConfig.type().isPresent()) {
144+
if (chatModelConfig.topK().isPresent()) {
145+
LOG.warn("TopK was not configured because thinking was enabled");
146+
}
147+
builder.topK(null);
144148
builder.thinkingType(thinkingConfig.type().get());
145149
}
146150

0 commit comments

Comments
 (0)