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

Method formatOutput

pkg/workflow/workflow_agent.go:141–158  ·  view source on GitHub ↗

formatOutput 格式化输出为字符串

(output any)

Source from the content-addressed store, hash-verified

139
140// formatOutput 格式化输出为字符串
141func (wa *WorkflowAgent) formatOutput(output any) string {
142 if output == nil {
143 return ""
144 }
145
146 switch v := output.(type) {
147 case string:
148 return v
149 case []byte:
150 return string(v)
151 default:
152 jsonBytes, err := json.Marshal(v)
153 if err != nil {
154 return fmt.Sprintf("%v", v)
155 }
156 return string(jsonBytes)
157 }
158}
159
160// GetWorkflowHistory 获取 workflow 历史
161func (wa *WorkflowAgent) GetWorkflowHistory() []WorkflowHistoryItem {

Callers 2

executeWorkflowMethod · 0.95
RunMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected