You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`atmosphere-spring-ai-alibaba`| Spring AI Alibaba `ReactAgent`*(see runtime caveat below)*| 100 |
79
81
80
82
To switch runtimes, change a single Maven dependency — no code changes needed.
81
83
84
+
> **Spring AI Alibaba runtime — Spring Boot 3 only today.** Spring AI Alibaba `1.1.2.0` is compiled against Spring AI `1.1.2`, and `spring-ai-alibaba-graph-core-1.1.2.0` hardcodes Spring AI 1.1.2-only types like `DeepSeekAssistantMessage`, so the runtime requires Spring AI 1.1.2. Spring AI 1.1.2 itself requires Spring Boot 3 — it pins the SB3-era FQN of `RestClientAutoConfiguration`, which Spring Boot 4 ships at a renamed FQN. Drop `atmosphere-spring-ai-alibaba` into a Spring Boot 3 sample (e.g. `samples/spring-boot-ai-chat -Pspring-boot3`) and it round-trips end-to-end (verified via chrome-devtools against Ollama). A Spring Boot 4 path will become possible once Alibaba publishes a Spring AI 2.x-aligned `spring-ai-alibaba-agent-framework`. `atmosphere-agentscope` is unaffected and works on Spring Boot 4.
85
+
86
+
### Per-Request Runtime Extensions
87
+
88
+
Each `AgentRuntime` runs its framework's "happy path" by default. For requests
89
+
that need framework-native composition (Spring AI advisor chain, LangChain4j
90
+
`AiServices`, Koog graph DSL, ADK multi-agent topology), a small per-request
91
+
helper attaches the framework-native object to `AgentExecutionContext.metadata()`
92
+
and the runtime applies it for that one call — no `AgentRuntime` SPI growth, no
93
+
mutation of shared beans. All five helpers follow the `CacheHint` pattern:
94
+
`from(context)` and `attach(context, ...)` static methods.
95
+
96
+
| Helper | Runtime | Slot it drives |
97
+
|--------|---------|----------------|
98
+
|`SpringAiAdvisors`| Spring AI |`ChatClient.prompt().advisors(...)` — RAG, memory, guardrails, observability |
99
+
|`LangChain4jAiServices`| LangChain4j | Routes through caller's `AiServices`-backed interface (`TokenStream` callbacks bridged to session) |
100
+
|`KoogStrategy`| Koog | Swaps default `chatAgentStrategy()` with a custom `AIAgentGraphStrategy<String, String>` from the `strategy {}` DSL |
101
+
|`AdkRootAgent`| ADK | Replaces the runtime's default `LlmAgent` with `SequentialAgent` / `ParallelAgent` / `LoopAgent` / any `BaseAgent` subclass |
102
+
|`ToolLoopPolicies`| Built-in | Per-request `ToolLoopPolicy(maxIterations, OnMaxIterations)` for the OpenAI-compatible tool loop |
103
+
104
+
Example — Spring AI advisor scoped to one request:
105
+
106
+
```java
107
+
var safeGuard =SafeGuardAdvisor.builder()
108
+
.sensitiveWords(List.of("badword"))
109
+
.failureResponse("I cannot answer that.")
110
+
.build();
111
+
112
+
var ctx =SpringAiAdvisors.attach(baseContext, safeGuard, newSimpleLoggerAdvisor());
113
+
runtime.execute(ctx, session);
114
+
```
115
+
116
+
Each helper ships with a unit-level `*BridgeTest` that proves the runtime
117
+
honors the sidecar (e.g. `SpringAiAgentRuntime.execute` calls
118
+
`promptSpec.advisors(perRequestAdvisors)` only when `SpringAiAdvisors.from(context)`
119
+
returns non-empty). See the per-module READMEs for full DSL examples:
0 commit comments