Skip to content

Commit b96d26e

Browse files
committed
fix(a2a): fix the issue of recursive bean creation
1 parent 81c4638 commit b96d26e

File tree

1 file changed

+8
-1
lines changed
  • spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/a2a

1 file changed

+8
-1
lines changed

spring-ai-alibaba-agent-framework/src/main/java/com/alibaba/cloud/ai/graph/agent/a2a/A2aRemoteAgent.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class A2aRemoteAgent extends BaseAgent {
4646

4747
// Private constructor for Builder pattern
4848
private A2aRemoteAgent(Builder builder) throws GraphStateException {
49-
super(builder.name, builder.description, builder.includeContents, builder.build().isReturnReasoningContents(), builder.outputKey, builder.outputKeyStrategy);
49+
super(builder.name, builder.description, builder.includeContents, builder.returnReasoningContents, builder.outputKey, builder.outputKeyStrategy);
5050
this.agentCard = builder.agentCard;
5151
this.keyStrategyFactory = builder.keyStrategyFactory;
5252
this.compileConfig = builder.compileConfig;
@@ -121,6 +121,8 @@ public static class Builder {
121121

122122
private KeyStrategy outputKeyStrategy;
123123

124+
private boolean returnReasoningContents = false;
125+
124126
// A2aRemoteAgent specific properties
125127
private AgentCardWrapper agentCard;
126128

@@ -161,6 +163,11 @@ public Builder outputKeyStrategy(KeyStrategy outputKeyStrategy) {
161163
return this;
162164
}
163165

166+
public Builder returnReasoningContents(boolean returnReasoningContents) {
167+
this.returnReasoningContents = returnReasoningContents;
168+
return this;
169+
}
170+
164171
public Builder agentCard(AgentCard agentCard) {
165172
this.agentCard = new AgentCardWrapper(agentCard);
166173
return this;

0 commit comments

Comments
 (0)