You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to be able to use optional, client defined fields for things like trackingID through our entire agent lifecycle.
Currently we can achieve this by adding context values based on user inputs, but we would like to avoid bloating the context for a given request. We could achieve this by allowing us to store the metadata on the TaskHandler itself, and we could then retrieve it as/when we need to when we process a message. I'm happy to contribute this change as well :)
TaskHandler.go
type taskHandler struct {
taskManager *TaskManager
messageId string
metadata map[string]any
ctx context.Context
}
// Optionally we can pass a key into this method, and return single values.
func (t taskHandler) GetMetadata() (map[string]any, error) {
if t.metadata == nil {
return nil, errors.New("metadata is nil")
}
return t.metadata, nil
}