formatOutput 格式化输出为字符串
(output any)
| 139 | |
| 140 | // formatOutput 格式化输出为字符串 |
| 141 | func (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 历史 |
| 161 | func (wa *WorkflowAgent) GetWorkflowHistory() []WorkflowHistoryItem { |
no outgoing calls
no test coverage detected