validateMessage 验证消息
(message string)
| 265 | |
| 266 | // validateMessage 验证消息 |
| 267 | func (a *Agent) validateMessage(message string) error { |
| 268 | if message == "" { |
| 269 | return errors.New("message cannot be empty") |
| 270 | } |
| 271 | return nil |
| 272 | } |
| 273 | |
| 274 | // handleSlashCommandForStream 处理 Slash Command(流式版本) |
| 275 | func (a *Agent) handleSlashCommandForStream(ctx context.Context, msg *types.Message, writer *stream.Writer[*session.Event]) (bool, error) { |