diff --git a/neo/assistant/call.go b/neo/assistant/call.go index fd3df996..ef086cfe 100644 --- a/neo/assistant/call.go +++ b/neo/assistant/call.go @@ -247,6 +247,7 @@ func (obj *objectCall) run(info *v8go.FunctionCallbackInfo) *v8go.Value { chatCtx.AssistantID = assistantID chatCtx.ChatID = fmt.Sprintf("call_%s", uuid.New().String()) // New chat id chatCtx.Silent = options.Silent + chatCtx.Args = goArgs // Arguments for call // Define the callback function var cb func(msg *chatMessage.Message) = nil diff --git a/neo/context/context.go b/neo/context/context.go index 77d1c43f..929dfeb2 100644 --- a/neo/context/context.go +++ b/neo/context/context.go @@ -28,6 +28,7 @@ type Context struct { Upload *FileUpload `json:"upload,omitempty"` Version bool `json:"version,omitempty"` // Version support RAG bool `json:"rag,omitempty"` // RAG support + Args []interface{} `json:"args,omitempty"` // Arguments for call SharedSpace plan.Space `json:"-"` // Shared space } @@ -125,6 +126,11 @@ func (ctx *Context) Map() map[string]interface{} { data["retry"] = ctx.Retry } + // Arguments for call + if ctx.Args != nil && len(ctx.Args) > 0 { + data["args"] = ctx.Args + } + // Retry times data["retry_times"] = ctx.RetryTimes