- 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.
14 lines
248 B
Go
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
|
|
}
|