agents

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DeepseekBaseURL       = "https://api.deepseek.com/v1"
	OpenAIBaseURL         = "https://api.openai.com/v1"
	AliBailianIntlBaseURL = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
	AliBailianCnBaseURL   = "https://dashscope.aliyuncs.com/compatible-mode/v1"
)

Functions

func CompileGraph

func CompileGraph[T, V any](rail flow.Rail, o *GenericOps, g *compose.Graph[T, V], opts ...compose.GraphCompileOption) (compose.Runnable[T, V], error)

func NewExecutiveSummaryWriterOps

func NewExecutiveSummaryWriterOps(g *GenericOps) *executiveSummaryWriterOps

func NewOpenAIChatModel

func NewOpenAIChatModel(model, apiKey string, ops ...func(o *openAiModelConfig)) (model.ToolCallingChatModel, error)

func WithMaxToken

func WithMaxToken(n int) func(o *openAiModelConfig)

func WithRetry

func WithRetry(n int) func(o *openAiModelConfig)

func WithTemperature

func WithTemperature(n float32) func(o *openAiModelConfig)

func WithTraceCallback

func WithTraceCallback(name string, logInputs bool) compose.Option

Types

type DeepResearchClarifier added in v0.0.4

type DeepResearchClarifier struct {
	// contains filtered or unexported fields
}

func NewDeepResearchClarifier added in v0.0.4

func NewDeepResearchClarifier(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *DeepResearchClarifierOps) (*DeepResearchClarifier, error)

func (*DeepResearchClarifier) Execute added in v0.0.4

type DeepResearchClarifierInput added in v0.0.4

type DeepResearchClarifierInput struct {
	Now          string `json:"now"`
	Conversation string `json:"conversation"`
	Memory       string `json:"memory"`
}

type DeepResearchClarifierOps added in v0.0.4

type DeepResearchClarifierOps struct {

	// Injected variables: ${language}
	SystemMessagePrompt string

	// Injected variables: ${now} ${conversation}, ${memory}
	UserMessagePrompt string
	// contains filtered or unexported fields
}

func NewDeepResearchClarifierOps added in v0.0.4

func NewDeepResearchClarifierOps(g *GenericOps) *DeepResearchClarifierOps

type DeepResearchClarifierOutput added in v0.0.4

type DeepResearchClarifierOutput struct {
	Title       string `json:"title"`
	Description string `json:"description"`
}

type ExecutiveSummaryWriter

type ExecutiveSummaryWriter struct {
	// contains filtered or unexported fields
}

func NewExecutiveSummaryWriter

func NewExecutiveSummaryWriter(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *executiveSummaryWriterOps) (*ExecutiveSummaryWriter, error)

func (*ExecutiveSummaryWriter) Execute

type ExecutiveSummaryWriterInput

type ExecutiveSummaryWriterInput struct {
	Report  string `json:"report"`
	Context string `json:"context"`
}

type ExecutiveSummaryWriterOutput

type ExecutiveSummaryWriterOutput struct {
	Summary string `json:"summary"`
}

type GenericOps added in v0.0.4

type GenericOps struct {
	RepeatPrompt bool // Propmt Repeation: https://arxiv.org/html/2512.14982v1
	Now          string
	Language     string
	VisualizeDir string
	LogOnStart   bool
	LogInputs    bool
}

func NewGenericOps

func NewGenericOps() *GenericOps

type MemorySummarizer added in v0.0.5

type MemorySummarizer struct {
	// contains filtered or unexported fields
}

func NewMemorySummarizer added in v0.0.5

func NewMemorySummarizer(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *MemorySummarizerOps) (*MemorySummarizer, error)

func (*MemorySummarizer) Execute added in v0.0.5

type MemorySummarizerInput added in v0.0.5

type MemorySummarizerInput struct {
	LongTermMemory     string `json:"longTermMemory"`
	RecentConversation string `json:"recentConversation"`
}

type MemorySummarizerOps added in v0.0.5

type MemorySummarizerOps struct {

	// Injected variables: ${language}
	SystemMessagePrompt string

	// Injected variables: ${context}, ${report}
	UserMessagePrompt string
	// contains filtered or unexported fields
}

func NewMemorySummarizerOps added in v0.0.5

func NewMemorySummarizerOps(g *GenericOps) *MemorySummarizerOps

type MemorySummarizerOutput added in v0.0.5

type MemorySummarizerOutput struct {
	Summary string `json:"summary"`
}

type MermaidGenerator

type MermaidGenerator struct {
	// contains filtered or unexported fields
}

Credit: 2026-01-14, Copied from https://github.com/cloudwego/eino-examples/blob/main/devops/visualize/mermaid.go with modification.

MermaidGenerator renders a Mermaid diagram from a compiled Eino graph (Graph/Chain/Workflow).

Core concepts and mapping: - Nodes: labeled with their key and component type. Lambda nodes use rounded shapes. - Special nodes: START/END are rendered with safe IDs (start_node/end_node) to avoid Mermaid keyword conflicts. - SubGraphs: nested Graph/Chain/Workflow are rendered as Mermaid sub-graphs with their component type in the title. - Edges:

  • In general graphs/chains: a single solid arrow (-->), representing standard control+data execution.
  • In workflows (workflowStyle=true): edges are distinguished by semantics:
  • control+data: normal arrow with label "control+data" ("-- control+data -->")
  • control-only: bold arrow with label "control-only" ("== control-only ==>")
  • data-only: dotted arrow with label "data-only" ("-. data-only .->") Branch decision diamonds and their incoming/outgoing edges are treated as control-only in workflows.

Usage:

buf := &bytes.Buffer{}
gen := visualize.NewMermaidGenerator(buf)                // for Graph/Chain
// or
gen := visualize.NewMermaidGeneratorWorkflow(buf)        // for Workflow with labeled edges
_, _ = g.Compile(ctx, compose.WithGraphCompileCallbacks(gen), compose.WithGraphName("MyGraph"))
// Write to a Markdown file:
md := "```mermaid\n" + buf.String() + "\n```\n"
_ = os.WriteFile("my_graph.md", []byte(md), 0644)

func NewMermaidGenerator

func NewMermaidGenerator(dir string) *MermaidGenerator

NewMermaidGenerator creates a generator that auto-writes Markdown and attempts PNG/SVG generation. If dir is empty, current working directory is used. File name is derived from graph name or defaults to "topology".

func (*MermaidGenerator) OnFinish

func (m *MermaidGenerator) OnFinish(c context.Context, info *compose.GraphInfo)

OnFinish is the compile callback entrypoint invoked by Eino after graph compilation. It reads the compile-time GraphInfo and writes a complete Mermaid diagram to the writer.

Jump to

Keyboard shortcuts

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