SDK Examples
Example: Minimal Local Agent
A minimal runnable local Agent SDK example
Example: Minimal Local Agent
import { Agent } from "@downcity/agent";
import { Workspace } from "@downcity/workspace";
const agent = new Agent({
id: "repo-helper",
tools: {},
});
const workspace = new Workspace({
id: "project",
path: "/path/to/project",
});Then:
const session = await agent.sessions.create({ workspace });
await session.set({ model });
const turn = await session.prompt({ query: "Continue" });
await turn.finished;This minimal example is useful for validating three things first:
- whether
Agentcan be constructed successfully - whether
Sessioncan be created successfully - whether the model can execute successfully