Quickstart
Import github.com/goppydae/sharur/sdk to embed an agent in any Go program.
Config Fields
Core API
| Call | Description |
|---|---|
sdk.NewAgent(cfg) | Create and initialize an agent |
ag.Subscribe(fn) | Register an event handler; called for every emitted event |
ag.Prompt(ctx, text) | Send a user message and start the agent loop |
ag.Idle() | Returns a channel that closes when the agent reaches Idle state |
ag.Steer(ctx, text) | Inject a steering message into the running turn |
ag.FollowUp(ctx, text) | Queue a message to process after the current turn |
ag.Abort(ctx) | Cancel the current running turn |
ag.SetExtensions(exts) | Replace the extension list (takes effect on next prompt) |
Event Types
Subscribe to events by checking e.Type:
| Event type | Payload field | Description |
|---|---|---|
EventAgentStart | — | Agent loop started |
EventAgentEnd | — | Agent loop completed |
EventTurnStart | — | LLM turn started |
EventTurnEnd | — | LLM turn completed |
EventTextDelta | e.Content | Incremental response text |
EventThinkingDelta | e.Content | Incremental thinking text |
EventToolCall | e.ToolCall | Tool invocation started |
EventToolDelta | e.Content | Streaming tool output |
EventToolOutput | e.ToolOutput | Final tool result |