sunholo 0.66.22__tar.gz → 0.67.2__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.22 → sunholo-0.67.2}/PKG-INFO +9 -9
  2. {sunholo-0.66.22 → sunholo-0.67.2}/setup.py +8 -8
  3. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/swagger.py +14 -71
  4. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/publish.py +8 -3
  5. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/chat_vac.py +2 -3
  6. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/alloydb.py +5 -0
  7. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/embedder/embed_chunk.py +17 -0
  8. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo.egg-info/PKG-INFO +9 -9
  9. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo.egg-info/requires.txt +7 -7
  10. {sunholo-0.66.22 → sunholo-0.67.2}/LICENSE.txt +0 -0
  11. {sunholo-0.66.22 → sunholo-0.67.2}/MANIFEST.in +0 -0
  12. {sunholo-0.66.22 → sunholo-0.67.2}/README.md +0 -0
  13. {sunholo-0.66.22 → sunholo-0.67.2}/setup.cfg +0 -0
  14. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/__init__.py +0 -0
  15. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/__init__.py +0 -0
  16. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/chat_history.py +0 -0
  17. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/dispatch_to_qa.py +0 -0
  18. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/fastapi/__init__.py +0 -0
  19. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/fastapi/base.py +0 -0
  20. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/fastapi/qna_routes.py +0 -0
  21. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/flask/__init__.py +0 -0
  22. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/flask/base.py +0 -0
  23. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/flask/qna_routes.py +0 -0
  24. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/langserve.py +0 -0
  25. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/pubsub.py +0 -0
  26. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/route.py +0 -0
  27. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/agents/special_commands.py +0 -0
  28. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/archive/__init__.py +0 -0
  29. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/archive/archive.py +0 -0
  30. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/auth/__init__.py +0 -0
  31. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/auth/run.py +0 -0
  32. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/bots/__init__.py +0 -0
  33. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/bots/discord.py +0 -0
  34. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/bots/github_webhook.py +0 -0
  35. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/bots/webapp.py +0 -0
  36. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/__init__.py +0 -0
  37. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
  38. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/doc_handling.py +0 -0
  39. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/images.py +0 -0
  40. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/loaders.py +0 -0
  41. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/message_data.py +0 -0
  42. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/pdfs.py +0 -0
  43. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/chunker/splitter.py +0 -0
  44. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/__init__.py +0 -0
  45. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/cli.py +0 -0
  46. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/cli_init.py +0 -0
  47. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/configs.py +0 -0
  48. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/deploy.py +0 -0
  49. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/embedder.py +0 -0
  50. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/merge_texts.py +0 -0
  51. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/run_proxy.py +0 -0
  52. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/sun_rich.py +0 -0
  53. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/cli/swagger.py +0 -0
  54. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/components/__init__.py +0 -0
  55. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/components/llm.py +0 -0
  56. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/components/retriever.py +0 -0
  57. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/components/vectorstore.py +0 -0
  58. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/__init__.py +0 -0
  59. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/database.py +0 -0
  60. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/lancedb.py +0 -0
  61. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/sql/sb/create_function.sql +0 -0
  62. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/sql/sb/create_function_time.sql +0 -0
  63. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/sql/sb/create_table.sql +0 -0
  64. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
  65. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/sql/sb/return_sources.sql +0 -0
  66. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/sql/sb/setup.sql +0 -0
  67. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/static_dbs.py +0 -0
  68. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/database/uuid.py +0 -0
  69. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/embedder/__init__.py +0 -0
  70. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/gcs/__init__.py +0 -0
  71. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/gcs/add_file.py +0 -0
  72. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/gcs/download_url.py +0 -0
  73. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/gcs/metadata.py +0 -0
  74. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/langfuse/__init__.py +0 -0
  75. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/langfuse/callback.py +0 -0
  76. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/langfuse/prompts.py +0 -0
  77. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/llamaindex/__init__.py +0 -0
  78. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/llamaindex/generate.py +0 -0
  79. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/llamaindex/get_files.py +0 -0
  80. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/llamaindex/import_files.py +0 -0
  81. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/logging.py +0 -0
  82. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/lookup/__init__.py +0 -0
  83. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/lookup/model_lookup.yaml +0 -0
  84. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/patches/__init__.py +0 -0
  85. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/patches/langchain/__init__.py +0 -0
  86. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/patches/langchain/lancedb.py +0 -0
  87. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/patches/langchain/vertexai.py +0 -0
  88. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/pubsub/__init__.py +0 -0
  89. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/pubsub/process_pubsub.py +0 -0
  90. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/pubsub/pubsub_manager.py +0 -0
  91. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/qna/__init__.py +0 -0
  92. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/qna/parsers.py +0 -0
  93. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/qna/retry.py +0 -0
  94. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/streaming/__init__.py +0 -0
  95. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/streaming/content_buffer.py +0 -0
  96. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/streaming/langserve.py +0 -0
  97. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/streaming/stream_lookup.py +0 -0
  98. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/streaming/streaming.py +0 -0
  99. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/summarise/__init__.py +0 -0
  100. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/summarise/summarise.py +0 -0
  101. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/__init__.py +0 -0
  102. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/api_key.py +0 -0
  103. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/big_context.py +0 -0
  104. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/config.py +0 -0
  105. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/config_schema.py +0 -0
  106. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/gcp.py +0 -0
  107. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/gcp_project.py +0 -0
  108. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/parsers.py +0 -0
  109. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/timedelta.py +0 -0
  110. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/user_ids.py +0 -0
  111. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/utils/version.py +0 -0
  112. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/vertex/__init__.py +0 -0
  113. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/vertex/init.py +0 -0
  114. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/vertex/memory_tools.py +0 -0
  115. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo/vertex/safety.py +0 -0
  116. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo.egg-info/SOURCES.txt +0 -0
  117. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo.egg-info/dependency_links.txt +0 -0
  118. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo.egg-info/entry_points.txt +0 -0
  119. {sunholo-0.66.22 → sunholo-0.67.2}/sunholo.egg-info/top_level.txt +0 -0
  120. {sunholo-0.66.22 → sunholo-0.67.2}/tests/test_chat_history.py +0 -0
  121. {sunholo-0.66.22 → sunholo-0.67.2}/tests/test_chunker.py +0 -0
  122. {sunholo-0.66.22 → sunholo-0.67.2}/tests/test_config.py +0 -0
  123. {sunholo-0.66.22 → sunholo-0.67.2}/tests/test_dispatch_to_qa.py +0 -0
  124. {sunholo-0.66.22 → sunholo-0.67.2}/tests/test_swagger.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.66.22
3
+ Version: 0.67.2
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.22.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.67.2.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -21,7 +21,7 @@ License-File: LICENSE.txt
21
21
  Requires-Dist: google-auth
22
22
  Requires-Dist: ruamel.yaml
23
23
  Requires-Dist: langchain>=0.2.5
24
- Requires-Dist: langchain_experimental
24
+ Requires-Dist: langchain_experimental>0.0.60
25
25
  Requires-Dist: langchain-community
26
26
  Provides-Extra: all
27
27
  Requires-Dist: asyncpg; extra == "all"
@@ -52,7 +52,7 @@ Requires-Dist: langchain-community; extra == "all"
52
52
  Requires-Dist: langchain-openai; extra == "all"
53
53
  Requires-Dist: langchain-google-genai; extra == "all"
54
54
  Requires-Dist: langchain_google_alloydb_pg; extra == "all"
55
- Requires-Dist: langchain-anthropic; extra == "all"
55
+ Requires-Dist: langchain-anthropic>=0.1.13; extra == "all"
56
56
  Requires-Dist: langfuse; extra == "all"
57
57
  Requires-Dist: pg8000; extra == "all"
58
58
  Requires-Dist: pgvector; extra == "all"
@@ -63,7 +63,7 @@ Requires-Dist: rich; extra == "all"
63
63
  Requires-Dist: supabase; extra == "all"
64
64
  Requires-Dist: tiktoken; extra == "all"
65
65
  Provides-Extra: cli
66
- Requires-Dist: jsonschema; extra == "cli"
66
+ Requires-Dist: jsonschema>=4.21.1; extra == "cli"
67
67
  Requires-Dist: rich; extra == "cli"
68
68
  Provides-Extra: database
69
69
  Requires-Dist: asyncpg; extra == "database"
@@ -89,16 +89,16 @@ Requires-Dist: google-cloud-storage; extra == "gcp"
89
89
  Requires-Dist: google-cloud-logging; extra == "gcp"
90
90
  Requires-Dist: google-cloud-pubsub; extra == "gcp"
91
91
  Requires-Dist: google-cloud-discoveryengine; extra == "gcp"
92
- Requires-Dist: google-generativeai; extra == "gcp"
93
- Requires-Dist: langchain-google-genai; extra == "gcp"
94
- Requires-Dist: langchain_google_alloydb_pg; extra == "gcp"
92
+ Requires-Dist: google-generativeai>=0.4.1; extra == "gcp"
93
+ Requires-Dist: langchain-google-genai>=1.0.5; extra == "gcp"
94
+ Requires-Dist: langchain_google_alloydb_pg>=0.2.2; extra == "gcp"
95
95
  Requires-Dist: google-api-python-client; extra == "gcp"
96
96
  Requires-Dist: google-cloud-alloydb-connector[pg8000]; extra == "gcp"
97
97
  Provides-Extra: openai
98
98
  Requires-Dist: langchain-openai; extra == "openai"
99
99
  Requires-Dist: tiktoken; extra == "openai"
100
100
  Provides-Extra: anthropic
101
- Requires-Dist: langchain-anthropic; extra == "anthropic"
101
+ Requires-Dist: langchain-anthropic>=0.1.13; extra == "anthropic"
102
102
  Provides-Extra: http
103
103
  Requires-Dist: fastapi; extra == "http"
104
104
  Requires-Dist: flask; extra == "http"
@@ -1,7 +1,7 @@
1
1
  from setuptools import setup, find_packages
2
2
 
3
3
  # Define your base version
4
- version = '0.66.22'
4
+ version = '0.67.2'
5
5
 
6
6
  setup(
7
7
  name='sunholo',
@@ -32,7 +32,7 @@ setup(
32
32
  #"tenacity==8.3.0", #TODO: remove soon
33
33
  "ruamel.yaml",
34
34
  "langchain>=0.2.5",
35
- "langchain_experimental",
35
+ "langchain_experimental>0.0.60",
36
36
  "langchain-community",
37
37
  # Add the minimal dependencies that your package requires here
38
38
  ],
@@ -67,7 +67,7 @@ setup(
67
67
  "langchain-openai",
68
68
  "langchain-google-genai",
69
69
  "langchain_google_alloydb_pg",
70
- "langchain-anthropic",
70
+ "langchain-anthropic>=0.1.13",
71
71
  "langfuse",
72
72
  "pg8000",
73
73
  "pgvector",
@@ -80,7 +80,7 @@ setup(
80
80
 
81
81
  ],
82
82
  'cli': [
83
- "jsonschema",
83
+ "jsonschema>=4.21.1",
84
84
  "rich"
85
85
  ],
86
86
  'database': [
@@ -109,9 +109,9 @@ setup(
109
109
  "google-cloud-logging",
110
110
  "google-cloud-pubsub",
111
111
  "google-cloud-discoveryengine",
112
- "google-generativeai",
113
- "langchain-google-genai",
114
- "langchain_google_alloydb_pg",
112
+ "google-generativeai>=0.4.1",
113
+ "langchain-google-genai>=1.0.5",
114
+ "langchain_google_alloydb_pg>=0.2.2",
115
115
  "google-api-python-client",
116
116
  "google-cloud-alloydb-connector[pg8000]",
117
117
  ],
@@ -120,7 +120,7 @@ setup(
120
120
  "tiktoken"
121
121
  ],
122
122
  'anthropic': [
123
- "langchain-anthropic",
123
+ "langchain-anthropic>=0.1.13",
124
124
  ],
125
125
  'http': [
126
126
  "fastapi",
@@ -198,24 +198,20 @@ See more at https://dev.sunholo.com/
198
198
  }
199
199
  }
200
200
  }
201
-
202
201
  vac_services = vac_config['vac']
203
202
 
204
- for vector_name, config in vac_services.items():
203
+ def configure_agent(vector_name, config, agent_config_paths):
205
204
  agent_type = config['agent']
206
- agent_config_paths = agent_config['agents'].get(agent_type, {})
207
205
  log.info(f'Configuring swagger for agent_type: {agent_type} for vector_name: {vector_name}')
208
206
  try:
209
207
  stem = route_vac(vector_name).strip()
210
208
  except ValueError:
211
209
  log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - skipping")
212
- continue
213
-
210
+ return
211
+
214
212
  for method, endpoints in agent_config_paths.items():
215
- # controls if get requests are protected or not
216
213
  do_auth = True
217
214
 
218
- # default get: noauth, post: auth
219
215
  if method not in ['get', 'post', 'get-auth', 'post-noauth']:
220
216
  continue
221
217
 
@@ -228,7 +224,7 @@ See more at https://dev.sunholo.com/
228
224
  elif method == 'get':
229
225
  do_auth = False
230
226
  elif method == 'post':
231
- do_auth = True # not needed but to be clear whats happening
227
+ do_auth = True
232
228
 
233
229
  for endpoint_key, endpoint_template in endpoints.items():
234
230
  endpoint_template = endpoint_template.strip()
@@ -262,79 +258,26 @@ See more at https://dev.sunholo.com/
262
258
  }
263
259
  }))
264
260
  }
265
- # Handle default agent configuration for agent types without specific entries
261
+
262
+ for vector_name, config in vac_services.items():
263
+ agent_type = config['agent']
264
+ agent_config_paths = agent_config['agents'].get(agent_type, {})
265
+ configure_agent(vector_name, config, agent_config_paths)
266
+
266
267
  default_agent_config = agent_config['agents'].get('default', {})
267
-
268
+
268
269
  for vector_name, config in vac_services.items():
269
270
  agent_type = config['agent']
270
271
  if agent_type in agent_config['agents']:
271
272
  continue
272
273
  log.info(f'Applying default configuration for agent_type: {agent_type} for vector_name: {vector_name}')
273
- try:
274
- stem = route_vac(vector_name).strip()
275
- except ValueError:
276
- log.warning(f"Failed to find URL stem for {vector_name}/{agent_type} - skipping")
277
- continue
278
-
279
- for method, endpoints in default_agent_config.items():
280
- # controls if get requests are protected or not
281
- do_auth = True
282
-
283
- # default get: noauth, post: auth
284
- if method not in ['get', 'post', 'get-auth', 'post-noauth']:
285
- continue
286
-
287
- if method == 'get-auth':
288
- do_auth = True
289
- method = 'get'
290
- elif method == 'post-noauth':
291
- do_auth = False
292
- method = 'post'
293
- elif method == 'get':
294
- do_auth = False
295
- elif method == 'post':
296
- do_auth = True # not needed but to be clear whats happening
297
-
298
- for endpoint_key, endpoint_template in endpoints.items():
299
- endpoint_template = endpoint_template.strip()
300
- endpoint_address = endpoint_template.replace("{stem}", stem).replace("{vector_name}", vector_name).strip()
301
- endpoint_path = endpoint_template.replace("{stem}", f"/{agent_type}").replace("{vector_name}", vector_name).strip()
302
- log.debug(f"default Endpoint_template: {endpoint_template}")
303
- log.debug(f"default endpoint address: {endpoint_address}")
304
- log.debug(f"default endpoint_path: {endpoint_path}")
305
- if endpoint_path not in swagger_template['paths']:
306
- swagger_template['paths'][endpoint_path] = {}
307
-
308
- operation_id = f"{method}_{agent_type}_{endpoint_key}_{vector_name}"
309
-
310
- security = [{'ApiKeyAuth': []}] if do_auth else [{'None': []}]
311
-
312
- swagger_template['paths'][endpoint_path][method] = {
313
- 'summary': f"{method.capitalize()} {agent_type}",
314
- 'operationId': operation_id,
315
- 'x-google-backend': {
316
- 'address': endpoint_address,
317
- 'protocol': 'h2',
318
- 'deadline': 180000 # Timeout of 3 minutes (1,800,00 milliseconds)
319
- },
320
- 'security': security,
321
- 'responses': copy.deepcopy(default_agent_config.get('response', {}).get(endpoint_key, {
322
- '200': {
323
- 'description': 'Default - A successful response',
324
- 'schema': {
325
- 'type': 'string'
326
- }
327
- }
328
- }))
329
- }
274
+ configure_agent(vector_name, config, default_agent_config)
330
275
 
331
276
  yaml = YAML()
332
- yaml.width = 4096 # to avoid breaking urls
277
+ yaml.width = 4096
333
278
 
334
- # Capture YAML output in a string buffer
335
279
  string_stream = StringIO()
336
280
  yaml.dump(swagger_template, string_stream)
337
281
  yaml_string = string_stream.getvalue()
338
282
 
339
- return yaml_string
340
-
283
+ return yaml_string
@@ -27,9 +27,14 @@ def publish_chunks(chunks: list[Document], vector_name: str):
27
27
 
28
28
  log.info("Publishing chunks to embed_chunk")
29
29
 
30
- pubsub_manager = PubSubManager(vector_name,
31
- pubsub_topic="chunk-to-pubsub-embed",
32
- project_id=project)
30
+ try:
31
+ pubsub_manager = PubSubManager(vector_name,
32
+ pubsub_topic="chunk-to-pubsub-embed",
33
+ project_id=project)
34
+ except Exception as err:
35
+ log.error(f"PubSubManager init error: Could not publish chunks to {project} {vector_name} pubsub_topic chunk-to-pubsub-embed - {str(err)}")
36
+
37
+ return None
33
38
 
34
39
  for chunk in chunks:
35
40
  # Convert chunk to string, as Pub/Sub messages must be strings or bytes
@@ -12,7 +12,6 @@ import sys
12
12
  import subprocess
13
13
  import json
14
14
  import requests
15
- import os
16
15
  from pathlib import Path
17
16
 
18
17
  from rich import print
@@ -320,7 +319,7 @@ def vac_command(args):
320
319
  def invoke_vac(service_url, data, vector_name=None, metadata=None, is_file=False):
321
320
  try:
322
321
  if is_file:
323
- console.print("Uploading file to chunker...")
322
+ console.print("Uploading file...")
324
323
  # Handle file upload
325
324
  if not isinstance(data, Path) or not data.is_file():
326
325
  raise ValueError("For file uploads, 'data' must be a Path object pointing to a valid file.")
@@ -335,7 +334,7 @@ def invoke_vac(service_url, data, vector_name=None, metadata=None, is_file=False
335
334
 
336
335
  response = requests.post(service_url, files=files, data=form_data)
337
336
  else:
338
- console.print("Uploading JSON to chunker...")
337
+ console.print("Uploading JSON...")
339
338
  try:
340
339
  if isinstance(data, dict):
341
340
  json_data = data
@@ -8,6 +8,7 @@ try:
8
8
  from langchain_google_alloydb_pg import AlloyDBEngine, Column, AlloyDBLoader, AlloyDBDocumentSaver
9
9
  from google.cloud.alloydb.connector import IPTypes
10
10
  except ImportError:
11
+ AlloyDBEngine = None
11
12
  pass
12
13
 
13
14
  from .database import get_vector_size
@@ -16,6 +17,10 @@ from ..utils.config import load_config_key
16
17
 
17
18
  def create_alloydb_engine(vector_name):
18
19
 
20
+ if not AlloyDBEngine:
21
+ log.error("Can't create AlloyDBEngine - install via `pip install sunholo[gcp,database]`")
22
+ raise ValueError("Can't import AlloyDBEngine")
23
+
19
24
  alloydb_config = load_config_key(
20
25
  'alloydb_config',
21
26
  vector_name=vector_name,
@@ -124,6 +124,23 @@ def embed_pubsub_chunk(data: dict):
124
124
  if vector_name_other:
125
125
  log.warning(f"Using different vector_name for vectorstore: {vector_name_other} overriding {vector_name}")
126
126
  vector_name = vector_name_other
127
+
128
+ # dynamic vectorstore names (for per user_id stores)
129
+ if value.get('from_metadata_id'):
130
+ the_id = value.get('from_metadata_id')
131
+ log.info(f"Lookup vectorstore vector_name from id: {the_id}")
132
+
133
+ if the_id not in metadata:
134
+ log.warning("Could not find vectorstore from_metadata_id {the_id} in metadata - skipping")
135
+ continue
136
+ else:
137
+ match_id = metadata.get(the_id)
138
+ if match_id:
139
+ vector_name = match_id
140
+ else:
141
+ log.warning("Could not find any value for vectorstore from_metadata_id: {the_id} - skipping")
142
+ continue
143
+
127
144
  vectorstore_obj = pick_vectorstore(vectorstore, vector_name=vector_name, embeddings=embeddings)
128
145
  vs_retriever = vectorstore_obj.as_retriever(search_kwargs=dict(k=3))
129
146
  vectorstore_list.append(vs_retriever)
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sunholo
3
- Version: 0.66.22
3
+ Version: 0.67.2
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.22.tar.gz
6
+ Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.67.2.tar.gz
7
7
  Author: Holosun ApS
8
8
  Author-email: multivac@sunholo.com
9
9
  License: Apache License, Version 2.0
@@ -21,7 +21,7 @@ License-File: LICENSE.txt
21
21
  Requires-Dist: google-auth
22
22
  Requires-Dist: ruamel.yaml
23
23
  Requires-Dist: langchain>=0.2.5
24
- Requires-Dist: langchain_experimental
24
+ Requires-Dist: langchain_experimental>0.0.60
25
25
  Requires-Dist: langchain-community
26
26
  Provides-Extra: all
27
27
  Requires-Dist: asyncpg; extra == "all"
@@ -52,7 +52,7 @@ Requires-Dist: langchain-community; extra == "all"
52
52
  Requires-Dist: langchain-openai; extra == "all"
53
53
  Requires-Dist: langchain-google-genai; extra == "all"
54
54
  Requires-Dist: langchain_google_alloydb_pg; extra == "all"
55
- Requires-Dist: langchain-anthropic; extra == "all"
55
+ Requires-Dist: langchain-anthropic>=0.1.13; extra == "all"
56
56
  Requires-Dist: langfuse; extra == "all"
57
57
  Requires-Dist: pg8000; extra == "all"
58
58
  Requires-Dist: pgvector; extra == "all"
@@ -63,7 +63,7 @@ Requires-Dist: rich; extra == "all"
63
63
  Requires-Dist: supabase; extra == "all"
64
64
  Requires-Dist: tiktoken; extra == "all"
65
65
  Provides-Extra: cli
66
- Requires-Dist: jsonschema; extra == "cli"
66
+ Requires-Dist: jsonschema>=4.21.1; extra == "cli"
67
67
  Requires-Dist: rich; extra == "cli"
68
68
  Provides-Extra: database
69
69
  Requires-Dist: asyncpg; extra == "database"
@@ -89,16 +89,16 @@ Requires-Dist: google-cloud-storage; extra == "gcp"
89
89
  Requires-Dist: google-cloud-logging; extra == "gcp"
90
90
  Requires-Dist: google-cloud-pubsub; extra == "gcp"
91
91
  Requires-Dist: google-cloud-discoveryengine; extra == "gcp"
92
- Requires-Dist: google-generativeai; extra == "gcp"
93
- Requires-Dist: langchain-google-genai; extra == "gcp"
94
- Requires-Dist: langchain_google_alloydb_pg; extra == "gcp"
92
+ Requires-Dist: google-generativeai>=0.4.1; extra == "gcp"
93
+ Requires-Dist: langchain-google-genai>=1.0.5; extra == "gcp"
94
+ Requires-Dist: langchain_google_alloydb_pg>=0.2.2; extra == "gcp"
95
95
  Requires-Dist: google-api-python-client; extra == "gcp"
96
96
  Requires-Dist: google-cloud-alloydb-connector[pg8000]; extra == "gcp"
97
97
  Provides-Extra: openai
98
98
  Requires-Dist: langchain-openai; extra == "openai"
99
99
  Requires-Dist: tiktoken; extra == "openai"
100
100
  Provides-Extra: anthropic
101
- Requires-Dist: langchain-anthropic; extra == "anthropic"
101
+ Requires-Dist: langchain-anthropic>=0.1.13; extra == "anthropic"
102
102
  Provides-Extra: http
103
103
  Requires-Dist: fastapi; extra == "http"
104
104
  Requires-Dist: flask; extra == "http"
@@ -1,7 +1,7 @@
1
1
  google-auth
2
2
  ruamel.yaml
3
3
  langchain>=0.2.5
4
- langchain_experimental
4
+ langchain_experimental>0.0.60
5
5
  langchain-community
6
6
 
7
7
  [all]
@@ -33,7 +33,7 @@ langchain-community
33
33
  langchain-openai
34
34
  langchain-google-genai
35
35
  langchain_google_alloydb_pg
36
- langchain-anthropic
36
+ langchain-anthropic>=0.1.13
37
37
  langfuse
38
38
  pg8000
39
39
  pgvector
@@ -45,10 +45,10 @@ supabase
45
45
  tiktoken
46
46
 
47
47
  [anthropic]
48
- langchain-anthropic
48
+ langchain-anthropic>=0.1.13
49
49
 
50
50
  [cli]
51
- jsonschema
51
+ jsonschema>=4.21.1
52
52
  rich
53
53
 
54
54
  [database]
@@ -71,9 +71,9 @@ google-cloud-storage
71
71
  google-cloud-logging
72
72
  google-cloud-pubsub
73
73
  google-cloud-discoveryengine
74
- google-generativeai
75
- langchain-google-genai
76
- langchain_google_alloydb_pg
74
+ google-generativeai>=0.4.1
75
+ langchain-google-genai>=1.0.5
76
+ langchain_google_alloydb_pg>=0.2.2
77
77
  google-api-python-client
78
78
  google-cloud-alloydb-connector[pg8000]
79
79
 
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