MCPcopy Create free account
hub / github.com/astercloud/aster / NewWorkflowAgent

Function NewWorkflowAgent

pkg/workflow/workflow_agent.go:29–46  ·  view source on GitHub ↗

NewWorkflowAgent 创建新的 WorkflowAgent

(model, instructions string, addHistory bool, numRuns int)

Source from the content-addressed store, hash-verified

27
28// NewWorkflowAgent 创建新的 WorkflowAgent
29func NewWorkflowAgent(model, instructions string, addHistory bool, numRuns int) *WorkflowAgent {
30 defaultInstructions := `You are a workflow orchestration agent. Your job is to help users by either:
311. Answering directly from workflow history if the question can be answered
322. Running the workflow when needed for new queries`
33
34 if instructions == "" {
35 instructions = defaultInstructions
36 }
37
38 return &WorkflowAgent{
39 ID: uuid.New().String(),
40 Name: "WorkflowAgent",
41 Instructions: instructions,
42 Model: model,
43 AddWorkflowHistory: addHistory,
44 NumHistoryRuns: numRuns,
45 }
46}
47
48// AttachWorkflow 将 workflow 附加到 agent
49func (wa *WorkflowAgent) AttachWorkflow(wf *Workflow) *WorkflowAgent {

Callers 2

demoWorkflowAgentFunction · 0.92
testWorkflowAgentFunction · 0.92

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected