mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-10-27 17:03:49 +08:00
24 lines
671 B
Go
24 lines
671 B
Go
package agent
|
|
|
|
import (
|
|
"context"
|
|
"strconv"
|
|
"strings"
|
|
|
|
"github.com/Autumn-27/artex/sidequestion"
|
|
"github.com/Autumn-27/norma/agentcore"
|
|
)
|
|
|
|
func attachSideCapture(ctx context.Context, opts *agentcore.Options) context.Context {
|
|
ri := RunInfoFrom(ctx)
|
|
p := sidequestion.Parent{TaskID: ri.TaskID, ExplorationID: ri.ExplorationID, IntentID: ri.IntentID}
|
|
if strings.HasPrefix(ri.SessionID, "conv-") {
|
|
p.ConversationID, _ = strconv.ParseInt(strings.TrimPrefix(ri.SessionID, "conv-"), 10, 64)
|
|
}
|
|
if p.ConversationID == 0 && (p.TaskID == 0 || p.ExplorationID == 0) {
|
|
return ctx
|
|
}
|
|
ctx, opts.Deps = sidequestion.Attach(ctx, p, opts.Deps, opts.Provider)
|
|
return ctx
|
|
}
|