sunholo 0.101.3__tar.gz → 0.101.6__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.101.3 → sunholo-0.101.6}/PKG-INFO +2 -2
- {sunholo-0.101.3 → sunholo-0.101.6}/setup.py +1 -1
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/genai/process_funcs_cls.py +2 -2
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/invoke/async_class.py +17 -37
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo.egg-info/PKG-INFO +2 -2
- {sunholo-0.101.3 → sunholo-0.101.6}/LICENSE.txt +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/MANIFEST.in +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/README.md +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/setup.cfg +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/flask/vac_routes.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/langserve.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/route.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/agents/swagger.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/archive/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/archive/archive.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/auth/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/auth/gcloud.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/auth/refresh.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/auth/run.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/azure/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/azure/auth.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/azure/blobs.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/azure/event_grid.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/bots/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/bots/discord.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/bots/webapp.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/azure.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/encode_metadata.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/images.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/process_chunker_data.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/publish.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/pubsub.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/chat_vac.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/cli.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/configs.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/deploy.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/embedder.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/swagger.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/cli/vertex.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/components/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/components/llm.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/components/retriever.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/custom_logging.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/alloydb.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/alloydb_client.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/database.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/lancedb.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/database/uuid.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/discovery_engine/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/discovery_engine/chunker_handler.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/discovery_engine/create_new.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/discovery_engine/discovery_engine_client.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/discovery_engine/get_ai_search_chunks.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/excel/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/excel/plugin.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/gcs/download_folder.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/gcs/extract_and_sign.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/genai/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/genai/images.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/genai/init.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/genai/safety.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/invoke/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/invoke/direct_vac_func.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/invoke/invoke_vac_utils.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/langfuse/evals.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/llamaindex/llamaindex_class.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/llamaindex/user_history.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/patches/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/patches/langchain/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/patches/langchain/lancedb.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/patches/langchain/vertexai.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/qna/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/qna/parsers.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/qna/retry.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/streaming/stream_lookup.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/terraform/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/terraform/tfvars_editor.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/tools/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/tools/web_browser.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/api_key.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/big_context.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/config.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/config_class.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/gcp.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/mime.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/parsers.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/utils/version.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/extensions_call.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/extensions_class.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/genai_functions.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/init.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/memory_tools.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/safety.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo/vertex/type_dict_to_json.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo.egg-info/SOURCES.txt +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/tests/test_async.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/tests/test_chat_history.py +0 -0
- {sunholo-0.101.3 → sunholo-0.101.6}/tests/test_config.py +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.101.
|
|
3
|
+
Version: 0.101.6
|
|
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.101.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.101.6.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -393,7 +393,7 @@ class GenAIFunctionProcessor:
|
|
|
393
393
|
# If it's a primitive value, return it as is
|
|
394
394
|
return value
|
|
395
395
|
|
|
396
|
-
def run_agent_loop(self, chat:ChatSession, content:list, callback=None, guardrail_max=10, loop_return=3):
|
|
396
|
+
def run_agent_loop(self, chat:ChatSession, content:list, callback=None, guardrail_max=10, loop_return=3): # type: ignore
|
|
397
397
|
"""
|
|
398
398
|
Runs the agent loop, sending messages to the orchestrator, processing responses, and executing functions.
|
|
399
399
|
|
|
@@ -441,7 +441,7 @@ class GenAIFunctionProcessor:
|
|
|
441
441
|
initial=10,
|
|
442
442
|
multiplier=2,
|
|
443
443
|
maximum=60,
|
|
444
|
-
timeout=
|
|
444
|
+
timeout=60
|
|
445
445
|
)
|
|
446
446
|
))
|
|
447
447
|
|
|
@@ -8,10 +8,11 @@ from tenacity import AsyncRetrying, retry_if_exception_type, wait_random_exponen
|
|
|
8
8
|
log = setup_logging("sunholo_AsyncTaskRunner")
|
|
9
9
|
|
|
10
10
|
class AsyncTaskRunner:
|
|
11
|
-
def __init__(self, retry_enabled=False, retry_kwargs=None):
|
|
11
|
+
def __init__(self, retry_enabled=False, retry_kwargs=None, timeout=120):
|
|
12
12
|
self.tasks = []
|
|
13
13
|
self.retry_enabled = retry_enabled
|
|
14
14
|
self.retry_kwargs = retry_kwargs or {}
|
|
15
|
+
self.timeout = timeout
|
|
15
16
|
|
|
16
17
|
def add_task(self, func: Callable[..., Any], *args: Any, **kwargs: Any):
|
|
17
18
|
"""
|
|
@@ -23,7 +24,6 @@ class AsyncTaskRunner:
|
|
|
23
24
|
**kwargs: Keyword arguments for the function.
|
|
24
25
|
"""
|
|
25
26
|
log.info(f"Adding task: {func.__name__} with args: {args}, kwargs: {kwargs}")
|
|
26
|
-
# Store the function name, function itself, args, and kwargs
|
|
27
27
|
self.tasks.append((func.__name__, func, args, kwargs))
|
|
28
28
|
|
|
29
29
|
async def run_async_as_completed(self) -> AsyncGenerator[Dict[str, Any], None]:
|
|
@@ -32,54 +32,36 @@ class AsyncTaskRunner:
|
|
|
32
32
|
while periodically sending heartbeat messages.
|
|
33
33
|
"""
|
|
34
34
|
log.info("Running tasks asynchronously and yielding results as they complete")
|
|
35
|
-
|
|
36
|
-
# Create a queue for inter-coroutine communication
|
|
37
35
|
queue = asyncio.Queue()
|
|
38
|
-
|
|
39
|
-
# List to keep track of all running tasks and their heartbeats
|
|
40
36
|
task_infos = []
|
|
41
37
|
|
|
42
|
-
# Start all tasks and their corresponding heartbeats
|
|
43
38
|
for name, func, args, kwargs in self.tasks:
|
|
44
|
-
# Create an event to signal task completion to the heartbeat
|
|
45
39
|
log.info(f"Executing task: {name=}, {func=} with args: {args}, kwargs: {kwargs}")
|
|
46
40
|
completion_event = asyncio.Event()
|
|
47
|
-
|
|
48
|
-
# Start the main task with retries
|
|
49
|
-
task_coro = self._run_with_retries(name, func, args, kwargs, queue, completion_event)
|
|
41
|
+
task_coro = self._run_with_retries_and_timeout(name, func, args, kwargs, queue, completion_event)
|
|
50
42
|
task = asyncio.create_task(task_coro)
|
|
51
|
-
|
|
52
|
-
# Start the heartbeat coroutine
|
|
53
43
|
heartbeat_coro = self._send_heartbeat(name, completion_event, queue)
|
|
54
44
|
heartbeat_task = asyncio.create_task(heartbeat_coro)
|
|
55
|
-
|
|
56
|
-
# Store task information for management
|
|
57
45
|
task_infos.append({
|
|
58
46
|
'name': name,
|
|
59
47
|
'task': task,
|
|
60
48
|
'heartbeat_task': heartbeat_task,
|
|
61
49
|
'completion_event': completion_event
|
|
62
50
|
})
|
|
63
|
-
|
|
64
51
|
log.info(f"Started task '{name}' and its heartbeat")
|
|
65
52
|
|
|
66
53
|
log.info(f"Started async run with {len(self.tasks)} tasks and heartbeats")
|
|
67
|
-
|
|
68
|
-
# Create a monitor task to detect when all tasks and heartbeats are done
|
|
69
54
|
monitor = asyncio.create_task(self._monitor_tasks(task_infos, queue))
|
|
70
55
|
|
|
71
|
-
# Continuously yield messages from the queue until sentinel is received
|
|
72
56
|
while True:
|
|
73
57
|
message = await queue.get()
|
|
74
58
|
if message is None:
|
|
75
59
|
log.info("Received sentinel. Exiting message loop.")
|
|
76
|
-
break
|
|
60
|
+
break
|
|
77
61
|
log.info(f"Received message from queue: {message}")
|
|
78
62
|
yield message
|
|
79
63
|
|
|
80
|
-
# Wait for the monitor to finish
|
|
81
64
|
await monitor
|
|
82
|
-
|
|
83
65
|
log.info("All tasks and heartbeats have completed")
|
|
84
66
|
|
|
85
67
|
async def _monitor_tasks(self, task_infos, queue):
|
|
@@ -101,22 +83,18 @@ class AsyncTaskRunner:
|
|
|
101
83
|
pass
|
|
102
84
|
log.info(f"Monitor: Heartbeat for task '{info['name']}' has been canceled")
|
|
103
85
|
|
|
104
|
-
# Send a sentinel to indicate completion
|
|
105
86
|
await queue.put(None)
|
|
106
87
|
log.info("Monitor: Sent sentinel to queue")
|
|
107
88
|
|
|
108
|
-
async def
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"""
|
|
116
|
-
Executes a task with optional retries and sends completion or error messages to the queue.
|
|
117
|
-
"""
|
|
89
|
+
async def _run_with_retries_and_timeout(self,
|
|
90
|
+
name: str,
|
|
91
|
+
func: Callable[..., Any],
|
|
92
|
+
args: tuple,
|
|
93
|
+
kwargs: dict,
|
|
94
|
+
queue: asyncio.Queue,
|
|
95
|
+
completion_event: asyncio.Event) -> None:
|
|
118
96
|
try:
|
|
119
|
-
log.info(f"
|
|
97
|
+
log.info(f"run_with_retries_and_timeout: {name=}, {func=} with args: {args}, kwargs: {kwargs}")
|
|
120
98
|
if self.retry_enabled:
|
|
121
99
|
retry_kwargs = {
|
|
122
100
|
'wait': wait_random_exponential(multiplier=1, max=60),
|
|
@@ -127,19 +105,21 @@ class AsyncTaskRunner:
|
|
|
127
105
|
async for attempt in AsyncRetrying(**retry_kwargs):
|
|
128
106
|
with attempt:
|
|
129
107
|
log.info(f"Starting task '{name}' with retry")
|
|
130
|
-
result = await self._execute_task(func, *args, **kwargs)
|
|
108
|
+
result = await asyncio.wait_for(self._execute_task(func, *args, **kwargs), timeout=self.timeout)
|
|
131
109
|
await queue.put({'type': 'task_complete', 'func_name': name, 'result': result})
|
|
132
110
|
log.info(f"Sent 'task_complete' message for task '{name}'")
|
|
133
111
|
return
|
|
134
112
|
else:
|
|
135
113
|
log.info(f"Starting task '{name}' with no retry")
|
|
136
|
-
result = await self._execute_task(func, *args, **kwargs)
|
|
114
|
+
result = await asyncio.wait_for(self._execute_task(func, *args, **kwargs), timeout=self.timeout)
|
|
137
115
|
await queue.put({'type': 'task_complete', 'func_name': name, 'result': result})
|
|
138
116
|
log.info(f"Sent 'task_complete' message for task '{name}'")
|
|
117
|
+
except asyncio.TimeoutError:
|
|
118
|
+
log.error(f"Task '{name}' timed out after {self.timeout} seconds")
|
|
119
|
+
await queue.put({'type': 'task_error', 'func_name': name, 'error': f'Task timed out after {self.timeout} seconds'})
|
|
139
120
|
except Exception as e:
|
|
140
121
|
log.error(f"Error in task '{name}': {e}\n{traceback.format_exc()}")
|
|
141
122
|
await queue.put({'type': 'task_error', 'func_name': name, 'error': f'{e}\n{traceback.format_exc()}'})
|
|
142
|
-
log.info(f"Sent 'task_error' message for task '{name}'")
|
|
143
123
|
finally:
|
|
144
124
|
log.info(f"Task '{name}' completed.")
|
|
145
125
|
completion_event.set()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.101.
|
|
3
|
+
Version: 0.101.6
|
|
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.101.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.101.6.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
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
|
|
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
|