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

Function handleProgressEvent

examples/agent/main.go:147–164  ·  view source on GitHub ↗
(event any)

Source from the content-addressed store, hash-verified

145}
146
147func handleProgressEvent(event any) {
148 switch e := event.(type) {
149 case *types.ProgressTextChunkEvent:
150 fmt.Print(e.Delta)
151 case *types.ProgressTextChunkStartEvent:
152 fmt.Print("\n[Assistant] ")
153 case *types.ProgressTextChunkEndEvent:
154 // 文本块结束
155 case *types.ProgressToolStartEvent:
156 fmt.Printf("\n[Tool Start] %s (ID: %s)\n", e.Call.Name, e.Call.ID)
157 case *types.ProgressToolEndEvent:
158 fmt.Printf("[Tool End] %s - State: %s\n", e.Call.Name, e.Call.State)
159 case *types.ProgressToolErrorEvent:
160 fmt.Printf("[Tool Error] %s - Error: %s\n", e.Call.Name, e.Error)
161 case *types.ProgressDoneEvent:
162 fmt.Printf("\n[Done] Step %d - Reason: %s\n", e.Step, e.Reason)
163 }
164}
165
166func handleMonitorEvent(event any) {
167 switch e := event.(type) {

Callers 1

mainFunction · 0.70

Calls 1

PrintfMethod · 0.80

Tested by

no test coverage detected