Documentation
¶
Overview ¶
Command sdk-example is a minimal demonstration of embedding the pig coding agent as a Go library via the public `coding` package.
What it does:
- Constructs a coding.AgentSessionServices dependency container pointed at a temporary working directory.
- Builds a coding.Runtime over that container (no extensions, no custom tools).
- Creates a fresh coding.Session and sends a single user prompt.
- Prints the assistant's reply.
Prerequisites:
- You must have authed at least once with the standalone pig binary so a valid auth.json exists at $PIG_HOME/agent/auth.json (or ~/.pig/agent/auth.json on macOS/Linux).
- The model "github-copilot/gpt-4o-mini" must be available in your environment. Adjust the modelID const below to use a different provider/model combo.
Run from the repo root:
go run ./examples/sdk
Library consumers writing their own integrations can use this program as a starting template. See coding/doc.go for the full public API reference.
Click to show internal directories.
Click to hide internal directories.