Skip to content

Repository files navigation

AI Sandbox SDK for Java

Motion headline

GAAPIsStreamingJava

UX-First Value Cards

Quick IntegrationReal-Time ExperienceReliability by Default
Clean Java API surface with low onboarding overheadsendChatStream(...) for streaming chunksTimeout + retry controls tuned for production

Visual Integration Flow

flowchart LR
A[Create Agent] --> B[Create Chat Channel]
B --> C[Send Message]
C --> D[SSE Stream Chunks]
D --> E[Attach Knowledge Base]
E --> F[Customer-Ready Experience]
Loading

60-Second Quick Start

importcom.egroupai.sandbox.sdk.AiSandboxClient;
importjava.util.List;
importjava.util.Map;
AiSandboxClientclient = newAiSandboxClient(
System.getenv().getOrDefault("AI_SANDBOX_BASE_URL", "https://www.egroupai.com"),
System.getenv().getOrDefault("AI_SANDBOX_API_KEY", "")
);
Map<String, Object> agent = client.createAgent(Map.of(
"agentDisplayName", "Support Agent",
"agentDescription", "Handles customer inquiries"
));
intagentId = Integer.parseInt(String.valueOf(((Map<String, Object>) agent.get("payload")).get("agentId")));
Map<String, Object> channel = client.createChatChannel(agentId, Map.of(
"title", "Web Chat",
"visitorId", "visitor-001"
));
StringchannelId = String.valueOf(((Map<String, Object>) channel.get("payload")).get("channelId"));
List<String> chunks = client.sendChatStream(agentId, Map.of(
"channelId", channelId,
"message", "What is the return policy?",
"stream", true
));
chunks.forEach(System.out::println);

Maven

<dependency>
<groupId>com.egroupai</groupId>
<artifactId>ai-sandbox-sdk-java</artifactId>
<version>1.0.0</version>
</dependency>

Integration Sanity Checklist

  • Keep AI_SANDBOX_API_KEY in secure runtime configuration.
  • Confirm AI_SANDBOX_BASE_URL points to the intended environment.
  • Verify [DONE] handling in stream consumers before release.

Snapshot

MetricValue
API Coverage11 operations (Agent / Chat / Knowledge Base)
Stream Modetext/event-stream with [DONE] handling
Retry Safety429/5xx auto-retry for GET/HEAD + capped exponential backoff
Error SurfaceApiException with status/body/traceId
ValidationProduction-host integration verified
Release ReadinessRun draft-release-train and guards checks before merge

Links

License

This SDK is released under the Apache-2.0 license.

About

Official Java SDK for AI Sandbox v1 integration

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages