Documentation
¶
Index ¶
- Variables
- func CompileGraph[T, V any](rail flow.Rail, o *GenericOps, g *compose.Graph[T, V], ...) (compose.Runnable[T, V], error)
- func NewExecutiveSummaryWriterOps(g *GenericOps) *executiveSummaryWriterOps
- func NewOpenAIChatModel(model, apiKey string, ops ...func(o *openAiModelConfig)) (model.ToolCallingChatModel, error)
- func RetryChatModel(c model.ToolCallingChatModel) model.ToolCallingChatModel
- func WithMaxToken(n int) func(o *openAiModelConfig)
- func WithRetry(n int) func(o *openAiModelConfig)
- func WithTemperature(n float32) func(o *openAiModelConfig)
- func WithTraceCallback(name string, logInputs bool) compose.Option
- type DeepResearchClarifier
- type DeepResearchClarifierInput
- type DeepResearchClarifierOps
- type DeepResearchClarifierOutput
- type ExecutiveSummaryWriter
- type ExecutiveSummaryWriterInput
- type ExecutiveSummaryWriterOutput
- type ExtractFieldSpec
- type ExtractFieldSpecs
- type GenericOps
- type Material
- type MaterialExtract
- type MaterialExtractInput
- type MaterialExtractOps
- type MaterialExtractOutput
- type MemorySummarizer
- type MemorySummarizerInput
- type MemorySummarizerOps
- type MemorySummarizerOutput
- type MermaidGenerator
- type Rule
- type RuleMatcher
- type RuleMatcherInput
- type RuleMatcherOps
- type RuleMatcherOutput
- type RuleResult
Constants ¶
This section is empty.
Variables ¶
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 NewExecutiveSummaryWriterOps ¶
func NewExecutiveSummaryWriterOps(g *GenericOps) *executiveSummaryWriterOps
func NewOpenAIChatModel ¶
func NewOpenAIChatModel(model, apiKey string, ops ...func(o *openAiModelConfig)) (model.ToolCallingChatModel, error)
func RetryChatModel ¶
func RetryChatModel(c model.ToolCallingChatModel) model.ToolCallingChatModel
func WithMaxToken ¶
func WithMaxToken(n int) func(o *openAiModelConfig)
func WithTemperature ¶
func WithTemperature(n float32) func(o *openAiModelConfig)
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
func (w *DeepResearchClarifier) Execute(rail flow.Rail, input DeepResearchClarifierInput) (DeepResearchClarifierOutput, error)
type DeepResearchClarifierInput ¶ added in v0.0.4
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 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 ¶
func (w *ExecutiveSummaryWriter) Execute(rail flow.Rail, input ExecutiveSummaryWriterInput) (*ExecutiveSummaryWriterOutput, error)
type ExecutiveSummaryWriterOutput ¶
type ExecutiveSummaryWriterOutput struct {
Summary string `json:"summary"`
}
type ExtractFieldSpec ¶ added in v0.0.6
type ExtractFieldSpecs ¶ added in v0.0.6
type ExtractFieldSpecs []ExtractFieldSpec
type GenericOps ¶ added in v0.0.4
type GenericOps struct {
MaxRunSteps int
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 MaterialExtract ¶ added in v0.0.6
type MaterialExtract struct {
// contains filtered or unexported fields
}
func NewMaterialExtract ¶ added in v0.0.6
func NewMaterialExtract(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *MaterialExtractOps) (*MaterialExtract, error)
func (*MaterialExtract) Execute ¶ added in v0.0.6
func (b *MaterialExtract) Execute(rail flow.Rail, input MaterialExtractInput) (MaterialExtractOutput, error)
Execute.
If there are lots of fields, use MaterialExtract.ParallelExecute instead.
func (*MaterialExtract) ParallelExecute ¶ added in v0.0.9
func (b *MaterialExtract) ParallelExecute(rail flow.Rail, input MaterialExtractInput, batchSize int, pool async.AsyncPool) (MaterialExtractOutput, error)
type MaterialExtractInput ¶ added in v0.0.6
type MaterialExtractInput struct {
Context string `json:"context"`
Materials []Material `json:"materials"`
Fields []ExtractFieldSpec `json:"fields"`
// contains filtered or unexported fields
}
type MaterialExtractOps ¶ added in v0.0.6
type MaterialExtractOps struct {
// Injected variables: ${context}, ${language}, ${now}
SystemMessagePrompt string
// Injected variables: ${materials}, ${fields}, ${extractedInfo}
UserMessagePrompt string
TimeZoneHourOffset float64
// contains filtered or unexported fields
}
func NewMaterialExtractOps ¶ added in v0.0.6
func NewMaterialExtractOps(g *GenericOps) *MaterialExtractOps
type MaterialExtractOutput ¶ added in v0.0.6
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
func (w *MemorySummarizer) Execute(rail flow.Rail, input MemorySummarizerInput) (MemorySummarizerOutput, error)
type MemorySummarizerInput ¶ added in v0.0.5
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".
type RuleMatcher ¶ added in v0.0.6
type RuleMatcher struct {
// contains filtered or unexported fields
}
func NewRuleMatcher ¶ added in v0.0.6
func NewRuleMatcher(rail flow.Rail, chatModel model.ToolCallingChatModel, ops *RuleMatcherOps) (*RuleMatcher, error)
func (*RuleMatcher) Execute ¶ added in v0.0.6
func (b *RuleMatcher) Execute(rail flow.Rail, input RuleMatcherInput) (RuleMatcherOutput, error)
Execute.
If there are lots of rules, use RuleMatcher.ParallelExecute instead.
func (*RuleMatcher) ParallelExecute ¶ added in v0.0.9
func (b *RuleMatcher) ParallelExecute(rail flow.Rail, input RuleMatcherInput, batchSize int, pool async.AsyncPool) (RuleMatcherOutput, error)
type RuleMatcherInput ¶ added in v0.0.6
type RuleMatcherInput struct {
// Additional instruction about the task
//
// How should LLM make decision on whether the target matches the given rule or not.
TaskInstruction string `json:"taskInstruction"`
// context about the target
//
// e.g., if we are running a background check for a company, the context will be the information about the company.
Context string `json:"context"`
// Rules
Rules []Rule `json:"Rules"`
// contains filtered or unexported fields
}
type RuleMatcherOps ¶ added in v0.0.6
type RuleMatcherOps struct {
// Injected variables: ${taskInstruction}, ${language}, ${now}
SystemMessagePrompt string
// Injected variables: ${rule}, ${context}
UserMessagePrompt string
TimeZoneHourOffset float64
// contains filtered or unexported fields
}
func NewRuleMatcherOps ¶ added in v0.0.6
func NewRuleMatcherOps(g *GenericOps) *RuleMatcherOps
type RuleMatcherOutput ¶ added in v0.0.6
type RuleMatcherOutput struct {
Rules []RuleResult `json:"rules"`
}