- 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.
15 lines
374 B
Go
15 lines
374 B
Go
package api
|
|
|
|
import (
|
|
"github.com/yaoapp/gou/graphrag/types"
|
|
kbtypes "github.com/yaoapp/yao/kb/types"
|
|
)
|
|
|
|
// NewAPI creates a new API instance with the provided KB dependencies
|
|
func NewAPI(graphRag types.GraphRag, config *kbtypes.Config, providers *kbtypes.ProviderConfig) API {
|
|
return &KBInstance{
|
|
GraphRag: graphRag,
|
|
Config: config,
|
|
Providers: providers,
|
|
}
|
|
}
|