kobai-sdk 0.2.8rc9__py3-none-any.whl → 0.2.8rc11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kobai-sdk might be problematic. Click here for more details.
- kobai/ai_rag.py +8 -3
- kobai/tenant_client.py +3 -3
- {kobai_sdk-0.2.8rc9.dist-info → kobai_sdk-0.2.8rc11.dist-info}/METADATA +1 -1
- kobai_sdk-0.2.8rc11.dist-info/RECORD +13 -0
- kobai_sdk-0.2.8rc9.dist-info/RECORD +0 -13
- {kobai_sdk-0.2.8rc9.dist-info → kobai_sdk-0.2.8rc11.dist-info}/LICENSE +0 -0
- {kobai_sdk-0.2.8rc9.dist-info → kobai_sdk-0.2.8rc11.dist-info}/WHEEL +0 -0
- {kobai_sdk-0.2.8rc9.dist-info → kobai_sdk-0.2.8rc11.dist-info}/top_level.txt +0 -0
kobai/ai_rag.py
CHANGED
|
@@ -143,7 +143,7 @@ def __generate_sentences_from_questions(tc: AIContext, debug):
|
|
|
143
143
|
ss.sql(full_sql)
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
def encode_to_delta_local(tc: AIContext, st_model: SentenceTransformer, replica_schema=None):
|
|
146
|
+
def encode_to_delta_local(tc: AIContext, st_model: Union[SentenceTransformer, Embeddings], replica_schema=None):
|
|
147
147
|
"""
|
|
148
148
|
Encode Semantic Data to Vectors in Delta Table
|
|
149
149
|
|
|
@@ -172,8 +172,13 @@ def encode_to_delta_local(tc: AIContext, st_model: SentenceTransformer, replica_
|
|
|
172
172
|
content_list = [r["content"] for r in sentences_df.collect()]
|
|
173
173
|
id_list = [r["id"] for r in sentences_df.collect()]
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
if isinstance(st_model, SentenceTransformer):
|
|
176
|
+
vector_list = st_model.encode(
|
|
177
|
+
content_list, normalize_embeddings=True, show_progress_bar=True)
|
|
178
|
+
else:
|
|
179
|
+
vector_list = st_model.embed_documents(content_list)
|
|
180
|
+
#vector_list = st_model.encode(
|
|
181
|
+
# content_list, normalize_embeddings=True, show_progress_bar=True)
|
|
177
182
|
|
|
178
183
|
schema_v = StructType([
|
|
179
184
|
StructField("id", IntegerType(), True),
|
kobai/tenant_client.py
CHANGED
|
@@ -440,7 +440,7 @@ class TenantClient:
|
|
|
440
440
|
context.api_client = self.api_client
|
|
441
441
|
return context
|
|
442
442
|
|
|
443
|
-
def rag_generate_sentences(self, replica_schema=None, concept_white_list=None, use_questions=False):
|
|
443
|
+
def rag_generate_sentences(self, replica_schema=None, concept_white_list=None, use_questions=False, debug=False):
|
|
444
444
|
"""
|
|
445
445
|
Extract Semantic Data from Graph to Delta Table
|
|
446
446
|
|
|
@@ -449,9 +449,9 @@ class TenantClient:
|
|
|
449
449
|
concept_white_list ([str]) OPTIONAL: A list of Domain and Concept names for extraction.
|
|
450
450
|
use_questions (bool) OPTIONAL: Extract facts from published Kobai questions.
|
|
451
451
|
"""
|
|
452
|
-
ai_rag.generate_sentences(self.get_ai_context(), replica_schema=replica_schema, concept_white_list=concept_white_list, use_questions=use_questions)
|
|
452
|
+
ai_rag.generate_sentences(self.get_ai_context(), replica_schema=replica_schema, concept_white_list=concept_white_list, use_questions=use_questions, debug=debug)
|
|
453
453
|
|
|
454
|
-
def rag_encode_to_delta_local(self, st_model: SentenceTransformer, replica_schema=None):
|
|
454
|
+
def rag_encode_to_delta_local(self, st_model: Union[SentenceTransformer, Embeddings], replica_schema=None):
|
|
455
455
|
"""
|
|
456
456
|
Encode Semantic Data to Vectors in Delta Table
|
|
457
457
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
kobai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
kobai/ai_query.py,sha256=d0WOPKtQ-bI_zW3-_6guEJX0t55OcxdXIdgXaD-zKK0,9413
|
|
3
|
+
kobai/ai_rag.py,sha256=Gqj_CF2lLjMc0CcxquOAgXhiuY6pKwyJumR2NK7QdOo,14559
|
|
4
|
+
kobai/databricks_client.py,sha256=fyqqMly2Qm0r1AHWsQjkYeNsDdH0G1JSgTkF9KJ55qA,2118
|
|
5
|
+
kobai/demo_tenant_client.py,sha256=wlNc-bdI2wotRXo8ppUOalv4hYdBlek_WzJNARZV-AE,9293
|
|
6
|
+
kobai/spark_client.py,sha256=opM_F-4Ut5Hq5zZjWMuLvUps9sDULvyPNZHXGL8dW1k,776
|
|
7
|
+
kobai/tenant_api.py,sha256=9U6UbxpaAb-kpbuADXx3kbkNKaOzYy0I-GGwbpiCCOk,4212
|
|
8
|
+
kobai/tenant_client.py,sha256=ktw75dmmX95gD6qIkG-mAmdo48RkF96SgmpRmfDWblo,39422
|
|
9
|
+
kobai_sdk-0.2.8rc11.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
10
|
+
kobai_sdk-0.2.8rc11.dist-info/METADATA,sha256=jyrtCYbqTYKrHMHBOmWUrDfkK3NFqtqxmQyTW-vZ05A,19205
|
|
11
|
+
kobai_sdk-0.2.8rc11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
12
|
+
kobai_sdk-0.2.8rc11.dist-info/top_level.txt,sha256=ns1El3BrTTHKvoAgU1XtiSaVIudYeCXbEEUVY8HFDZ4,6
|
|
13
|
+
kobai_sdk-0.2.8rc11.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
kobai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
kobai/ai_query.py,sha256=d0WOPKtQ-bI_zW3-_6guEJX0t55OcxdXIdgXaD-zKK0,9413
|
|
3
|
-
kobai/ai_rag.py,sha256=xAifSGLsW2Akx0pEfWi1nBKtZe9tqbItiEmyeK53W_o,14281
|
|
4
|
-
kobai/databricks_client.py,sha256=fyqqMly2Qm0r1AHWsQjkYeNsDdH0G1JSgTkF9KJ55qA,2118
|
|
5
|
-
kobai/demo_tenant_client.py,sha256=wlNc-bdI2wotRXo8ppUOalv4hYdBlek_WzJNARZV-AE,9293
|
|
6
|
-
kobai/spark_client.py,sha256=opM_F-4Ut5Hq5zZjWMuLvUps9sDULvyPNZHXGL8dW1k,776
|
|
7
|
-
kobai/tenant_api.py,sha256=9U6UbxpaAb-kpbuADXx3kbkNKaOzYy0I-GGwbpiCCOk,4212
|
|
8
|
-
kobai/tenant_client.py,sha256=EYen_QEAKs04zLF2oIKAVC84vrPp9vpRjS7NOITH1Ck,39377
|
|
9
|
-
kobai_sdk-0.2.8rc9.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
10
|
-
kobai_sdk-0.2.8rc9.dist-info/METADATA,sha256=RXgBY0-y-dZJY7q1RcRKWi-EiL6PEp4hZkO6KmQ645k,19204
|
|
11
|
-
kobai_sdk-0.2.8rc9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
12
|
-
kobai_sdk-0.2.8rc9.dist-info/top_level.txt,sha256=ns1El3BrTTHKvoAgU1XtiSaVIudYeCXbEEUVY8HFDZ4,6
|
|
13
|
-
kobai_sdk-0.2.8rc9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|