kobai-sdk 0.2.8rc7__py3-none-any.whl → 0.2.8rc9__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 CHANGED
@@ -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]}: "
kobai/tenant_client.py CHANGED
@@ -64,7 +64,7 @@ class TenantClient:
64
64
  # MS Entra Auth
65
65
  ########################################
66
66
 
67
- def authenticate(self, client_id: str, tenant_id: str, run_ai_init: bool = True):
67
+ def authenticate(self, client_id: str, tenant_id: str, run_ai_init: bool = True, override_username: str = None):
68
68
 
69
69
  """
70
70
  Authenticate the TenantClient with the Kobai instance. Returns nothing, but stores bearer token in client.
@@ -84,6 +84,9 @@ class TenantClient:
84
84
  oauth_token = access.serialize()
85
85
  user_name = json.loads(access.serialize())["username"]
86
86
 
87
+ if override_username is not None:
88
+ user_name = override_username
89
+
87
90
  user_name_query_params={ 'userName' : user_name}
88
91
  tenants_response = self.api_client._TenantAPI__run_get('/user-mgmt-svcs/auth/tenants?'+urllib.parse.urlencode(user_name_query_params))
89
92
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: kobai-sdk
3
- Version: 0.2.8rc7
3
+ Version: 0.2.8rc9
4
4
  Summary: A package that enables interaction with a Kobai tenant.
5
5
  Author-email: Ryan Oattes <ryan@kobai.io>
6
6
  License: Apache License
@@ -1,13 +1,13 @@
1
1
  kobai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  kobai/ai_query.py,sha256=d0WOPKtQ-bI_zW3-_6guEJX0t55OcxdXIdgXaD-zKK0,9413
3
- kobai/ai_rag.py,sha256=CNP4Rl6LXnXYR88JT35A3NfznoNpEQUldA0jozChKzc,14143
3
+ kobai/ai_rag.py,sha256=xAifSGLsW2Akx0pEfWi1nBKtZe9tqbItiEmyeK53W_o,14281
4
4
  kobai/databricks_client.py,sha256=fyqqMly2Qm0r1AHWsQjkYeNsDdH0G1JSgTkF9KJ55qA,2118
5
5
  kobai/demo_tenant_client.py,sha256=wlNc-bdI2wotRXo8ppUOalv4hYdBlek_WzJNARZV-AE,9293
6
6
  kobai/spark_client.py,sha256=opM_F-4Ut5Hq5zZjWMuLvUps9sDULvyPNZHXGL8dW1k,776
7
7
  kobai/tenant_api.py,sha256=9U6UbxpaAb-kpbuADXx3kbkNKaOzYy0I-GGwbpiCCOk,4212
8
- kobai/tenant_client.py,sha256=Uf1qNj8ASLyWf4ymE2pw1s4fxNQL-QW4GXVMfmuAuIU,39261
9
- kobai_sdk-0.2.8rc7.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
10
- kobai_sdk-0.2.8rc7.dist-info/METADATA,sha256=e64A0BMY9_sLkuOBz8o0zRqzIVn1W-Pu0mqdTPgwN8s,19204
11
- kobai_sdk-0.2.8rc7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
12
- kobai_sdk-0.2.8rc7.dist-info/top_level.txt,sha256=ns1El3BrTTHKvoAgU1XtiSaVIudYeCXbEEUVY8HFDZ4,6
13
- kobai_sdk-0.2.8rc7.dist-info/RECORD,,
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,,