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

Function printEvent

examples/workflow-agents/main.go:268–298  ·  view source on GitHub ↗

============================================================ 辅助函数 ============================================================

(event *session.Event)

Source from the content-addressed store, hash-verified

266// ============================================================
267
268func printEvent(event *session.Event) {
269 if event == nil {
270 return
271 }
272
273 // 打印基本信息
274 fmt.Printf(" ✓ [%s] %s\n", event.AgentID, event.Content.Content)
275
276 // 打印元数据
277 if branch := event.Branch; branch != "" {
278 fmt.Printf(" Branch: %s\n", branch)
279 }
280
281 // 打印特殊元数据
282 if index, ok := event.Metadata["parallel_index"].(int); ok {
283 fmt.Printf(" 并行索引: %d\n", index)
284 }
285
286 if step, ok := event.Metadata["sequential_step"].(int); ok {
287 total := event.Metadata["total_steps"].(int)
288 fmt.Printf(" 步骤: %d/%d\n", step, total)
289 }
290
291 if iter, ok := event.Metadata["loop_iteration"].(uint); ok {
292 fmt.Printf(" 迭代: %d\n", iter)
293 }
294
295 if score, ok := event.Metadata["quality_score"].(int); ok {
296 fmt.Printf(" 质量分数: %d/100\n", score)
297 }
298}

Callers 4

sequentialExampleFunction · 0.85
parallelExampleFunction · 0.85
loopExampleFunction · 0.85
nestedExampleFunction · 0.85

Calls 1

PrintfMethod · 0.80

Tested by

no test coverage detected