Logo : Sdk Go

Sdk Go

OrganisationPopulaire
GetStream
sdk-go

How the Go SDK in sdks/go is built, tested and released. Read before changing sdks/go, adding a resource method, or cutting a Go SDK version.

Présentation

ÉditeurGetStream
DépôtAgents
Nom de la compétencesdk-go
Étoiles
8.2K
Forks
709
Fichiers inclus
Instructions uniquement
LicenceApache-2.0
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont rédigées en Markdown et non sous forme de code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • Tout dans les instructions

    Tout ce dont le modèle a besoin se trouve dans les instructions : aucun fichier supplémentaire à synchroniser.

  • Open source

    Publiée par GetStream sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Sdk Go dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Copiez l’URL ci-dessous, qui pointe vers le dossier de la compétence, puis collez-la et confirmez.
    https://github.com/GetStream/Agents/tree/main/.claude/skills/sdk-go
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter une compétence → Via une URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/GetStream/Agents.git /tmp/Agents
mkdir -p .claude/skills
cp -r /tmp/Agents/.claude/skills/sdk-go .claude/skills/sdk-go
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Sdk Go dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Sdk Go dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, la compétence Sdk Go n’est pas liée au modèle pour lequel elle a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Go SDK conventions

The per-language half of sdk for sdks/go, module github.com/GetStream/Vision-Agents/sdks/go. Go goes first (AGENTS.md "SDK changes"), so a shared API change lands here before the other SDKs. Write the Go itself by the go and go-testing skills.

Layout

PackageWhat it is
agentsAn agent spelled out in code: agents.New, folder sync, tools, phone, dispatch workers (agents.NewDispatch). What most programs start from
clientAgents addressed by name (client.New(backend).Agent("docs")), their sessions, responses, items, forks, guests, usage callbacks
streamBackend (where the router is, who is billed), Pipeline (one session and its socket), RouterError, routers (stream.NewClient(backend).Router(name)), phone
toolsThe function registry and the JSON Schema read off an argument struct
edgeStream Video calls and the monitor link, through getstream-go
accelerationGenerated from the spec. Never edited by hand

stream.Backend is the one value every package shares. A client's Backend() carries its usage watcher, so an agent, worker or router built on it reports to that client's WithUsage and WithBalanceWarning; client.New with no options on such a backend shares the watcher rather than wrapping it twice.

Go version

Always keep the SDK to latest version of Golang

Dependencies

  • Always update dependencies to latest version
  • Changes to dependencies cannot break the public API

The generated client

go generate ./... in sdks/go runs oapi-codegen on ../../acceleration/api/openapi.yaml with api/oapi-codegen.yaml, which leaves out the Staff operations and the four socket operations: stream holds the three it uses by hand on stream/socket.go, and openSocketSession has no Go client yet. The output is committed; CI's go job regenerates it and fails on a diff.

Models public, operations not:

  • Generated types (acceleration.Session, AgentConfig, SttOptions, enums) are the SDK's models and may appear in signatures. Do not wrap one for its own sake.
  • Generated operations (*WithResponse) are never the API: README, examples and docs call a method of client, agents or stream. A new endpoint is finished when it has one.
  • stream.Backend.Client() and agents.Agent.Client() hand out the generated client for an operation with no method yet. Their doc comments say it carries no compatibility promise; keep that true and add no third accessor.
  • A parameter never takes *acceleration.ClientWithResponses. Take a stream.Backend.

Known gaps, generated only (docs on getstream.io call some of them raw today): simulations and their runs, voices, knowledge documents and URLs beyond ingest and add, scheduled tasks, campaigns, channels, connectors, a connection's credentials and tools, SIP trunks, 10DLC and opt-outs, phone transfer, digits and release, account, credits, spend limits, usage events, teams, prices, stats, policies, provider keys, runs, OCR and classify. Folder sync does not read resume_history: from agent.yaml yet, so one that names it is refused.

Errors, retries and idempotency

  • Every refusal is a *stream.RouterError, built by stream.NewRouterError from the answer. Transport failures are wrapped with %w, so errors.Is(err, context.Canceled) holds.
  • The SDK retries no HTTP request: it cannot know which of the caller's are safe to send twice. RouterError.RetryAfter says how long the router asked for.
  • Responses.Create sends a fresh request_id per text question, so the router answers a resend once. A tool call is keyed by its id (tools.Registry receipts), so a call the router sends again is joined or answered from its first result.
  • A text session's socket is the one thing reconnected: doubling waits from one second to 30, for five minutes (Pipeline.firstRetry, resumeFor), giving up on a 4xx other than 429.

Tests

bash
cd sdks/go
go test -race ./...
go vet ./... && go vet -tags e2e .

No mocks: each package has its own stand-in router, an httptest.Server with a real gorilla upgrader (router in client/client_test.go and stream/accelerated_test.go, restartable and reopened in stream/resume_test.go, pool in stream/dispatch_test.go, worked in agents/dispatch_test.go, backend in agents/agent_test.go, moneyRouter in client/usage_test.go, vendors in stream/phone_test.go). Reuse the package's own before writing another. readme_test.go holds the README's quickstart to examples/quickstart.

e2e_test.go (tag e2e) drives a real router and real models, so it costs money and never runs in CI. Without STREAM_ACCELERATION_URL it skips; with E2E_REQUIRED=1 every skip fails instead. Its package comment names the release smoke set; run it against a router that searches, holds knowledge and bills:

bash
E2E_REQUIRED=1 go test -tags e2e -count=1 -v -run "$SMOKE" .

README

The README renders on pkg.go.dev too, where only links inside the module resolve: a link outside sdks/go is an absolute https://github.com/GetStream/Vision-Agents/tree/main/.... Every identifier in a code block exists; the quickstart is the example file verbatim.

Releasing

sdks/go is developed and released on main, the default branch, so go get ...@latest, @main and pkg.go.dev see it. A version is a tag sdks/go/vX.Y.Z on a main commit; nothing is copied. While 0.x, a minor may break a signature; a patch only fixes.

  1. Land the change on main by a pull request, with Version in stream/backend.go set to X.Y.Z: it is the User-Agent every request sends (stream-agents-go/X.Y.Z) and its X-Stream-Client (stream-agents-go-vX.Y.Z), and nothing else sets it. release-sdk-go.yml fails a tag whose Version differs. If the change breaks a signature or field, add one line under # Unreleased → Breaking Changes in the root CHANGELOG.md. The Go SDK steps of the CI (SDKs) workflow (.github/workflows/ci-sdks.yml) check sdks/go alone on Go 1.25, as a consumer gets it.

  2. Check out the commit to tag (git switch --detach <the main commit>), run the smoke set from sdks/go with E2E_REQUIRED=1, as above, and keep its output, so the result is the tagged commit's.

  3. Tag the commit that holds the change by its SHA, not whatever main is by then. Never create a GitHub Release for it: release.yml publishes the Python packages on a release. Check its Version first, as below: the proxy takes a pushed tag before the workflow runs, so a tag the workflow refuses stays public (v0.5.0 did).

    bash
    set -euo pipefail   # a failed check below stops before the tag
    git fetch origin
    SHA=<the main commit>
    git merge-base --is-ancestor "$SHA" origin/main   # exits 0, else the script stops
    git show "$SHA:sdks/go/stream/backend.go" | grep -q 'Version = "X.Y.Z"'   # the workflow's own check
    git tag sdks/go/vX.Y.Z "$SHA"
    git push origin sdks/go/vX.Y.Z
  4. release-sdk-go.yml runs on the tag: it checks the tag is on main, checks the tagged copy and builds the quickstart in an empty module through proxy.golang.org. By hand, with GOPRIVATE cleared:

    bash
    GOPRIVATE= GONOSUMDB= GOFLAGS=-mod=mod GOPROXY=https://proxy.golang.org \
      go list -m -versions github.com/GetStream/Vision-Agents/sdks/go

A version found broken is never moved or deleted: the proxy and the checksum database keep it. Add retract vX.Y.Z // why to sdks/go/go.mod on main, and release the next patch the same way; @latest then skips the retracted one.

Reject in review

  • A *WithResponse call in the README, an example or a docs page where a method exists.
  • A parameter of a generated client type, or a new accessor for the generated client.
  • A retry of an HTTP request without an owner, a bound and a named threat (AGENTS.md).
  • A stdlib or language feature newer than the go directive.

Foire aux questions

À quoi sert la compétence IA Sdk Go ?

How the Go SDK in sdks/go is built, tested and released. Read before changing sdks/go, adding a resource method, or cutting a Go SDK version.

Pourquoi utiliser Sdk Go sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Sdk Go se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Sdk Go dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/GetStream/Agents/tree/main/.claude/skills/sdk-go. TypingMind lit le fichier SKILL.md et l’installe sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Sdk Go ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Sdk Go ?

Autant que vous le souhaitez. Vous pouvez utiliser Sdk Go avec tout modèle qui prend en charge les compétences : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Sdk Go est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par GetStream sous licence Apache-2.0. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, gabarits ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace de travail IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇