add Reactions() method to Core interface
This commit is contained in:
parent
af9a22b1db
commit
05524b8aa7
|
|
@ -639,6 +639,17 @@ func classifyReaction(emoji string) (category, description string, positive bool
|
|||
}
|
||||
}
|
||||
|
||||
func (s *agent) Reactions() map[string]string {
|
||||
result := make(map[string]string)
|
||||
if s.session == nil {
|
||||
return result
|
||||
}
|
||||
for _, reaction := range s.session.Reactions {
|
||||
result[reaction.ResponseID] = reaction.Emoji
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *agent) React(emoji string) {
|
||||
_ = s.ReactTo("", emoji)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,6 +173,8 @@ type Core interface {
|
|||
React(emoji string)
|
||||
// ReactTo records an emoji reaction to a specific assistant response.
|
||||
ReactTo(responseID, emoji string) error
|
||||
// Reactions returns the current response ID to emoji mapping.
|
||||
Reactions() map[string]string
|
||||
}
|
||||
|
||||
// DetachedInfo describes a detached process for external consumers.
|
||||
|
|
|
|||
Reference in New Issue