agent

command
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

README

Agent Example — Struct / Method Receiver Style

Demonstrates AgentRunner, a struct with injected dependencies (OpenAIClient, Database) that implements durable.Task directly via an Exec method.

This is the idiomatic pattern for production services and local AI agents where dependencies are constructed once and reused across task runs.

Run

go run .

Reset

rm examples/agent/.data/agent.db

Documentation

Overview

Package main demonstrates the struct / method-receiver style of durable-go. AgentRunner is a production-style struct with injected dependencies. It implements durable.Task[AgentInput, AgentOutput] so it can be passed directly to durable.Run – no adapter or wrapper needed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL