feat: add knowledge management functionality with CRUD operations and database schema
- Implemented KnowledgeHandler for managing knowledge groups and items, including listing, creating, updating, and deleting operations. - Added database migration scripts to create necessary tables for knowledge management, including knowledge_groups, knowledge_items, knowledge_parse_tasks, and knowledge_chunks_meta. - Introduced prompt_rule_knowledge_groups table to associate prompt rules with knowledge groups.
This commit is contained in:
@@ -16,6 +16,17 @@ type TemplateHandler struct {
|
||||
}
|
||||
|
||||
func NewTemplateHandler(a *bootstrap.App) *TemplateHandler {
|
||||
knowledgeSvc := app.NewKnowledgeService(
|
||||
a.DB,
|
||||
a.RetrievalProvider,
|
||||
a.VectorStore,
|
||||
a.ObjectStorage,
|
||||
a.Logger,
|
||||
a.Config.Retrieval,
|
||||
0,
|
||||
0,
|
||||
)
|
||||
|
||||
return &TemplateHandler{
|
||||
svc: app.NewTemplateService(
|
||||
a.DB,
|
||||
@@ -24,6 +35,7 @@ func NewTemplateHandler(a *bootstrap.App) *TemplateHandler {
|
||||
a.Cache,
|
||||
),
|
||||
a.LLM,
|
||||
knowledgeSvc,
|
||||
a.GenerationStreams,
|
||||
a.Config.Generation,
|
||||
a.Config.LLM.MaxOutputTokens,
|
||||
|
||||
Reference in New Issue
Block a user