Documentation
¶
Index ¶
- Constants
- func NewOpenAILLM(apiKey string, model string) *openAILLM
- type AgentContext
- type AgenticLLMNode
- type AugmentedLLMNode
- type AugmentedLLMNodeOption
- func WithAugmentedChildren(children ...WorkflowNode) AugmentedLLMNodeOption
- func WithAugmentedID(id string) AugmentedLLMNodeOption
- func WithAugmentedLLMOptions(opts LLMOptions) AugmentedLLMNodeOption
- func WithAugmentedPromptTemplate(template string) AugmentedLLMNodeOption
- func WithAugmentedSystemPrompt(prompt string) AugmentedLLMNodeOption
- func WithAugmentedTools(tools ...LLMTool) AugmentedLLMNodeOption
- type BaseNode
- type DummyLLM
- type DummyMemory
- type LLM
- type LLMCallNode
- type LLMCallOption
- type LLMFunctionCall
- type LLMMessage
- type LLMOptions
- type LLMTool
- type LLMToolCall
- type LLMToolFieldProperty
- type Memory
- type MemoryAndStreamingConfig
- type NodeType
- type OutputNode
- type Pipeline
- type ReverseLLM
- type RunContext
- func (rc *RunContext) AddError(key string, err error)
- func (rc *RunContext) AddInput(key string, value string)
- func (rc *RunContext) AddMessage(key string, value LLMMessage)
- func (rc *RunContext) AddOutput(key string, value string)
- func (rc *RunContext) GetError(key string) (error, bool)
- func (rc *RunContext) GetInput(key string) (string, bool)
- func (rc *RunContext) GetMessages(key string) ([]LLMMessage, bool)
- func (rc *RunContext) GetOutput(key string) (string, bool)
- type WorkflowNode
Constants ¶
View Source
const DefaultAugmentedSystemPrompt = `` /* 1674-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewOpenAILLM ¶
Types ¶
type AgentContext ¶
type AgenticLLMNode ¶
type AugmentedLLMNode ¶
type AugmentedLLMNode struct {
BaseNode
LLMOptions LLMOptions
Children []WorkflowNode
// contains filtered or unexported fields
}
func NewAugmentedLLMNode ¶
func NewAugmentedLLMNode(opts ...AugmentedLLMNodeOption) *AugmentedLLMNode
func (*AugmentedLLMNode) Execute ¶
func (e *AugmentedLLMNode) Execute(ctx context.Context, agentContext AgentContext, runCtx *RunContext, nodeInput ...string) (string, error)
type AugmentedLLMNodeOption ¶
type AugmentedLLMNodeOption func(*AugmentedLLMNode)
func WithAugmentedChildren ¶
func WithAugmentedChildren(children ...WorkflowNode) AugmentedLLMNodeOption
func WithAugmentedID ¶
func WithAugmentedID(id string) AugmentedLLMNodeOption
func WithAugmentedLLMOptions ¶
func WithAugmentedLLMOptions(opts LLMOptions) AugmentedLLMNodeOption
func WithAugmentedPromptTemplate ¶
func WithAugmentedPromptTemplate(template string) AugmentedLLMNodeOption
func WithAugmentedSystemPrompt ¶
func WithAugmentedSystemPrompt(prompt string) AugmentedLLMNodeOption
func WithAugmentedTools ¶
func WithAugmentedTools(tools ...LLMTool) AugmentedLLMNodeOption
type DummyMemory ¶
type DummyMemory struct {
// contains filtered or unexported fields
}
func NewDummyMemory ¶
func NewDummyMemory() *DummyMemory
type LLM ¶
type LLM interface {
Generate(ctx context.Context, options LLMOptions, tools []LLMTool, prompt string, messages ...LLMMessage) (LLMMessage, error)
}
type LLMCallNode ¶
type LLMCallNode struct {
BaseNode
SystemPrompt string
PromptTemplate string
LLMOptions LLMOptions
LLMTools []LLMTool
Children []WorkflowNode
}
func NewLLmCallNode ¶
func NewLLmCallNode(opts ...LLMCallOption) *LLMCallNode
func (*LLMCallNode) Execute ¶
func (e *LLMCallNode) Execute(ctx context.Context, agentContext AgentContext, runContext *RunContext, nodeInput ...string) (string, error)
type LLMCallOption ¶
type LLMCallOption func(*LLMCallNode)
func WithChildren ¶
func WithChildren(children ...WorkflowNode) LLMCallOption
func WithID ¶
func WithID(id string) LLMCallOption
func WithLLMOptions ¶
func WithLLMOptions(opts LLMOptions) LLMCallOption
func WithPropmtTemplate ¶
func WithPropmtTemplate(prompt string) LLMCallOption
func WithSystemPrompt ¶
func WithSystemPrompt(prompt string) LLMCallOption
type LLMFunctionCall ¶
type LLMFunctionCall struct {
// contains filtered or unexported fields
}
type LLMMessage ¶
type LLMMessage struct {
// contains filtered or unexported fields
}
type LLMOptions ¶
type LLMTool ¶
type LLMTool struct {
Name string
Description string
Params map[string]LLMToolFieldProperty
Executor func(map[string]any) (string, error)
}
TODO: API to pass tools to LLM, each node could have an individual LLM Need to pass the model to the llm
type LLMToolCall ¶
type LLMToolCall struct {
// contains filtered or unexported fields
}
type LLMToolFieldProperty ¶
type OutputNode ¶
func NewOutputNode ¶
func NewOutputNode(id string, fromNode string, visible bool) *OutputNode
func (*OutputNode) Execute ¶
func (n *OutputNode) Execute(ctx context.Context, agentContext AgentContext, runContext *RunContext, input ...string) (string, error)
type Pipeline ¶
type Pipeline struct {
Name string
Root WorkflowNode
LLM LLM
Memory Memory
}
Holds and executes all the pipeline components
func NewPipeline ¶
func NewPipeline(name string, rootNode WorkflowNode, llm LLM, memory Memory) *Pipeline
type ReverseLLM ¶
type ReverseLLM struct{}
func (*ReverseLLM) Generate ¶
func (d *ReverseLLM) Generate(options LLMOptions, tools []LLMTool, systemPrompt string, messages ...LLMMessage) (string, error)
type RunContext ¶
type RunContext struct {
RunID string
NodeInputs map[string]string
NodeOutputs map[string]string
NodeErrors map[string]error
StreamWriter io.Writer
MessageHistory map[string][]LLMMessage
// contains filtered or unexported fields
}
func NewRunContext ¶
func NewRunContext(runID string, w io.Writer) *RunContext
func (*RunContext) AddError ¶
func (rc *RunContext) AddError(key string, err error)
func (*RunContext) AddInput ¶
func (rc *RunContext) AddInput(key string, value string)
func (*RunContext) AddMessage ¶
func (rc *RunContext) AddMessage(key string, value LLMMessage)
func (*RunContext) AddOutput ¶
func (rc *RunContext) AddOutput(key string, value string)
func (*RunContext) GetMessages ¶
func (rc *RunContext) GetMessages(key string) ([]LLMMessage, bool)
type WorkflowNode ¶
type WorkflowNode interface {
ID() string
Execute(ctx context.Context, agentContext AgentContext, runContext *RunContext, input ...string) (string, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.