Logo von Sdk Dotnet

Sdk Dotnet

OrganisationBeliebt
GetStream
sdk-dotnet

How to build and extend the .NET SDK in sdks/dotnet. Read this before changing the client, the socket, the agent, dispatch or the router, before regenerating the models, or before reaching for a NuGet package.

Übersicht

HerausgeberGetStream
RepositoryAgents
Skill-Namesdk-dotnet
Sterne
8.2K
Forks
709
Mitgelieferte Dateien
Nur Anweisungen
LizenzApache-2.0
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von GetStream auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Sdk Dotnet in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/GetStream/Agents/tree/main/.claude/skills/sdk-dotnet
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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-dotnet .claude/skills/sdk-dotnet
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Sdk Dotnet in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Sdk Dotnet automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Sdk Dotnet nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

.NET SDK conventions

The per-language half of sdk. It records the decisions sdks/dotnet already follows, so a change lands consistently rather than re-litigating them.

Assume .NET 10 (the LTS), C# 14, net10.0, nullable reference types on, warnings as errors, central package management (Directory.Packages.props). Server side only.

Toolchain: Docker, never the host

Nothing is installed on the host. Every command runs in mcr.microsoft.com/dotnet/sdk:10.0 with the repo mounted and the NuGet cache in the va-nuget volume:

bash
D="docker run --rm -v /path/to/Vision-Agents:/repo -v va-nuget:/root/.nuget -w /repo/sdks/dotnet mcr.microsoft.com/dotnet/sdk:10.0"
$D dotnet build GetStream.VisionAgents.slnx
$D dotnet test --project tests/GetStream.VisionAgents.Tests
$D dotnet run --project tools/Generate              # regenerate the models
$D dotnet run --project tools/Generate -- --check   # what CI runs
docker run ... -e VISION_AGENTS_LIVE_URL=http://host.docker.internal:8091 ... \
  dotnet test --project tests/GetStream.VisionAgents.Tests -- --filter-class GetStream.VisionAgents.Tests.LiveTests

Build output (bin/, obj/, TestResults/) is ignored by sdks/dotnet/.gitignore, nowhere else.

Naming

Stream's .NET packages are getstream-net (the current generated server SDK, namespace GetStream), stream-chat-net and stream-feed-net. The package id is the placeholder getstream-calypso, like the JS @stream-io/calypso, until the public name is chosen; the namespace stays GetStream.VisionAgents, with the generated DTOs under GetStream.VisionAgents.Models.

Releases run by hand: Actions, "Release .NET SDK", "Use workflow from" main, pick the part to bump or type an exact version, and untick the dry run to publish. The workflow is .github/workflows/release-sdk-dotnet.yml; it pushes to NuGet through trusted publishing and tags sdk-dotnet-v<version>. Keep the file name: the nuget.org policy is bound to it. Do not rename to StreamIO.*; nothing Stream ships to NuGet is called that.

Public types are named after what they are to a caller (Agent, Session, Dispatch, Router, Folder), async methods end in Async and take a CancellationToken last, defaulted. Options are sealed records with init properties.

The generator: NSwag, DTOs only

tools/Generate uses NSwag 14.7.1 as a library, writing src/GetStream.VisionAgents/Generated/Models.cs. The output is committed, so a restore needs no code generation, and --check fails CI when the spec has moved without it.

Why NSwag, and why DTOs only:

  • The request layer has to be ours. A token is minted per request, a local router takes X-Customer-Id, a hosted one wants api_key and stream-auth-type, and sockets carry the same credential. A generated client brings a runtime that decides those things, and it decides them differently. So the generator emits POCOs and VisionAgentsClient has one method per HTTP verb (GetAsync<T>, PostAsync<T>, ...), the way sdk-js does.
  • Kiota was the other serious option. It generates request builders over its own abstractions (Microsoft.Kiota.* packages at runtime), its models are not plain System.Text.Json types, and it cannot be told to emit models alone. That is a runtime dependency and an auth pipeline to fight for types we only need the shapes of.
  • openapi-generator needs a JVM, emits an ApiClient/Configuration runtime, and its System.Text.Json path is the less-travelled one.
  • Refitter generates Refit interfaces, so Refit at runtime, for the same reason no.
  • NSwag emits System.Text.Json POCOs with nullable reference types, runs on the same .NET image, and is pinned in Directory.Packages.props. The library rather than the CLI because the CLI cannot be told two things that make the output usable: PascalCase property names (PascalCaseNames) and enums as strings (EnumsAsStrings). A C# enum has nowhere to put a value the router adds after this ships, so an enum would fail the whole response; the values stay in the doc comment.
  • GenerateDefaultValues = false and optional properties nullable: never copy a schema default into a request. A default sent because the type had one is how a caller silently loses what their config named. A field left null is left out, so the config or the router decides.

Never hand-edit Generated/Models.cs. Never re-declare a schema by hand; use the model.

Dependencies

  • getstream-net 16.0.1 for what is Stream rather than this router: Edge mints user tokens (CreateUserToken) and can still create a call (VideoClient.GetOrCreateCallAsync), though agents no longer need one created: the router names it after the session. It refuses a secret shorter than 256 bits, which a real Stream secret never is; test fixtures use a 64-character one. Its exceptions are wrapped in RouterException.
  • YamlDotNet 18.1.0 for agent.yaml, urls.yaml and skill frontmatter, with duplicate keys refused. A key agent.yaml does not know is refused, not dropped.
  • Tokens for the router itself are HS256 signed with System.Security.Cryptography, not a JWT package: a dozen lines in Backend.SignToken.
  • Nothing else at runtime. A new package is a design question; ask first.

HttpClient

new VisionAgentsClient(options) owns its HttpClient; new VisionAgentsClient(httpClient, options) borrows one, which is how IHttpClientFactory plugs in, and never disposes it. Agent disposes a client only if it made it. Do not add a DI extension package.

Errors

Every answer that is not a success becomes a RouterException in one place, RouterException.Answered, which reads the generated ErrorResponse: Said is its message, Type (a string, so a kind the router adds later still reads) and Code are what to branch on, DocUrl explains the code, and RequestId is the X-Request-Id to quote when a 500 says only "something went wrong". A body that is not the envelope (a proxy's page, nothing, an older router's {"error": "..."}) keeps its trimmed text as Said with the rest null, and a refused socket upgrade has no body at all, because ClientWebSocket keeps only the status and headers.

Sockets

Hand-written in Socket.cs, because OpenAPI stops at the upgrade. One Socket over ClientWebSocket for the session events, dispatch and the modality streams.

  • Server side, so credentials go in headers, never the query string.
  • Frames are loose (Frame, read through Text, Flag, Number, Nested), so a frame type the router learns later reaches a caller rather than being dropped.
  • The modality start frame carries target at the top level as well as inside the option block, like Go and the Python plugin: the router refuses a frame whose target is only in the block (see readStart in acceleration/internal/api/streamws.go), although the spec describes only the block.
  • No automatic reconnection on session sockets: respond and tool_result are not idempotent. Dispatch redials its own socket (see below).

Sessions and tools

  • The watch loop starts when the session opens and handles tool_call and tool_cancel itself, so a tool runs whether or not anybody iterates EventsAsync. At most 16 run at once; a tool that throws is answered with its message, because the model is mid-sentence waiting.
  • EventsAsync has one reader over a bounded 256-slot channel that drops the oldest.
  • CloseAsync sends close over an open socket, else DELETEs the session; a 404 is fine.
  • Rewinding a conversation kept in Stream Chat is refused by the router (400, "fork it at the response"); ForkAsync(new ForkOptions { ResponseId = ... }) is the way.

Agent and folder

  • Sessions own their call, agent:<session id>. JoinAsync opens one with start_voice; JoinAsync(InboundCall) opens the session the call names, with voice; ChatAsync sends no start_voice; Session.Voice starts and stops it later. OutboundCallAsync places the call first, then joins the session it returns with navigating; WaitForCallAsync attaches the number, waits on a one-call Dispatch for the router to hand a call over, joins it and returns once somebody speaks. ResumeAsync(id) reads a session and watches it.
  • Instructions reach the backend only through SyncAsync; nothing sends them per session.
  • Config is a directory holding agent.yaml or a stored config's name; ConfigId is a stored config by id, which is what a dispatched message carries. Naming both is refused.
  • What code sets wins over what the directory says.
  • SyncAsync is one POST /v1/agents/sync. The fingerprint is MD5, ported byte for byte from Go (Folder.Fingerprint, Folder.GoMap for Go's %v of a map), so .agent_sync written by Go or Python is read back here. The fixture hash 02a7b2c8428f31e3a2b93ca2f5a6ec70 is pinned in FolderTests; if it changes, Go changed first or this is wrong. The stamp is written with relaxed escaping, since System.Text.Json would otherwise write the + of the offset as \u002B.

Dispatch

  • Handlers run off the read loop in Task.Run, tracked by id in a ConcurrentDictionary whose entry is removed before the tracking task completes, so Active is exact once RunAsync has drained.
  • RunAsync returns quietly when cancelled, even during connect, then drains work in flight and closes the agents it made. Dropping work would hang up on whoever is talking.
  • GetOrCreateAgentAsync keeps one agent per channel while its session is live, and opens chats with the message's AgentId, as Go and Python do.
  • Host(client, toolTimeout) sends host_tools for client.Tools with every_agent: true after every ready; client.RunDispatchAsync() hosts them alone. Hosted calls are tracked work like calls, and hosting_refused throws out of RunAsync. A connection that ends without a normal close is redialled with backoff (1s doubling to 30s), as in Go. This is the one socket that reconnects: dispatch frames belong to one connection.

Tests

xUnit v3 (4.0.1) on the Microsoft Testing Platform (global.json sets the runner), because .NET 10's dotnet test no longer drives VSTest here. Never mock.

  • TestRouter is a real Kestrel server on loopback port 0 with real WebSocket upgrades. It records what arrived and lets a test script frames. Assert on what reached the far end.
  • Getstream-net is pointed at the same server through EdgeOptions.BaseUrl, so a test can assert that no Stream call is created.
  • LiveTests skip unless VISION_AGENTS_LIVE_URL is set. They hold real conversations and wait for what the router writes behind a request instead of sleeping.

Häufig gestellte Fragen

Was macht der KI-Skill Sdk Dotnet?

How to build and extend the .NET SDK in sdks/dotnet. Read this before changing the client, the socket, the agent, dispatch or the router, before regenerating the models, or before reaching for a NuGet package.

Warum Sdk Dotnet in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Sdk Dotnet besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Sdk Dotnet in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/GetStream/Agents/tree/main/.claude/skills/sdk-dotnet ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Sdk Dotnet nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Sdk Dotnet verwenden?

So viele Sie möchten. In TypingMind können Sie Sdk Dotnet mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Sdk Dotnet kostenlos?

Ja. Der Skill wird von GetStream auf GitHub unter der Lizenz Apache-2.0 veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇