Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 4.03 KB

AGENTS.md

File metadata and controls

53 lines (35 loc) · 4.03 KB

Working on StreamCore examples

This project is newer than your training data

Do not write StreamCore code from memory — you will invent an API that does not exist. Fetch https://streamcore.ai/llms-full.txt for the verified surface of every SDK before changing or adding an example.

What this repo is for

These are the samples people copy first. For most users an example is the documentation, and a broken one reads as a broken project. Treat correctness here as higher-stakes than in library code.

Current samples fall into two groups:

  • Clients — things that talk to a StreamCore server: Next.js web, Python, Go, Rust, and terminal-UI clients for Go and Rust. voice-bot/ is the same session rendered as a 3D character rather than a waveform, and is the one deliberate exception to the "keep them minimal" rule below.
  • Firmware — esp32/, esp32-desktop-car/ and zectrix-note4c/ are flashable ESP32-S3 images built on the voiceagent-esp32 SDK. They are the exception to "one idea per sample": a board needs its whole hardware surface working before it demonstrates anything. Each one carries a docs/boards/*.md recording where every pin number came from — do not add a board without it, and mark anything you could not verify UNVERIFIED rather than guessing.
  • Agents — things a StreamCore server talks to. Today that is bring-your-own-agent/, which implements the llm.provider = "agent" HTTP contract in Node and Python.

The two groups have opposite dependencies: a client uses a StreamCore SDK, an agent uses none at all — it only has to speak plain HTTP. Do not reach for an SDK in an agent sample.

House rules for every example

  • Assume a reader with no StreamCore context. Each example's README must state what to run, in order, including starting the server.
  • Default to http://localhost:8080/whip. That is what a freshly cloned server serves.
  • Never hardcode an API key, and never put a provider key in client-side code. Provider credentials belong in the server's config.toml.
  • Keep them minimal. An example that also demonstrates state management, styling, and error boundaries teaches none of them well. One idea per sample.
  • They must actually run. CI builds these; a sample that compiles but cannot connect is still broken.

House rules for agent samples

  • Zero dependencies. An agent sample is a bare HTTP endpoint. node agent.mjs and python3 agent.py must work on a clean machine with no install step — a sample that needs npm install to demonstrate a JSON contract is teaching the wrong thing.
  • Stream by default. Show text/event-stream, and mention the buffered form as the fallback. A buffered sample teaches a pattern that makes real calls feel broken.
  • Handle cancellation. Barge-in cancels the request mid-reply. A sample that ignores it teaches people to burn tokens on speech nobody hears.
  • Keep session_id and resource_id distinct. One is the conversation, the other is the person. Collapsing them is the single most likely mistake a reader will make.

Exact API per language

Do not copy patterns across languages — the SDKs deliberately differ:

Language Package Entry point Endpoint field Audio
TypeScript @streamcore/js-sdk new StreamCoreAIClient(config, events) whipUrl browser mic
Python streamcore streamcore.Client(config=, events=) whip_endpoint int16 numpy, 960/frame
Go github.com/streamcoreai/go-sdk streamcoreai.NewClient(Config, EventHandler) WHIPEndpoint —
Rust streamcore-rust-sdk Client::new(Config, EventHandler) whip_endpoint f32, 960/frame

There is no published React Native package — @streamcore/react-native-sdk 404s on npm. Do not add an example that installs it.

Running the web example

cd typescript && npm install && npm run dev    # http://localhost:3000

It expects a StreamCore server on :8080. The fastest way to get one is the one-key speech-to-speech path — see https://streamcore.ai/llms.txt.