kobai-sdk 0.2.8rc8__tar.gz → 0.2.8rc10__tar.gz
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_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/PKG-INFO +1 -1
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/ai_rag.py +7 -3
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/tenant_client.py +2 -2
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai_sdk.egg-info/PKG-INFO +1 -1
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/pyproject.toml +1 -1
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/LICENSE +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/MANIFEST.in +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/README.md +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/__init__.py +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/ai_query.py +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/databricks_client.py +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/demo_tenant_client.py +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/spark_client.py +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai/tenant_api.py +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai_sdk.egg-info/SOURCES.txt +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai_sdk.egg-info/dependency_links.txt +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai_sdk.egg-info/requires.txt +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/kobai_sdk.egg-info/top_level.txt +0 -0
- {kobai_sdk-0.2.8rc8 → kobai_sdk-0.2.8rc10}/setup.cfg +0 -0
|
@@ -48,7 +48,7 @@ def ai_run_question_remote(tc: AIContext, question_id, dynamic_filters: dict = N
|
|
|
48
48
|
|
|
49
49
|
return response.json()
|
|
50
50
|
|
|
51
|
-
def generate_sentences(tc: AIContext, replica_schema=None, concept_white_list=None, use_questions=False):
|
|
51
|
+
def generate_sentences(tc: AIContext, replica_schema=None, concept_white_list=None, use_questions=False, debug=False):
|
|
52
52
|
"""
|
|
53
53
|
Extract Semantic Data from Graph to Delta Table
|
|
54
54
|
|
|
@@ -79,10 +79,12 @@ def generate_sentences(tc: AIContext, replica_schema=None, concept_white_list=No
|
|
|
79
79
|
|
|
80
80
|
print("Running the Extraction")
|
|
81
81
|
for sql_statement in sql_statements:
|
|
82
|
+
if debug:
|
|
83
|
+
print(sql_statement)
|
|
82
84
|
ss.sql(sql_statement)
|
|
83
85
|
|
|
84
86
|
if use_questions:
|
|
85
|
-
__generate_sentences_from_questions(tc)
|
|
87
|
+
__generate_sentences_from_questions(tc, debug)
|
|
86
88
|
|
|
87
89
|
if replica_schema is not None:
|
|
88
90
|
print("Replicating Schema")
|
|
@@ -91,7 +93,7 @@ def generate_sentences(tc: AIContext, replica_schema=None, concept_white_list=No
|
|
|
91
93
|
tc.schema, replica_schema, tc.model_id))
|
|
92
94
|
|
|
93
95
|
|
|
94
|
-
def __generate_sentences_from_questions(tc: AIContext):
|
|
96
|
+
def __generate_sentences_from_questions(tc: AIContext, debug):
|
|
95
97
|
ss = tc.spark_session
|
|
96
98
|
|
|
97
99
|
print("Getting Question Data")
|
|
@@ -114,6 +116,8 @@ def __generate_sentences_from_questions(tc: AIContext):
|
|
|
114
116
|
|
|
115
117
|
sentences = []
|
|
116
118
|
for p in published_queries:
|
|
119
|
+
if debug:
|
|
120
|
+
print("Running Question:", p)
|
|
117
121
|
output = ai_run_question_remote(tc, p)
|
|
118
122
|
for r in output:
|
|
119
123
|
sentence = f"For {question_names[p]}: "
|
|
@@ -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,7 +449,7 @@ 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
454
|
def rag_encode_to_delta_local(self, st_model: SentenceTransformer, replica_schema=None):
|
|
455
455
|
"""
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kobai-sdk"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.8rc10"
|
|
8
8
|
description = "A package that enables interaction with a Kobai tenant."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Ryan Oattes", email = "ryan@kobai.io" }]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|