quick

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 6 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (*agent.BaseAgent, error)

New creates a BaseAgent with minimal configuration.

Types

type Option

type Option func(*options)

Option configures the agent created by New.

func WithAPIKey

func WithAPIKey(key string) Option

WithAPIKey overrides the API key for provider shortcuts (WithOpenAI, etc.).

func WithAnthropic

func WithAnthropic(model string) Option

WithAnthropic creates an Anthropic Claude provider using the given model. API key is read from ANTHROPIC_API_KEY environment variable.

func WithDeepSeek

func WithDeepSeek(model string) Option

WithDeepSeek creates a DeepSeek provider using the given model. API key is read from DEEPSEEK_API_KEY environment variable.

func WithLogger

func WithLogger(logger *zap.Logger) Option

WithLogger sets a custom zap logger. Defaults to zap.NewNop().

func WithModel

func WithModel(model string) Option

WithModel sets the model name. Overrides the model set by provider shortcuts.

func WithName

func WithName(name string) Option

WithName sets the agent name.

func WithOpenAI

func WithOpenAI(model string) Option

WithOpenAI creates an OpenAI provider using the given model. API key is read from OPENAI_API_KEY environment variable.

func WithProvider

func WithProvider(p llm.Provider) Option

WithProvider sets a pre-built LLM provider.

func WithSystemPrompt

func WithSystemPrompt(prompt string) Option

WithSystemPrompt sets the system prompt for the agent.

Jump to

Keyboard shortcuts

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