Skip to content

Commit cfafb1d

Browse files
updated the data initialization for KB
1 parent dcd07f2 commit cfafb1d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

mindsdb_sdk/knowledge_bases.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pandas as pd
66

7-
from mindsdb_sql_parser.ast.mindsdb import CreateKnowledgeBase, DropKnowledgeBase
87
from mindsdb_sql_parser.ast import Identifier, Star, Select, BinaryOperation, Constant, Insert
98

109
from mindsdb_sdk.utils.sql import dict_to_binary_op, query_to_native_query
@@ -44,9 +43,14 @@ def __init__(self, api, project, data: dict):
4443
table = Table(database, data['vector_database_table'])
4544
self.storage = table
4645

47-
self.model = None
48-
if data['embedding_model'] is not None:
49-
self.model = Model(self.project, {'name': data['embedding_model']})
46+
# models
47+
self.embedding_model = data.get('embedding_model', {})
48+
self.reranking_model = data.get('reranking_model', {})
49+
50+
# columns
51+
self.metadata_columns = data.get('metadata_columns', [])
52+
self.content_columns = data.get('content_columns', [])
53+
self.id_column = data.get('id_column', None)
5054

5155
params = data.get('params', {})
5256
if isinstance(params, str):
@@ -55,11 +59,6 @@ def __init__(self, api, project, data: dict):
5559
except json.JSONDecodeError:
5660
params = {}
5761

58-
# columns
59-
self.metadata_columns = params.pop('metadata_columns', [])
60-
self.content_columns = params.pop('content_columns', [])
61-
self.id_column = params.pop('id_column', None)
62-
6362
self.params = params
6463

6564
# query behavior

0 commit comments

Comments
 (0)