yao/agent/assistant/permission.go
Max 704c0331b1 Enhance Assistant stream functionality and remove history handling
- Added permission validation in the Assistant's Stream method to ensure user authorization before processing input messages.
- Introduced conversation initialization within the Stream method to prepare the context for chat interactions.
- Removed the history.go file, which previously contained a placeholder method for handling chat history, streamlining the Assistant's codebase.
- Updated the Knowledge Base API integration in collection management, ensuring all collection operations utilize the new API structure for improved consistency and error handling.
2025-12-08 10:28:26 +08:00

14 lines
248 B
Go

package assistant
import (
"fmt"
"github.com/yaoapp/yao/agent/context"
)
func (ast *Assistant) checkPermissions(ctx *context.Context) error {
if ctx.Authorized == nil {
return fmt.Errorf("authorized information not found")
}
return nil
}