sunholo 0.129.1__tar.gz → 0.130.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.
- {sunholo-0.129.1/src/sunholo.egg-info → sunholo-0.130.2}/PKG-INFO +1 -1
- {sunholo-0.129.1 → sunholo-0.130.2}/pyproject.toml +1 -1
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/flask/vac_routes.py +2 -7
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/custom_logging.py +29 -20
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/alloydb_client.py +3 -1
- {sunholo-0.129.1 → sunholo-0.130.2/src/sunholo.egg-info}/PKG-INFO +1 -1
- {sunholo-0.129.1 → sunholo-0.130.2}/LICENSE.txt +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/MANIFEST.in +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/README.md +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/setup.cfg +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/chat_history.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/flask/qna_routes.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/langserve.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/route.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/agents/swagger.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/archive/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/archive/archive.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/auth/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/auth/gcloud.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/auth/refresh.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/auth/run.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/azure/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/azure/auth.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/azure/blobs.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/azure/event_grid.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/bots/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/bots/discord.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/bots/webapp.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/azure.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/encode_metadata.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/images.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/process_chunker_data.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/publish.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/pubsub.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/chat_vac.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/cli.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/configs.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/deploy.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/embedder.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/swagger.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/cli/vertex.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/components/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/components/llm.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/components/retriever.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/alloydb.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/database.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/lancedb.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/database/uuid.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/discovery_engine/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/discovery_engine/chunker_handler.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/discovery_engine/cli.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/discovery_engine/create_new.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/discovery_engine/discovery_engine_client.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/discovery_engine/get_ai_search_chunks.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/embedder/embed_metadata.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/excel/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/excel/plugin.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/gcs/download_folder.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/gcs/extract_and_sign.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/file_handling.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/genaiv2.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/images.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/init.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/process_funcs_cls.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/genai/safety.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/invoke/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/invoke/async_class.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/invoke/direct_vac_func.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/invoke/invoke_vac_utils.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/langchain_types.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/langfuse/evals.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/llamaindex/llamaindex_class.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/llamaindex/user_history.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/mcp/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/mcp/cli.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/ollama/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/ollama/ollama_images.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/qna/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/qna/parsers.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/qna/retry.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/senses/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/senses/stream_voice.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/streaming/stream_lookup.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/agent_service.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/app.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/my_log.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/tools/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/tools/your_agent.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/agent/vac_service.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/project/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/project/app.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/project/my_log.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/project/vac_service.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/system_services/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/system_services/app.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/templates/system_services/my_log.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/terraform/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/terraform/tfvars_editor.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/tools/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/tools/web_browser.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/api_key.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/big_context.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/config.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/config_class.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/gcp.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/mime.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/parsers.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/utils/version.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/extensions_call.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/extensions_class.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/genai_functions.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/init.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/memory_tools.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/safety.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo/vertex/type_dict_to_json.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo.egg-info/SOURCES.txt +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/src/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/tests/test_async.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/tests/test_async_genai2.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/tests/test_chat_history.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/tests/test_config.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/tests/test_genai2.py +0 -0
- {sunholo-0.129.1 → sunholo-0.130.2}/tests/test_unstructured.py +0 -0
@@ -238,12 +238,10 @@ if __name__ == "__main__":
|
|
238
238
|
|
239
239
|
log.info(f'Streaming data with: {all_input}')
|
240
240
|
if span:
|
241
|
-
|
241
|
+
span.update(
|
242
242
|
name="start_streaming_chat",
|
243
243
|
metadata=vac_config.configs_by_kind,
|
244
|
-
input=all_input
|
245
|
-
completion_start_time=str(int(datetime.datetime.now().timestamp())),
|
246
|
-
model=vac_config.vacConfig("model") or vac_config.vacConfig("llm")
|
244
|
+
input=all_input
|
247
245
|
)
|
248
246
|
|
249
247
|
def generate_response_content():
|
@@ -272,7 +270,6 @@ if __name__ == "__main__":
|
|
272
270
|
if trace:
|
273
271
|
chunk["trace_id"] = trace.id
|
274
272
|
chunk["trace_url"] = trace.get_trace_url()
|
275
|
-
generation.end(output=json.dumps(chunk))
|
276
273
|
span.end(output=json.dumps(chunk))
|
277
274
|
trace.update(output=json.dumps(chunk))
|
278
275
|
archive_qa(chunk, vector_name)
|
@@ -314,7 +311,6 @@ if __name__ == "__main__":
|
|
314
311
|
chunk["trace_url"] = trace.get_trace_url()
|
315
312
|
archive_qa(chunk, vector_name)
|
316
313
|
if trace:
|
317
|
-
generation.end(output=json.dumps(chunk))
|
318
314
|
span.end(output=json.dumps(chunk))
|
319
315
|
trace.update(output=json.dumps(chunk))
|
320
316
|
yield json.dumps(chunk)
|
@@ -330,7 +326,6 @@ if __name__ == "__main__":
|
|
330
326
|
|
331
327
|
log.debug(f"streaming response: {response}")
|
332
328
|
if trace:
|
333
|
-
generation.end(output=response)
|
334
329
|
span.end(output=response)
|
335
330
|
trace.update(output=response)
|
336
331
|
self.langfuse_eval_response(trace_id=trace.id, eval_percent=all_input.get('eval_percent'))
|
@@ -142,14 +142,25 @@ class GoogleCloudLogging:
|
|
142
142
|
"""
|
143
143
|
from .utils.version import sunholo_version
|
144
144
|
|
145
|
+
# Add version to log_text if it exists
|
145
146
|
if log_text is not None:
|
146
147
|
log_text = f"[{sunholo_version()}] {log_text}"
|
147
|
-
# Apply trace ID to log text
|
148
148
|
log_text = self._append_trace_id(log_text)
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
log_struct =
|
150
|
+
# Always create or update log_struct with trace_id if available
|
151
|
+
if not log_struct:
|
152
|
+
log_struct = {}
|
153
|
+
|
154
|
+
# Make sure log_struct is a dictionary
|
155
|
+
if not isinstance(log_struct, dict):
|
156
|
+
log_struct = {"original_non_dict_value": str(log_struct)}
|
157
|
+
|
158
|
+
# Add trace ID to log_struct
|
159
|
+
if hasattr(self, 'trace_id') and self.trace_id:
|
160
|
+
log_struct["trace_id"] = self.trace_id
|
161
|
+
|
162
|
+
# Add version to log_struct
|
163
|
+
log_struct["version"] = sunholo_version()
|
153
164
|
|
154
165
|
if not logger_name and not self.logger_name:
|
155
166
|
raise ValueError("Must provide a logger name e.g. 'run.googleapis.com%2Fstderr'")
|
@@ -159,30 +170,28 @@ class GoogleCloudLogging:
|
|
159
170
|
import logging as log
|
160
171
|
log.basicConfig(level=log.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
161
172
|
if log_text:
|
162
|
-
log.info(f"[{severity}][{logger_name or self.logger_name}][{self.version}] - {log_text}")
|
163
|
-
|
173
|
+
log.info(f"[{severity}][{logger_name or self.logger_name}][{self.version}] - {log_text} - {log_struct}")
|
174
|
+
else:
|
164
175
|
log.info(f"[{severity}][{logger_name or self.logger_name}][{self.version}] - {str(log_struct)}")
|
165
176
|
return
|
166
177
|
|
167
178
|
logger = self.client.logger(logger_name or self.logger_name)
|
168
|
-
|
169
179
|
caller_info = self._get_caller_info()
|
170
180
|
|
181
|
+
# Always log struct, and include message if provided
|
171
182
|
if log_text:
|
172
|
-
|
173
|
-
turn_to_text = str(log_text)
|
174
|
-
logger.log_text(turn_to_text, severity=severity, source_location=caller_info)
|
175
|
-
except Exception as err:
|
176
|
-
print(f"Could not log this: {log_text=} - {str(err)}")
|
183
|
+
log_struct["message"] = log_text
|
177
184
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
185
|
+
try:
|
186
|
+
logger.log_struct(log_struct, severity=severity, source_location=caller_info)
|
187
|
+
except Exception as err:
|
188
|
+
print(f"Failed to log struct: {err}")
|
189
|
+
# Fallback to text logging
|
190
|
+
fallback_message = log_text if log_text else str(log_struct)
|
191
|
+
try:
|
192
|
+
logger.log_text(fallback_message, severity=severity, source_location=caller_info)
|
193
|
+
except Exception as text_err:
|
194
|
+
print(f"Even fallback text logging failed: {text_err}")
|
186
195
|
|
187
196
|
def debug(self, log_text=None, log_struct=None):
|
188
197
|
|
@@ -1167,7 +1167,8 @@ class AlloyDBClient:
|
|
1167
1167
|
'total_rows': len(rows),
|
1168
1168
|
'inserted_rows': 0,
|
1169
1169
|
'failed_rows': 0,
|
1170
|
-
'errors': []
|
1170
|
+
'errors': [],
|
1171
|
+
'return_ids': []
|
1171
1172
|
}
|
1172
1173
|
|
1173
1174
|
for i, row in enumerate(rows):
|
@@ -1197,6 +1198,7 @@ class AlloyDBClient:
|
|
1197
1198
|
|
1198
1199
|
# Insert the row
|
1199
1200
|
result = await self._insert_single_row(table_name, filtered_row, primary_key_column=primary_key_column)
|
1201
|
+
results['return_ids'].append(result)
|
1200
1202
|
results['inserted_rows'] += 1
|
1201
1203
|
|
1202
1204
|
except Exception as e:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|