Documentation
¶
Overview ¶
Package agentflow provides a top-level convenience entry point for creating agents with minimal boilerplate.
Usage:
import "github.com/BaSui01/agentflow"
a, err := agentflow.New(agentflow.WithOpenAI("gpt-4o-mini"))
a, err := agentflow.New(agentflow.WithAnthropic("claude-sonnet-4-20250514"))
a, err := agentflow.New(agentflow.WithProvider(myProvider), agentflow.WithModel("custom"))
This is a thin wrapper around quick.New; both produce identical results. Use this package when you prefer the shorter import path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var WithAPIKey = quick.WithAPIKey
WithAPIKey overrides the API key for provider shortcuts.
var WithAnthropic = quick.WithAnthropic
WithAnthropic creates an Anthropic Claude provider. API key from ANTHROPIC_API_KEY env.
var WithDeepSeek = quick.WithDeepSeek
WithDeepSeek creates a DeepSeek provider. API key from DEEPSEEK_API_KEY env.
var WithLogger = quick.WithLogger
WithLogger sets a custom zap logger.
var WithModel = quick.WithModel
WithModel overrides the model name.
var WithName = quick.WithName
WithName sets the agent name.
var WithOpenAI = quick.WithOpenAI
WithOpenAI creates an OpenAI provider. API key from OPENAI_API_KEY env.
var WithProvider = quick.WithProvider
WithProvider sets a pre-built LLM provider.
var WithSystemPrompt = quick.WithSystemPrompt
WithSystemPrompt sets the system prompt.
Functions ¶
func New ¶
New creates a agent.BaseAgent with minimal configuration. At minimum, a provider must be specified via WithOpenAI, WithAnthropic, WithDeepSeek, or WithProvider.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
persistence/mongodb
Package mongodb provides adapter types that bridge the concrete MongoDB store implementations to the agent-layer interfaces defined in agent/interfaces.go.
|
Package mongodb provides adapter types that bridge the concrete MongoDB store implementations to the agent-layer interfaces defined in agent/interfaces.go. |
|
plugins
Package plugins provides AgentPlugin implementations for optional agent features.
|
Package plugins provides AgentPlugin implementations for optional agent features. |
|
cmd
|
|
|
agentflow
command
|
|
|
config 包的 HTTP 配置管理 API。
|
config 包的 HTTP 配置管理 API。 |
|
examples
|
|
|
01_simple_chat
command
|
|
|
02_streaming
command
|
|
|
03_tool_use
command
|
|
|
04_custom_agent
command
|
|
|
05_workflow
command
|
|
|
06_advanced_features
command
|
|
|
07_mid_priority_features
command
|
|
|
08_low_priority_features
command
|
|
|
09_full_integration
command
|
|
|
11_multi_provider_apis
command
|
|
|
12_complete_rag_system
command
|
|
|
13_new_providers
command
|
|
|
14_guardrails
command
|
|
|
15_structured_output
command
|
|
|
16_a2a_protocol
command
|
|
|
17_high_priority_features
command
示例 17:高优先级功能演示 演示内容:产物管理、HITL 中断、OpenAPI 工具、部署、增强检查点与可视化构建
|
示例 17:高优先级功能演示 演示内容:产物管理、HITL 中断、OpenAPI 工具、部署、增强检查点与可视化构建 |
|
18_advanced_agent_features
command
|
|
|
19_2026_features
command
|
|
|
20_multimodal_providers
command
示例:使用多模态能力(向量、重排、语音合成、语音识别、图像)
|
示例:使用多模态能力(向量、重排、语音合成、语音识别、图像) |
|
21_research_workflow
command
|
|
|
internal
|
|
|
factory
Package factory provides a centralized factory for creating LLM Provider instances by name.
|
Package factory provides a centralized factory for creating LLM Provider instances by name. |
|
pkg
|
|
|
mongodb
Package mongodb provides MongoDB client management for agentflow.
|
Package mongodb provides MongoDB client management for agentflow. |
|
service
Package service defines a unified lifecycle interface for application services.
|
Package service defines a unified lifecycle interface for application services. |
|
tlsutil
Package tlsutil provides centralized TLS configuration for all HTTP clients, servers, and Redis connections in agentflow.
|
Package tlsutil provides centralized TLS configuration for all HTTP clients, servers, and Redis connections in agentflow. |
|
============================================================================= Package quick — One-Line Agent Construction ============================================================================= Provides a convenience entry point for creating agents with minimal boilerplate.
|
============================================================================= Package quick — One-Line Agent Construction ============================================================================= Provides a convenience entry point for creating agents with minimal boilerplate. |
|
Config → RAG 桥接层。
|
Config → RAG 桥接层。 |
|
testutil 通用测试辅助与断言工具。
|
testutil 通用测试辅助与断言工具。 |
|
fixtures
fixtures 中的 Agent 测试数据工厂。
|
fixtures 中的 Agent 测试数据工厂。 |
|
mocks
MockMemoryManager 的测试模拟实现。
|
MockMemoryManager 的测试模拟实现。 |
|
tools
|
|