Embabel
Embabel Adapter
Section titled “Embabel Adapter”AiSupport implementation backed by Embabel AgentPlatform. When this JAR is on the classpath, @AiEndpoint can run Embabel agents and stream their output to browser clients.
Maven Coordinates
Section titled “Maven Coordinates”<dependency> <groupId>org.atmosphere</groupId> <artifactId>atmosphere-embabel</artifactId> <version>LATEST</version> <!-- check Maven Central for latest --></dependency>Quick Start
Section titled “Quick Start”AiSupport SPI (auto-detected)
Section titled “AiSupport SPI (auto-detected)”@AiEndpoint(path = "/ai/chat", systemPrompt = "You are a helpful assistant")public class MyChat {
@Prompt public void onPrompt(String message, StreamingSession session) { session.stream(message); // uses Embabel when atmosphere-embabel is on classpath }}The agent name can be specified in AiRequest.hints()["agentName"].
Direct Adapter Usage
Section titled “Direct Adapter Usage”val session = StreamingSessions.start(resource)embabelAdapter.stream(AgentRequest("assistant") { channel -> agentPlatform.run(prompt, channel)}, session)Key Classes
Section titled “Key Classes”| Class | Purpose |
|---|---|
EmbabelStreamingAdapter | AiStreamingAdapter bridging Embabel agents to StreamingSession |
AtmosphereOutputChannel | Routes Embabel OutputChannelEvent to StreamingSession |
EmbabelAiSupport | AiSupport SPI implementation (priority 100) |
AgentRequest | Wraps agent name and runner function |
Event Mapping
Section titled “Event Mapping”| Embabel Event | StreamingSession Action |
|---|---|
MessageOutputChannelEvent | session.send(content) |
ContentOutputChannelEvent | session.send(content) |
ProgressOutputChannelEvent | session.progress(message) |
LoggingOutputChannelEvent (INFO+) | session.progress(message) |
Spring Boot Auto-Configuration
Section titled “Spring Boot Auto-Configuration”AtmosphereEmbabelAutoConfiguration bridges a Spring-managed AgentPlatform bean to the SPI automatically.
Samples
Section titled “Samples”- Spring Boot Embabel Chat — Embabel agent chat example
See Also
Section titled “See Also”- AI Integration —
AiSupportSPI,@AiEndpoint, filters, routing - Spring AI Adapter
- LangChain4j Adapter
- Google ADK Adapter