kobai-sdk 0.2.8rc14__py3-none-any.whl → 0.2.9__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
@@ -69,6 +69,7 @@ def generate_sentences(tc: AIContext, replica_schema=None, concept_white_list=No
69
69
 
70
70
  print("Dropping and Recreating the RAG Table")
71
71
  ss.sql(__create_rag_table_sql(tc.schema, tc.model_id))
72
+ ss.sql(__clear_rag_table_sql(tc.schema, tc.model_id))
72
73
 
73
74
  print("Generating Extraction SQL")
74
75
  sql_statements = []
@@ -89,6 +90,7 @@ def generate_sentences(tc: AIContext, replica_schema=None, concept_white_list=No
89
90
  if replica_schema is not None:
90
91
  print("Replicating Schema")
91
92
  ss.sql(__create_rag_table_sql(replica_schema, tc.model_id))
93
+ ss.sql(__clear_rag_table_sql(tc.schema, tc.model_id))
92
94
  ss.sql(__replicate_to_catalog_sql(
93
95
  tc.schema, replica_schema, tc.model_id))
94
96
 
@@ -274,8 +276,14 @@ def rag_delta(tc: AIContext, emb_model: Union[SentenceTransformer, Embeddings],
274
276
  return response
275
277
 
276
278
 
279
+ #def __create_rag_table_sql(schema, model_id):
280
+ # return f"CREATE OR REPLACE TABLE {schema}.rag_{model_id} (id BIGINT GENERATED BY DEFAULT AS IDENTITY, content STRING, type string, concept_id string, vector ARRAY<FLOAT>) TBLPROPERTIES (delta.enableChangeDataFeed = true)"
281
+
277
282
  def __create_rag_table_sql(schema, model_id):
278
- return f"CREATE OR REPLACE TABLE {schema}.rag_{model_id} (id BIGINT GENERATED BY DEFAULT AS IDENTITY, content STRING, type string, concept_id string, vector ARRAY<FLOAT>) TBLPROPERTIES (delta.enableChangeDataFeed = true)"
283
+ return f"CREATE TABLE IF NOT EXISTS {schema}.rag_{model_id} (id BIGINT GENERATED BY DEFAULT AS IDENTITY, content STRING, type string, concept_id string, vector ARRAY<FLOAT>) TBLPROPERTIES (delta.enableChangeDataFeed = true)"
284
+
285
+ def __clear_rag_table_sql(schema, model_id):
286
+ return f"DELETE FROM {schema}.rag_{model_id}"
279
287
 
280
288
 
281
289
  def __replicate_to_catalog_sql(base_schema, target_schema, model_id):
kobai/test.py ADDED
@@ -0,0 +1,5 @@
1
+ import llm_config, ai_query
2
+
3
+ llm_config = llm_config.LLMConfig(api_key="sV9LuoA5n0PwqggMXOYMhhZlt56FpgnMXFohimPhD7Ug3CnBLbO8JQQJ99ALACYeBjFXJ3w3AAABACOGZm8X", llm_provider="azure_openai")
4
+ llm_config.get_azure_ad_token()
5
+ ai_query.followup_question_1(question="abc", data={}, question_name="sample", llm_config=llm_config)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: kobai-sdk
3
- Version: 0.2.8rc14
3
+ Version: 0.2.9
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
@@ -223,12 +223,14 @@ Requires-Dist: langchain-core
223
223
  Requires-Dist: langchain-community
224
224
  Requires-Dist: langchain_openai
225
225
  Requires-Dist: databricks_langchain
226
+ Requires-Dist: sentence-transformers
226
227
  Provides-Extra: dev
227
228
  Requires-Dist: black; extra == "dev"
228
229
  Requires-Dist: bumpver; extra == "dev"
229
230
  Requires-Dist: isort; extra == "dev"
230
231
  Requires-Dist: pip-tools; extra == "dev"
231
232
  Requires-Dist: pytest; extra == "dev"
233
+ Dynamic: license-file
232
234
 
233
235
  # Kobai SDK for Python (Alpha)
234
236
 
@@ -0,0 +1,14 @@
1
+ kobai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ kobai/ai_query.py,sha256=xZh_OyakU01gIrnzaW4v_TdfzG51nPu0ntXJw1WEnvw,9424
3
+ kobai/ai_rag.py,sha256=8B3HM4GoGVrgxJG678NN4vGaDwZRYnQiK5SCGiMIYkM,15186
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=ocAjiX7ewb7JjCy7PiISX2in55dLVpkf8HGQv2fE6Fc,39565
9
+ kobai/test.py,sha256=LHCKClyFNPgLA1hF62RlDzilaFw2Nd3BWcaLtOc5xdc,320
10
+ kobai_sdk-0.2.9.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
11
+ kobai_sdk-0.2.9.dist-info/METADATA,sha256=HmKJKi_XVB2MECaQXziP8Cvfe594I09ztK_2Ne7KmHI,19260
12
+ kobai_sdk-0.2.9.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
13
+ kobai_sdk-0.2.9.dist-info/top_level.txt,sha256=ns1El3BrTTHKvoAgU1XtiSaVIudYeCXbEEUVY8HFDZ4,6
14
+ kobai_sdk-0.2.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (76.0.0)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,13 +0,0 @@
1
- kobai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- kobai/ai_query.py,sha256=xZh_OyakU01gIrnzaW4v_TdfzG51nPu0ntXJw1WEnvw,9424
3
- kobai/ai_rag.py,sha256=Y6R0THtatIixAJvfN1V9NPFTzh8nPdtwBrlLpIFTWJk,14692
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=ocAjiX7ewb7JjCy7PiISX2in55dLVpkf8HGQv2fE6Fc,39565
9
- kobai_sdk-0.2.8rc14.dist-info/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
10
- kobai_sdk-0.2.8rc14.dist-info/METADATA,sha256=8R-oSGwdmDhVmZh2MH25hBFoNXSjS_RyAtSpEwA2thg,19205
11
- kobai_sdk-0.2.8rc14.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
12
- kobai_sdk-0.2.8rc14.dist-info/top_level.txt,sha256=ns1El3BrTTHKvoAgU1XtiSaVIudYeCXbEEUVY8HFDZ4,6
13
- kobai_sdk-0.2.8rc14.dist-info/RECORD,,