sunholo 0.66.21__tar.gz → 0.66.22__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.
Files changed (124) hide show
  1. {sunholo-0.66.21 → sunholo-0.66.22}/PKG-INFO +2 -2
  2. {sunholo-0.66.21 → sunholo-0.66.22}/setup.py +1 -1
  3. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/dispatch_to_qa.py +2 -2
  4. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/auth/run.py +5 -0
  5. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/chat_vac.py +8 -4
  6. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/run_proxy.py +0 -1
  7. sunholo-0.66.22/sunholo/utils/api_key.py +13 -0
  8. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo.egg-info/PKG-INFO +2 -2
  9. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo.egg-info/SOURCES.txt +1 -0
  10. {sunholo-0.66.21 → sunholo-0.66.22}/LICENSE.txt +0 -0
  11. {sunholo-0.66.21 → sunholo-0.66.22}/MANIFEST.in +0 -0
  12. {sunholo-0.66.21 → sunholo-0.66.22}/README.md +0 -0
  13. {sunholo-0.66.21 → sunholo-0.66.22}/setup.cfg +0 -0
  14. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/__init__.py +0 -0
  15. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/__init__.py +0 -0
  16. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/chat_history.py +0 -0
  17. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/fastapi/__init__.py +0 -0
  18. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/fastapi/base.py +0 -0
  19. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/fastapi/qna_routes.py +0 -0
  20. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/flask/__init__.py +0 -0
  21. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/flask/base.py +0 -0
  22. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/flask/qna_routes.py +0 -0
  23. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/langserve.py +0 -0
  24. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/pubsub.py +0 -0
  25. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/route.py +0 -0
  26. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/special_commands.py +0 -0
  27. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/agents/swagger.py +0 -0
  28. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/archive/__init__.py +0 -0
  29. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/archive/archive.py +0 -0
  30. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/auth/__init__.py +0 -0
  31. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/bots/__init__.py +0 -0
  32. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/bots/discord.py +0 -0
  33. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/bots/github_webhook.py +0 -0
  34. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/bots/webapp.py +0 -0
  35. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/__init__.py +0 -0
  36. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
  37. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/doc_handling.py +0 -0
  38. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/images.py +0 -0
  39. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/loaders.py +0 -0
  40. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/message_data.py +0 -0
  41. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/pdfs.py +0 -0
  42. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/publish.py +0 -0
  43. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/chunker/splitter.py +0 -0
  44. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/__init__.py +0 -0
  45. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/cli.py +0 -0
  46. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/cli_init.py +0 -0
  47. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/configs.py +0 -0
  48. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/deploy.py +0 -0
  49. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/embedder.py +0 -0
  50. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/merge_texts.py +0 -0
  51. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/sun_rich.py +0 -0
  52. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/cli/swagger.py +0 -0
  53. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/components/__init__.py +0 -0
  54. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/components/llm.py +0 -0
  55. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/components/retriever.py +0 -0
  56. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/components/vectorstore.py +0 -0
  57. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/__init__.py +0 -0
  58. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/alloydb.py +0 -0
  59. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/database.py +0 -0
  60. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/lancedb.py +0 -0
  61. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/sql/sb/create_function.sql +0 -0
  62. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/sql/sb/create_function_time.sql +0 -0
  63. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/sql/sb/create_table.sql +0 -0
  64. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
  65. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/sql/sb/return_sources.sql +0 -0
  66. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/sql/sb/setup.sql +0 -0
  67. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/static_dbs.py +0 -0
  68. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/database/uuid.py +0 -0
  69. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/embedder/__init__.py +0 -0
  70. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/embedder/embed_chunk.py +0 -0
  71. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/gcs/__init__.py +0 -0
  72. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/gcs/add_file.py +0 -0
  73. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/gcs/download_url.py +0 -0
  74. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/gcs/metadata.py +0 -0
  75. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/langfuse/__init__.py +0 -0
  76. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/langfuse/callback.py +0 -0
  77. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/langfuse/prompts.py +0 -0
  78. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/llamaindex/__init__.py +0 -0
  79. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/llamaindex/generate.py +0 -0
  80. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/llamaindex/get_files.py +0 -0
  81. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/llamaindex/import_files.py +0 -0
  82. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/logging.py +0 -0
  83. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/lookup/__init__.py +0 -0
  84. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/lookup/model_lookup.yaml +0 -0
  85. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/patches/__init__.py +0 -0
  86. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/patches/langchain/__init__.py +0 -0
  87. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/patches/langchain/lancedb.py +0 -0
  88. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/patches/langchain/vertexai.py +0 -0
  89. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/pubsub/__init__.py +0 -0
  90. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/pubsub/process_pubsub.py +0 -0
  91. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/pubsub/pubsub_manager.py +0 -0
  92. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/qna/__init__.py +0 -0
  93. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/qna/parsers.py +0 -0
  94. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/qna/retry.py +0 -0
  95. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/streaming/__init__.py +0 -0
  96. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/streaming/content_buffer.py +0 -0
  97. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/streaming/langserve.py +0 -0
  98. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/streaming/stream_lookup.py +0 -0
  99. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/streaming/streaming.py +0 -0
  100. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/summarise/__init__.py +0 -0
  101. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/summarise/summarise.py +0 -0
  102. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/__init__.py +0 -0
  103. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/big_context.py +0 -0
  104. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/config.py +0 -0
  105. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/config_schema.py +0 -0
  106. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/gcp.py +0 -0
  107. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/gcp_project.py +0 -0
  108. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/parsers.py +0 -0
  109. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/timedelta.py +0 -0
  110. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/user_ids.py +0 -0
  111. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/utils/version.py +0 -0
  112. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/vertex/__init__.py +0 -0
  113. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/vertex/init.py +0 -0
  114. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/vertex/memory_tools.py +0 -0
  115. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo/vertex/safety.py +0 -0
  116. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo.egg-info/dependency_links.txt +0 -0
  117. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo.egg-info/entry_points.txt +0 -0
  118. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo.egg-info/requires.txt +0 -0
  119. {sunholo-0.66.21 → sunholo-0.66.22}/sunholo.egg-info/top_level.txt +0 -0
  120. {sunholo-0.66.21 → sunholo-0.66.22}/tests/test_chat_history.py +0 -0
  121. {sunholo-0.66.21 → sunholo-0.66.22}/tests/test_chunker.py +0 -0
  122. {sunholo-0.66.21 → sunholo-0.66.22}/tests/test_config.py +0 -0
  123. {sunholo-0.66.21 → sunholo-0.66.22}/tests/test_dispatch_to_qa.py +0 -0
  124. {sunholo-0.66.21 → sunholo-0.66.22}/tests/test_swagger.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.66.21
3
+ Version: 0.66.22
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Home-page: https://github.com/sunholo-data/sunholo-py
6
- Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.66.21.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.66.22.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
3
  # Define your base version
4
- version = '0.66.21'
4
+ version = '0.66.22'
5
5
 
6
6
  setup(
7
7
  name='sunholo',
@@ -121,7 +121,7 @@ def send_to_qa(user_input, vector_name, chat_history, stream=False, **kwargs):
121
121
 
122
122
  except requests.exceptions.HTTPError as err:
123
123
  log.error(f"HTTP error occurred: {err}")
124
- error_message = f"There was an error processing your request. Please try again later. {str(err)}"
124
+ error_message = f"There was an error processing your request. {str(err)}"
125
125
  if stream:
126
126
  return iter([error_message])
127
127
  else:
@@ -129,7 +129,7 @@ def send_to_qa(user_input, vector_name, chat_history, stream=False, **kwargs):
129
129
 
130
130
  except Exception as err:
131
131
  log.error(f"Other error occurred: {str(err)}")
132
- error_message = f"Something went wrong. Please try again later. {str(err)}"
132
+ error_message = f"Something went wrong. {str(err)}"
133
133
  if stream:
134
134
  return iter([error_message])
135
135
  else:
@@ -4,6 +4,7 @@ import inspect
4
4
  from typing import Dict, Optional
5
5
  from ..utils.config import load_config_key, load_config
6
6
  from ..utils.gcp import is_running_on_cloudrun
7
+ from ..utils.api_key import has_multivac_api_key, get_multivac_api_key
7
8
  from ..logging import log
8
9
  from ..agents.route import route_vac
9
10
 
@@ -48,6 +49,10 @@ def get_id_token(url: str) -> str:
48
49
  )
49
50
 
50
51
  def get_header(vector_name) -> Optional[dict]:
52
+ if has_multivac_api_key():
53
+
54
+ return {"x-api-key": get_multivac_api_key()}
55
+
51
56
  if is_running_on_cloudrun():
52
57
  run_url = get_run_url(vector_name)
53
58
  else:
@@ -2,6 +2,7 @@ from ..agents import send_to_qa, handle_special_commands
2
2
  from ..streaming import generate_proxy_stream, can_agent_stream
3
3
  from ..utils.user_ids import generate_user_id
4
4
  from ..utils.config import load_config_key
5
+ from ..utils.api_key import has_multivac_api_key
5
6
  from ..logging import log
6
7
  from ..qna.parsers import parse_output
7
8
  from .run_proxy import clean_proxy_list, start_proxy, stop_proxy
@@ -234,21 +235,24 @@ def resolve_service_url(args, no_config=False):
234
235
  console.print("Found agent_url within vacConfig: {agent_url}")
235
236
 
236
237
  # via public cloud endpoints - assumes no gcloud auth
237
- if os.getenv("MULTIVAC_API_KEY"):
238
- console.rule("Found MULTIVAC_API_KEY")
238
+ if has_multivac_api_key():
239
+ log.debug("Found MULTIVAC_API_KEY")
239
240
  gcp_config = load_config_key("gcp_config", "global", "vacConfig")
240
241
  endpoints_base_url = gcp_config.get("endpoints_base_url")
241
242
  if not endpoints_base_url:
242
243
  console.print("[bold red]MULTIVAC_API_KEY env var is set but no config.gcp_config.endpoints_base_url can be found[/bold red]")
243
244
  sys.exit(1)
244
245
 
245
- service_url = f"{endpoints_base_url}/v1/{agent_name}"
246
+ return f"{endpoints_base_url}/v1/{agent_name}"
246
247
 
247
248
  # via direct access to agent url - requires gcloud auth access
248
249
  elif args.no_proxy:
249
250
 
250
251
  service_url = agent_url or get_cloud_run_service_url(args.project, args.region, agent_name)
251
252
  console.print(f"No proxy, connecting directly to {service_url}")
253
+
254
+ return service_url
255
+
252
256
  else:
253
257
  # via gcloud proxy - requires gcloud auth access
254
258
  try:
@@ -257,7 +261,7 @@ def resolve_service_url(args, no_config=False):
257
261
  console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
258
262
  sys.exit(1)
259
263
 
260
- return service_url
264
+ return service_url
261
265
 
262
266
  def vac_command(args):
263
267
 
@@ -151,7 +151,6 @@ def stop_proxy(service_name, stop_local=True):
151
151
  # kill PID
152
152
 
153
153
  if service_name not in proxies:
154
- print(f"No proxy found for service: {service_name}")
155
154
  return
156
155
 
157
156
  if not stop_local:
@@ -0,0 +1,13 @@
1
+ import os
2
+
3
+ def has_multivac_api_key():
4
+ if os.getenv('MULTIVAC_API_KEY'):
5
+ return True
6
+
7
+ return False
8
+
9
+ def get_multivac_api_key():
10
+ if has_multivac_api_key():
11
+ return os.getenv('MULTIVAC_API_KEY')
12
+
13
+ return None
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.66.21
3
+ Version: 0.66.22
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Home-page: https://github.com/sunholo-data/sunholo-py
6
- Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.66.21.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.66.22.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -102,6 +102,7 @@ sunholo/streaming/streaming.py
102
102
  sunholo/summarise/__init__.py
103
103
  sunholo/summarise/summarise.py
104
104
  sunholo/utils/__init__.py
105
+ sunholo/utils/api_key.py
105
106
  sunholo/utils/big_context.py
106
107
  sunholo/utils/config.py
107
108
  sunholo/utils/config_schema.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes