fix tool_call tts
This commit is contained in:
parent
e9cd7d9526
commit
324956216b
2 changed files with 13 additions and 5 deletions
|
|
@ -34,6 +34,7 @@ type OutboundMessage struct {
|
|||
ChatID string `json:"chat_id"`
|
||||
Content string `json:"content"`
|
||||
ReplyToMessageID string `json:"reply_to_message_id,omitempty"`
|
||||
Metadata map[string]string `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
// MediaPart describes a single media attachment to send.
|
||||
|
|
|
|||
|
|
@ -154,7 +154,14 @@ func (c *DiscordChannel) Send(ctx context.Context, msg bus.OutboundMessage) erro
|
|||
return nil
|
||||
}
|
||||
|
||||
if c.tts != nil {
|
||||
isToolCall := false
|
||||
if msg.Metadata != nil {
|
||||
if val, ok := msg.Metadata["is_tool_call"]; ok && val == "true" {
|
||||
isToolCall = true
|
||||
}
|
||||
}
|
||||
|
||||
if c.tts != nil && !isToolCall {
|
||||
if ch, err := c.session.State.Channel(channelID); err == nil && ch.GuildID != "" {
|
||||
if vc, ok := c.session.VoiceConnections[ch.GuildID]; ok && vc != nil {
|
||||
// Cancel any previous TTS playback
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue