Skip to content

eGroupAI/ai-sandbox-sdk-go

Repository files navigation

AI Sandbox SDK for Go

Motion headline

GA APIs Streaming Go

UX-First Value Cards

Quick Integration Real-Time Experience Reliability by Default
Lightweight client for low-overhead service integration SSE streaming via SendChatStream(...) Retry + timeout controls for stable operations

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

package main

import (
  "fmt"
  "os"

  aisandboxsdk "github.com/eGroupAI/ai-sandbox-sdk-go"
)

func main() {
  client := aisandboxsdk.NewClient(
    getenv("AI_SANDBOX_BASE_URL", "https://www.egroupai.com"),
    os.Getenv("AI_SANDBOX_API_KEY"),
  )

  agent, _ := client.CreateAgent(map[string]any{
    "agentDisplayName": "Support Agent",
    "agentDescription": "Handles customer inquiries",
  })
  agentID := int(agent["payload"].(map[string]any)["agentId"].(float64))

  channel, _ := client.CreateChatChannel(agentID, map[string]any{
    "title": "Web Chat",
    "visitorId": "visitor-001",
  })
  channelID := channel["payload"].(map[string]any)["channelId"].(string)

  chunks, _ := client.SendChatStream(agentID, map[string]any{
    "channelId": channelID,
    "message": "What is the return policy?",
    "stream": true,
  })
  fmt.Println(chunks)
}

func getenv(key, fallback string) string {
  if v, ok := os.LookupEnv(key); ok {
    return v
  }
  return fallback
}

Installation

go get github.com/eGroupAI/ai-sandbox-sdk-go

Integration Sanity Checklist

  • Set AI_SANDBOX_API_KEY in runtime secrets, not in source code.
  • Keep AI_SANDBOX_BASE_URL aligned with your target environment.
  • Validate stream handling for [DONE] before production rollout.

Snapshot

Metric Value
API Coverage 11 operations (Agent / Chat / Knowledge Base)
Stream Mode text/event-stream with [DONE] handling
Retry Safety 429/5xx auto-retry for GET/HEAD + capped exponential backoff
Error Surface ApiError with status/body/traceId
Validation Production-host integration verified
Release Readiness Run draft-release-train and guards checks before merge

Links

License

This SDK is released under the Apache-2.0 license.

About

Official Go SDK for AI Sandbox v1 integration

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages