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

Method SetResult

pkg/tools/executor.go:192–202  ·  view source on GitHub ↗

SetResult 设置结果

(result any, err error)

Source from the content-addressed store, hash-verified

190
191// SetResult 设置结果
192func (b *ToolCallRecordBuilder) SetResult(result any, err error) *ToolCallRecordBuilder {
193 if err != nil {
194 b.record.Error = err.Error()
195 b.record.IsError = true
196 b.SetState(types.ToolCallStateFailed, "execution failed")
197 } else {
198 b.record.Result = result
199 b.SetState(types.ToolCallStateCompleted, "execution succeeded")
200 }
201 return b
202}
203
204// SetTiming 设置时间信息
205func (b *ToolCallRecordBuilder) SetTiming(startedAt, completedAt time.Time) *ToolCallRecordBuilder {

Callers

nothing calls this directly

Calls 2

SetStateMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected