Skip to content

Commit 5ceb5e6

Browse files
committed
fix(chat): refine handling of multiple returnDirect responses in DefaultChatClient (#4655)
Signed-off-by: Kuntal Maity <[email protected]>
1 parent 87cdf62 commit 5ceb5e6

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

spring-ai-client-chat/src/main/java/org/springframework/ai/chat/client/DefaultChatClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
import java.util.HashMap;
2626
import java.util.List;
2727
import java.util.Map;
28-
import java.util.Optional;
2928
import java.util.Objects;
29+
import java.util.Optional;
3030
import java.util.function.Consumer;
3131

3232
import io.micrometer.observation.Observation;
@@ -48,8 +48,8 @@
4848
import org.springframework.ai.chat.model.ChatModel;
4949
import org.springframework.ai.chat.model.ChatResponse;
5050
import org.springframework.ai.chat.model.Generation;
51-
import org.springframework.ai.model.tool.ToolExecutionResult;
5251
import org.springframework.ai.chat.prompt.ChatOptions;
52+
import org.springframework.ai.model.tool.ToolExecutionResult;
5353
import org.springframework.ai.chat.prompt.Prompt;
5454
import org.springframework.ai.content.Media;
5555
import org.springframework.ai.converter.BeanOutputConverter;

spring-ai-client-chat/src/test/java/org/springframework/ai/chat/client/DefaultChatClientReturnDirectAggregationTests.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2023-2025 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springframework.ai.chat.client;
218

319
import java.util.List;

0 commit comments

Comments
 (0)