Documentation
¶
Overview ¶
============================================================================= Package quick — One-Line Agent Construction ============================================================================= Provides a convenience entry point for creating agents with minimal boilerplate. Delegates to agent.AgentBuilder and llm/factory internally.
The package lives under quick/ (not root) to avoid an import cycle: root → agent → memory → rag → config → api/handlers → agent.
Usage:
import "github.com/BaSui01/agentflow/quick"
a, err := quick.New(quick.WithOpenAI("gpt-4o-mini"))
a, err := quick.New(quick.WithAnthropic("claude-sonnet-4-20250514"))
a, err := quick.New(quick.WithProvider(myProvider), quick.WithModel("custom"))
=============================================================================
Index ¶
- func New(opts ...Option) (*agent.BaseAgent, error)
- type Option
- func WithAPIKey(key string) Option
- func WithAnthropic(model string) Option
- func WithDeepSeek(model string) Option
- func WithLogger(logger *zap.Logger) Option
- func WithModel(model string) Option
- func WithName(name string) Option
- func WithOpenAI(model string) Option
- func WithProvider(p llm.Provider) Option
- func WithSystemPrompt(prompt string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
Option configures the agent created by New.
func WithAPIKey ¶
WithAPIKey overrides the API key for provider shortcuts (WithOpenAI, etc.).
func WithAnthropic ¶
WithAnthropic creates an Anthropic Claude provider using the given model. API key is read from ANTHROPIC_API_KEY environment variable.
func WithDeepSeek ¶
WithDeepSeek creates a DeepSeek provider using the given model. API key is read from DEEPSEEK_API_KEY environment variable.
func WithLogger ¶
WithLogger sets a custom zap logger. Defaults to zap.NewNop().
func WithOpenAI ¶
WithOpenAI creates an OpenAI provider using the given model. API key is read from OPENAI_API_KEY environment variable.
func WithProvider ¶
WithProvider sets a pre-built LLM provider.
func WithSystemPrompt ¶
WithSystemPrompt sets the system prompt for the agent.