sunholo 0.66.21__tar.gz → 0.67.0__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.
- {sunholo-0.66.21 → sunholo-0.67.0}/PKG-INFO +2 -2
- {sunholo-0.66.21 → sunholo-0.67.0}/setup.py +1 -1
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/dispatch_to_qa.py +2 -2
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/swagger.py +14 -71
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/auth/run.py +5 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/chat_vac.py +10 -7
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/run_proxy.py +0 -1
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/embedder/embed_chunk.py +17 -0
- sunholo-0.67.0/sunholo/utils/api_key.py +13 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo.egg-info/SOURCES.txt +1 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/LICENSE.txt +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/MANIFEST.in +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/README.md +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/setup.cfg +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/langserve.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/route.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/archive/archive.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/bots/discord.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/data_to_embed_pubsub.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/images.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/publish.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/cli.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/configs.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/embedder.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/cli/swagger.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/components/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/components/llm.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/components/retriever.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/alloydb.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/database.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/lancedb.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/database/uuid.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/llamaindex/generate.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/logging.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/patches/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/qna/parsers.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/qna/retry.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/streaming/stream_lookup.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/big_context.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/config.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/utils/version.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/vertex/init.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/vertex/memory_tools.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo/vertex/safety.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/tests/test_chat_history.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/tests/test_chunker.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/tests/test_config.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/tests/test_dispatch_to_qa.py +0 -0
- {sunholo-0.66.21 → sunholo-0.67.0}/tests/test_swagger.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.67.0
|
|
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.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.67.0.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -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.
|
|
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.
|
|
132
|
+
error_message = f"Something went wrong. {str(err)}"
|
|
133
133
|
if stream:
|
|
134
134
|
return iter([error_message])
|
|
135
135
|
else:
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
@@ -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,7 +12,6 @@ import sys
|
|
|
11
12
|
import subprocess
|
|
12
13
|
import json
|
|
13
14
|
import requests
|
|
14
|
-
import os
|
|
15
15
|
from pathlib import Path
|
|
16
16
|
|
|
17
17
|
from rich import print
|
|
@@ -234,21 +234,24 @@ def resolve_service_url(args, no_config=False):
|
|
|
234
234
|
console.print("Found agent_url within vacConfig: {agent_url}")
|
|
235
235
|
|
|
236
236
|
# via public cloud endpoints - assumes no gcloud auth
|
|
237
|
-
if
|
|
238
|
-
|
|
237
|
+
if has_multivac_api_key():
|
|
238
|
+
log.debug("Found MULTIVAC_API_KEY")
|
|
239
239
|
gcp_config = load_config_key("gcp_config", "global", "vacConfig")
|
|
240
240
|
endpoints_base_url = gcp_config.get("endpoints_base_url")
|
|
241
241
|
if not endpoints_base_url:
|
|
242
242
|
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
243
|
sys.exit(1)
|
|
244
244
|
|
|
245
|
-
|
|
245
|
+
return f"{endpoints_base_url}/v1/{agent_name}"
|
|
246
246
|
|
|
247
247
|
# via direct access to agent url - requires gcloud auth access
|
|
248
248
|
elif args.no_proxy:
|
|
249
249
|
|
|
250
250
|
service_url = agent_url or get_cloud_run_service_url(args.project, args.region, agent_name)
|
|
251
251
|
console.print(f"No proxy, connecting directly to {service_url}")
|
|
252
|
+
|
|
253
|
+
return service_url
|
|
254
|
+
|
|
252
255
|
else:
|
|
253
256
|
# via gcloud proxy - requires gcloud auth access
|
|
254
257
|
try:
|
|
@@ -257,7 +260,7 @@ def resolve_service_url(args, no_config=False):
|
|
|
257
260
|
console.print(f"[bold red]ERROR: Could not start {args.vac_name} proxy URL: {str(e)}[/bold red]")
|
|
258
261
|
sys.exit(1)
|
|
259
262
|
|
|
260
|
-
|
|
263
|
+
return service_url
|
|
261
264
|
|
|
262
265
|
def vac_command(args):
|
|
263
266
|
|
|
@@ -316,7 +319,7 @@ def vac_command(args):
|
|
|
316
319
|
def invoke_vac(service_url, data, vector_name=None, metadata=None, is_file=False):
|
|
317
320
|
try:
|
|
318
321
|
if is_file:
|
|
319
|
-
console.print("Uploading file
|
|
322
|
+
console.print("Uploading file...")
|
|
320
323
|
# Handle file upload
|
|
321
324
|
if not isinstance(data, Path) or not data.is_file():
|
|
322
325
|
raise ValueError("For file uploads, 'data' must be a Path object pointing to a valid file.")
|
|
@@ -331,7 +334,7 @@ def invoke_vac(service_url, data, vector_name=None, metadata=None, is_file=False
|
|
|
331
334
|
|
|
332
335
|
response = requests.post(service_url, files=files, data=form_data)
|
|
333
336
|
else:
|
|
334
|
-
console.print("Uploading JSON
|
|
337
|
+
console.print("Uploading JSON...")
|
|
335
338
|
try:
|
|
336
339
|
if isinstance(data, dict):
|
|
337
340
|
json_data = data
|
|
@@ -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.
|
|
3
|
+
Version: 0.67.0
|
|
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.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.67.0.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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|