sunholo 0.66.20__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.20 → sunholo-0.66.22}/PKG-INFO +2 -2
  2. {sunholo-0.66.20 → sunholo-0.66.22}/setup.py +1 -1
  3. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/dispatch_to_qa.py +2 -2
  4. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/swagger.py +2 -3
  5. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/auth/run.py +5 -0
  6. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/chat_vac.py +26 -6
  7. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/run_proxy.py +0 -1
  8. sunholo-0.66.22/sunholo/utils/api_key.py +13 -0
  9. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo.egg-info/PKG-INFO +2 -2
  10. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo.egg-info/SOURCES.txt +1 -0
  11. {sunholo-0.66.20 → sunholo-0.66.22}/LICENSE.txt +0 -0
  12. {sunholo-0.66.20 → sunholo-0.66.22}/MANIFEST.in +0 -0
  13. {sunholo-0.66.20 → sunholo-0.66.22}/README.md +0 -0
  14. {sunholo-0.66.20 → sunholo-0.66.22}/setup.cfg +0 -0
  15. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/__init__.py +0 -0
  16. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/__init__.py +0 -0
  17. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/chat_history.py +0 -0
  18. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/fastapi/__init__.py +0 -0
  19. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/fastapi/base.py +0 -0
  20. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/fastapi/qna_routes.py +0 -0
  21. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/flask/__init__.py +0 -0
  22. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/flask/base.py +0 -0
  23. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/flask/qna_routes.py +0 -0
  24. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/langserve.py +0 -0
  25. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/pubsub.py +0 -0
  26. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/route.py +0 -0
  27. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/agents/special_commands.py +0 -0
  28. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/archive/__init__.py +0 -0
  29. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/archive/archive.py +0 -0
  30. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/auth/__init__.py +0 -0
  31. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/bots/__init__.py +0 -0
  32. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/bots/discord.py +0 -0
  33. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/bots/github_webhook.py +0 -0
  34. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/bots/webapp.py +0 -0
  35. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/__init__.py +0 -0
  36. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
  37. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/doc_handling.py +0 -0
  38. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/images.py +0 -0
  39. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/loaders.py +0 -0
  40. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/message_data.py +0 -0
  41. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/pdfs.py +0 -0
  42. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/publish.py +0 -0
  43. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/chunker/splitter.py +0 -0
  44. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/__init__.py +0 -0
  45. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/cli.py +0 -0
  46. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/cli_init.py +0 -0
  47. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/configs.py +0 -0
  48. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/deploy.py +0 -0
  49. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/embedder.py +0 -0
  50. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/merge_texts.py +0 -0
  51. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/sun_rich.py +0 -0
  52. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/cli/swagger.py +0 -0
  53. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/components/__init__.py +0 -0
  54. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/components/llm.py +0 -0
  55. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/components/retriever.py +0 -0
  56. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/components/vectorstore.py +0 -0
  57. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/__init__.py +0 -0
  58. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/alloydb.py +0 -0
  59. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/database.py +0 -0
  60. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/lancedb.py +0 -0
  61. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/sql/sb/create_function.sql +0 -0
  62. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/sql/sb/create_function_time.sql +0 -0
  63. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/sql/sb/create_table.sql +0 -0
  64. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
  65. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/sql/sb/return_sources.sql +0 -0
  66. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/sql/sb/setup.sql +0 -0
  67. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/static_dbs.py +0 -0
  68. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/database/uuid.py +0 -0
  69. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/embedder/__init__.py +0 -0
  70. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/embedder/embed_chunk.py +0 -0
  71. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/gcs/__init__.py +0 -0
  72. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/gcs/add_file.py +0 -0
  73. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/gcs/download_url.py +0 -0
  74. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/gcs/metadata.py +0 -0
  75. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/langfuse/__init__.py +0 -0
  76. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/langfuse/callback.py +0 -0
  77. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/langfuse/prompts.py +0 -0
  78. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/llamaindex/__init__.py +0 -0
  79. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/llamaindex/generate.py +0 -0
  80. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/llamaindex/get_files.py +0 -0
  81. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/llamaindex/import_files.py +0 -0
  82. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/logging.py +0 -0
  83. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/lookup/__init__.py +0 -0
  84. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/lookup/model_lookup.yaml +0 -0
  85. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/patches/__init__.py +0 -0
  86. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/patches/langchain/__init__.py +0 -0
  87. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/patches/langchain/lancedb.py +0 -0
  88. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/patches/langchain/vertexai.py +0 -0
  89. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/pubsub/__init__.py +0 -0
  90. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/pubsub/process_pubsub.py +0 -0
  91. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/pubsub/pubsub_manager.py +0 -0
  92. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/qna/__init__.py +0 -0
  93. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/qna/parsers.py +0 -0
  94. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/qna/retry.py +0 -0
  95. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/streaming/__init__.py +0 -0
  96. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/streaming/content_buffer.py +0 -0
  97. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/streaming/langserve.py +0 -0
  98. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/streaming/stream_lookup.py +0 -0
  99. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/streaming/streaming.py +0 -0
  100. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/summarise/__init__.py +0 -0
  101. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/summarise/summarise.py +0 -0
  102. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/__init__.py +0 -0
  103. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/big_context.py +0 -0
  104. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/config.py +0 -0
  105. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/config_schema.py +0 -0
  106. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/gcp.py +0 -0
  107. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/gcp_project.py +0 -0
  108. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/parsers.py +0 -0
  109. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/timedelta.py +0 -0
  110. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/user_ids.py +0 -0
  111. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/utils/version.py +0 -0
  112. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/vertex/__init__.py +0 -0
  113. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/vertex/init.py +0 -0
  114. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/vertex/memory_tools.py +0 -0
  115. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo/vertex/safety.py +0 -0
  116. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo.egg-info/dependency_links.txt +0 -0
  117. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo.egg-info/entry_points.txt +0 -0
  118. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo.egg-info/requires.txt +0 -0
  119. {sunholo-0.66.20 → sunholo-0.66.22}/sunholo.egg-info/top_level.txt +0 -0
  120. {sunholo-0.66.20 → sunholo-0.66.22}/tests/test_chat_history.py +0 -0
  121. {sunholo-0.66.20 → sunholo-0.66.22}/tests/test_chunker.py +0 -0
  122. {sunholo-0.66.20 → sunholo-0.66.22}/tests/test_config.py +0 -0
  123. {sunholo-0.66.20 → sunholo-0.66.22}/tests/test_dispatch_to_qa.py +0 -0
  124. {sunholo-0.66.20 → 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.20
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.20.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.20'
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:
@@ -273,9 +273,8 @@ See more at https://dev.sunholo.com/
273
273
  try:
274
274
  stem = route_vac(vector_name).strip()
275
275
  except ValueError:
276
- stem = f"${{{agent_type.upper()}_BACKEND_URL}}"
277
- log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - using {stem} instead")
278
-
276
+ log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - skipping")
277
+ continue
279
278
 
280
279
  for method, endpoints in default_agent_config.items():
281
280
  # controls if get requests are protected or not
@@ -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
@@ -11,6 +12,7 @@ import sys
11
12
  import subprocess
12
13
  import json
13
14
  import requests
15
+ import os
14
16
  from pathlib import Path
15
17
 
16
18
  from rich import print
@@ -226,22 +228,40 @@ def resolve_service_url(args, no_config=False):
226
228
  if args.url_override:
227
229
 
228
230
  return args.url_override
231
+
232
+ agent_name = load_config_key("agent", args.vac_name, kind="vacConfig")
233
+ agent_url = load_config_key("agent_url", args.vac_name, "vacConfig")
234
+ if agent_url:
235
+ console.print("Found agent_url within vacConfig: {agent_url}")
236
+
237
+ # via public cloud endpoints - assumes no gcloud auth
238
+ if has_multivac_api_key():
239
+ log.debug("Found MULTIVAC_API_KEY")
240
+ gcp_config = load_config_key("gcp_config", "global", "vacConfig")
241
+ endpoints_base_url = gcp_config.get("endpoints_base_url")
242
+ if not endpoints_base_url:
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]")
244
+ sys.exit(1)
245
+
246
+ return f"{endpoints_base_url}/v1/{agent_name}"
229
247
 
230
- if args.no_proxy:
231
- agent_url = load_config_key("agent_url", args.vac_name, "vacConfig")
232
- if agent_url:
233
- console.print("Found agent_url within vacConfig: {agent_url}")
248
+ # via direct access to agent url - requires gcloud auth access
249
+ elif args.no_proxy:
234
250
 
235
- service_url = agent_url or get_cloud_run_service_url(args.project, args.region, args.vac_name)
251
+ service_url = agent_url or get_cloud_run_service_url(args.project, args.region, agent_name)
236
252
  console.print(f"No proxy, connecting directly to {service_url}")
253
+
254
+ return service_url
255
+
237
256
  else:
257
+ # via gcloud proxy - requires gcloud auth access
238
258
  try:
239
259
  service_url = get_service_url(args.vac_name, args.project, args.region, no_config=no_config)
240
260
  except ValueError as e:
241
261
  console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
242
262
  sys.exit(1)
243
263
 
244
- return service_url
264
+ return service_url
245
265
 
246
266
  def vac_command(args):
247
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.20
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.20.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