feat: support separate knowledge bases for each agent
Also allow to export/import KB Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
@@ -42,6 +42,10 @@ func NewChromemDB(collection, path string, openaiClient *openai.Client, embeddin
|
||||
return chromem, nil
|
||||
}
|
||||
|
||||
func (c *ChromemDB) Count() int {
|
||||
return c.collection.Count()
|
||||
}
|
||||
|
||||
func (c *ChromemDB) Reset() error {
|
||||
if err := c.db.DeleteCollection(c.collectionName); err != nil {
|
||||
return err
|
||||
|
||||
@@ -23,6 +23,10 @@ func (db *LocalAIRAGDB) Reset() error {
|
||||
return fmt.Errorf("not implemented")
|
||||
}
|
||||
|
||||
func (db *LocalAIRAGDB) Count() int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (db *LocalAIRAGDB) Store(s string) error {
|
||||
resp, err := db.openaiClient.CreateEmbeddings(context.TODO(),
|
||||
openai.EmbeddingRequestStrings{
|
||||
|
||||
Reference in New Issue
Block a user