sunholo 0.123.5__tar.gz → 0.124.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.
Files changed (189) hide show
  1. {sunholo-0.123.5/src/sunholo.egg-info → sunholo-0.124.0}/PKG-INFO +1 -1
  2. {sunholo-0.123.5 → sunholo-0.124.0}/pyproject.toml +1 -1
  3. sunholo-0.124.0/src/sunholo/embedder/embed_metadata.py +153 -0
  4. {sunholo-0.123.5 → sunholo-0.124.0/src/sunholo.egg-info}/PKG-INFO +1 -1
  5. sunholo-0.123.5/src/sunholo/embedder/embed_metadata.py +0 -27
  6. {sunholo-0.123.5 → sunholo-0.124.0}/LICENSE.txt +0 -0
  7. {sunholo-0.123.5 → sunholo-0.124.0}/MANIFEST.in +0 -0
  8. {sunholo-0.123.5 → sunholo-0.124.0}/README.md +0 -0
  9. {sunholo-0.123.5 → sunholo-0.124.0}/setup.cfg +0 -0
  10. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/__init__.py +0 -0
  11. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/__init__.py +0 -0
  12. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/chat_history.py +0 -0
  13. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/dispatch_to_qa.py +0 -0
  14. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/fastapi/__init__.py +0 -0
  15. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/fastapi/base.py +0 -0
  16. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/fastapi/qna_routes.py +0 -0
  17. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/flask/__init__.py +0 -0
  18. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/flask/base.py +0 -0
  19. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/flask/qna_routes.py +0 -0
  20. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/flask/vac_routes.py +0 -0
  21. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/langserve.py +0 -0
  22. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/pubsub.py +0 -0
  23. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/route.py +0 -0
  24. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/special_commands.py +0 -0
  25. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/agents/swagger.py +0 -0
  26. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/archive/__init__.py +0 -0
  27. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/archive/archive.py +0 -0
  28. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/auth/__init__.py +0 -0
  29. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/auth/gcloud.py +0 -0
  30. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/auth/refresh.py +0 -0
  31. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/auth/run.py +0 -0
  32. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/azure/__init__.py +0 -0
  33. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/azure/auth.py +0 -0
  34. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/azure/blobs.py +0 -0
  35. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/azure/event_grid.py +0 -0
  36. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/bots/__init__.py +0 -0
  37. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/bots/discord.py +0 -0
  38. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/bots/github_webhook.py +0 -0
  39. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/bots/webapp.py +0 -0
  40. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/__init__.py +0 -0
  41. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/azure.py +0 -0
  42. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/doc_handling.py +0 -0
  43. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/encode_metadata.py +0 -0
  44. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/images.py +0 -0
  45. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/loaders.py +0 -0
  46. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/message_data.py +0 -0
  47. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/pdfs.py +0 -0
  48. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/process_chunker_data.py +0 -0
  49. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/publish.py +0 -0
  50. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/pubsub.py +0 -0
  51. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/chunker/splitter.py +0 -0
  52. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/__init__.py +0 -0
  53. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/chat_vac.py +0 -0
  54. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/cli.py +0 -0
  55. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/cli_init.py +0 -0
  56. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/configs.py +0 -0
  57. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/deploy.py +0 -0
  58. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/embedder.py +0 -0
  59. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/merge_texts.py +0 -0
  60. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/run_proxy.py +0 -0
  61. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/sun_rich.py +0 -0
  62. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/swagger.py +0 -0
  63. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/cli/vertex.py +0 -0
  64. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/components/__init__.py +0 -0
  65. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/components/llm.py +0 -0
  66. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/components/retriever.py +0 -0
  67. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/components/vectorstore.py +0 -0
  68. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/custom_logging.py +0 -0
  69. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/__init__.py +0 -0
  70. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/alloydb.py +0 -0
  71. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/alloydb_client.py +0 -0
  72. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/database.py +0 -0
  73. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/lancedb.py +0 -0
  74. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/sql/sb/create_function.sql +0 -0
  75. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/sql/sb/create_function_time.sql +0 -0
  76. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/sql/sb/create_table.sql +0 -0
  77. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/sql/sb/delete_source_row.sql +0 -0
  78. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/sql/sb/return_sources.sql +0 -0
  79. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/sql/sb/setup.sql +0 -0
  80. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/static_dbs.py +0 -0
  81. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/database/uuid.py +0 -0
  82. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/discovery_engine/__init__.py +0 -0
  83. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/discovery_engine/chunker_handler.py +0 -0
  84. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/discovery_engine/cli.py +0 -0
  85. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/discovery_engine/create_new.py +0 -0
  86. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/discovery_engine/discovery_engine_client.py +0 -0
  87. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/discovery_engine/get_ai_search_chunks.py +0 -0
  88. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/embedder/__init__.py +0 -0
  89. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/embedder/embed_chunk.py +0 -0
  90. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/excel/__init__.py +0 -0
  91. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/excel/plugin.py +0 -0
  92. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/gcs/__init__.py +0 -0
  93. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/gcs/add_file.py +0 -0
  94. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/gcs/download_folder.py +0 -0
  95. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/gcs/download_url.py +0 -0
  96. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/gcs/extract_and_sign.py +0 -0
  97. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/gcs/metadata.py +0 -0
  98. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/__init__.py +0 -0
  99. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/file_handling.py +0 -0
  100. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/genaiv2.py +0 -0
  101. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/images.py +0 -0
  102. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/init.py +0 -0
  103. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/process_funcs_cls.py +0 -0
  104. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/genai/safety.py +0 -0
  105. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/invoke/__init__.py +0 -0
  106. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/invoke/async_class.py +0 -0
  107. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/invoke/direct_vac_func.py +0 -0
  108. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/invoke/invoke_vac_utils.py +0 -0
  109. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/langchain_types.py +0 -0
  110. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/langfuse/__init__.py +0 -0
  111. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/langfuse/callback.py +0 -0
  112. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/langfuse/evals.py +0 -0
  113. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/langfuse/prompts.py +0 -0
  114. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/llamaindex/__init__.py +0 -0
  115. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/llamaindex/get_files.py +0 -0
  116. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/llamaindex/import_files.py +0 -0
  117. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/llamaindex/llamaindex_class.py +0 -0
  118. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/llamaindex/user_history.py +0 -0
  119. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/lookup/__init__.py +0 -0
  120. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/lookup/model_lookup.yaml +0 -0
  121. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/mcp/__init__.py +0 -0
  122. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/mcp/cli.py +0 -0
  123. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/ollama/__init__.py +0 -0
  124. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/ollama/ollama_images.py +0 -0
  125. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/pubsub/__init__.py +0 -0
  126. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/pubsub/process_pubsub.py +0 -0
  127. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/pubsub/pubsub_manager.py +0 -0
  128. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/qna/__init__.py +0 -0
  129. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/qna/parsers.py +0 -0
  130. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/qna/retry.py +0 -0
  131. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/senses/__init__.py +0 -0
  132. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/senses/stream_voice.py +0 -0
  133. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/streaming/__init__.py +0 -0
  134. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/streaming/content_buffer.py +0 -0
  135. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/streaming/langserve.py +0 -0
  136. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/streaming/stream_lookup.py +0 -0
  137. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/streaming/streaming.py +0 -0
  138. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/summarise/__init__.py +0 -0
  139. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/summarise/summarise.py +0 -0
  140. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/__init__.py +0 -0
  141. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/agent_service.py +0 -0
  142. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/app.py +0 -0
  143. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/my_log.py +0 -0
  144. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/tools/__init__.py +0 -0
  145. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/tools/your_agent.py +0 -0
  146. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/agent/vac_service.py +0 -0
  147. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/project/__init__.py +0 -0
  148. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/project/app.py +0 -0
  149. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/project/my_log.py +0 -0
  150. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/project/vac_service.py +0 -0
  151. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/system_services/__init__.py +0 -0
  152. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/system_services/app.py +0 -0
  153. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/templates/system_services/my_log.py +0 -0
  154. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/terraform/__init__.py +0 -0
  155. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/terraform/tfvars_editor.py +0 -0
  156. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/tools/__init__.py +0 -0
  157. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/tools/web_browser.py +0 -0
  158. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/__init__.py +0 -0
  159. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/api_key.py +0 -0
  160. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/big_context.py +0 -0
  161. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/config.py +0 -0
  162. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/config_class.py +0 -0
  163. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/config_schema.py +0 -0
  164. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/gcp.py +0 -0
  165. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/gcp_project.py +0 -0
  166. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/mime.py +0 -0
  167. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/parsers.py +0 -0
  168. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/timedelta.py +0 -0
  169. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/user_ids.py +0 -0
  170. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/utils/version.py +0 -0
  171. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/__init__.py +0 -0
  172. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/extensions_call.py +0 -0
  173. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/extensions_class.py +0 -0
  174. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/genai_functions.py +0 -0
  175. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/init.py +0 -0
  176. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/memory_tools.py +0 -0
  177. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/safety.py +0 -0
  178. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo/vertex/type_dict_to_json.py +0 -0
  179. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo.egg-info/SOURCES.txt +0 -0
  180. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo.egg-info/dependency_links.txt +0 -0
  181. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo.egg-info/entry_points.txt +0 -0
  182. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo.egg-info/requires.txt +0 -0
  183. {sunholo-0.123.5 → sunholo-0.124.0}/src/sunholo.egg-info/top_level.txt +0 -0
  184. {sunholo-0.123.5 → sunholo-0.124.0}/tests/test_async.py +0 -0
  185. {sunholo-0.123.5 → sunholo-0.124.0}/tests/test_async_genai2.py +0 -0
  186. {sunholo-0.123.5 → sunholo-0.124.0}/tests/test_chat_history.py +0 -0
  187. {sunholo-0.123.5 → sunholo-0.124.0}/tests/test_config.py +0 -0
  188. {sunholo-0.123.5 → sunholo-0.124.0}/tests/test_genai2.py +0 -0
  189. {sunholo-0.123.5 → sunholo-0.124.0}/tests/test_unstructured.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunholo
3
- Version: 0.123.5
3
+ Version: 0.124.0
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Author-email: Holosun ApS <multivac@sunholo.com>
6
6
  License: Apache License, Version 2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sunholo"
7
- version = "0.123.5"
7
+ version = "0.124.0"
8
8
  description = "Large Language Model DevOps - a package to help deploy LLMs to the Cloud."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1,153 @@
1
+
2
+ import datetime
3
+ import re
4
+
5
+ from ..utils.mime import guess_mime_type
6
+
7
+ from ..custom_logging import log
8
+
9
+ def audit_metadata(metadata, chunk_length=None):
10
+
11
+ if 'eventTime' not in metadata:
12
+ metadata['eventTime'] = datetime.datetime.now().isoformat(timespec='microseconds') + "Z"
13
+ metadata['eventtime'] = metadata['eventTime']
14
+
15
+ # Extract time-based dimensions from eventTime
16
+ try:
17
+ # Handle timestamps in ISO format with Z suffix
18
+ event_time_str = metadata['eventTime']
19
+ if event_time_str.endswith('Z'):
20
+ event_time_str = event_time_str[:-1] # Remove the Z suffix
21
+
22
+ event_time = datetime.datetime.fromisoformat(event_time_str)
23
+
24
+ # Add year dimension (e.g., 2025)
25
+ metadata['year'] = str(event_time.year)
26
+ # Add yearMonth dimension (e.g., 2025-03)
27
+ metadata['yearMonth'] = f"{event_time.year}-{event_time.month:02d}"
28
+ # Add month dimension (e.g., 03)
29
+ metadata['month'] = f"{event_time.month:02d}"
30
+ except (ValueError, TypeError) as e:
31
+ log.warning(f"Could not parse eventTime for time dimensions: {metadata['eventTime']}, error: {e}")
32
+
33
+ if 'source' not in metadata:
34
+ if 'objectId' in metadata:
35
+ metadata['source'] = metadata['objectId']
36
+ elif 'url' in metadata:
37
+ metadata['source'] = metadata['url']
38
+ else:
39
+ log.warning(f"No source found in metadata: {metadata}")
40
+
41
+ if 'original_source' not in metadata:
42
+ metadata['original_source'] = metadata.get('source')
43
+ else:
44
+ metadata['source'] = metadata['original_source']
45
+
46
+ if 'chunk_length' not in metadata:
47
+ metadata['chunk_length'] = chunk_length
48
+
49
+ # Extract folder paths from source field
50
+ if 'source' in metadata and metadata['source']:
51
+ source_path = metadata['source']
52
+
53
+ metadata['mime_type'] = guess_mime_type(source_path)
54
+
55
+ # Extract file extension
56
+ if '.' in source_path.split('/')[-1]:
57
+ file_extension = source_path.split('/')[-1].split('.')[-1].lower()
58
+ metadata['file_extension'] = file_extension
59
+
60
+ # Add file type category
61
+ if file_extension in ['pdf', 'doc', 'docx', 'txt', 'rtf', 'odt']:
62
+ metadata['file_type'] = 'document'
63
+ elif file_extension in ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'webp', 'svg']:
64
+ metadata['file_type'] = 'image'
65
+ elif file_extension in ['mp3', 'wav', 'ogg', 'flac', 'm4a']:
66
+ metadata['file_type'] = 'audio'
67
+ elif file_extension in ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'webm']:
68
+ metadata['file_type'] = 'video'
69
+ elif file_extension in ['xls', 'xlsx', 'csv']:
70
+ metadata['file_type'] = 'spreadsheet'
71
+ elif file_extension in ['ppt', 'pptx']:
72
+ metadata['file_type'] = 'presentation'
73
+ elif file_extension in ['zip', 'rar', 'tar', 'gz', '7z']:
74
+ metadata['file_type'] = 'archive'
75
+ elif file_extension in ['html', 'htm', 'xml', 'json', 'yaml', 'yml']:
76
+ metadata['file_type'] = 'markup'
77
+ elif file_extension in ['py', 'js', 'java', 'c', 'cpp', 'cs', 'go', 'rb', 'php']:
78
+ metadata['file_type'] = 'code'
79
+ else:
80
+ metadata['file_type'] = 'other'
81
+
82
+ # Check if the source looks like a GCS path
83
+ if source_path.startswith('gs://'):
84
+ # Remove the gs:// prefix
85
+ path_without_prefix = source_path[5:]
86
+
87
+ # Split the path into components
88
+ path_components = path_without_prefix.split('/')
89
+
90
+ # The first component is the bucket name
91
+ if len(path_components) > 0:
92
+ metadata['bucket_name'] = path_components[0]
93
+
94
+ # Extract up to 5 folder levels
95
+ for i in range(1, min(6, len(path_components))):
96
+ if i < len(path_components) - 1: # Skip the last component (filename)
97
+ folder_key = f'folder_{i}'
98
+ metadata[folder_key] = path_components[i]
99
+
100
+ # Extract the object name (last component)
101
+ if len(path_components) > 1:
102
+ metadata['object_name'] = path_components[-1]
103
+
104
+ # For other URL types, try to extract paths
105
+ elif re.match(r'^(http|https|s3|file)://', source_path):
106
+ # Extract path part after domain
107
+ match = re.search(r'://[^/]+/(.+)', source_path)
108
+ if match:
109
+ path_part = match.group(1)
110
+ path_components = path_part.split('/')
111
+
112
+ # Extract up to 5 folder levels
113
+ for i in range(0, min(5, len(path_components) - 1)):
114
+ folder_key = f'folder_{i+1}'
115
+ metadata[folder_key] = path_components[i]
116
+
117
+ # Extract the object name (last component)
118
+ if path_components:
119
+ metadata['object_name'] = path_components[-1]
120
+
121
+ # Add file size category if size exists
122
+ if 'size' in metadata and isinstance(metadata['size'], (int, float)):
123
+ size_bytes = metadata['size']
124
+ if size_bytes < 10 * 1024: # < 10KB
125
+ metadata['size_category'] = 'tiny'
126
+ elif size_bytes < 1024 * 1024: # < 1MB
127
+ metadata['size_category'] = 'small'
128
+ elif size_bytes < 10 * 1024 * 1024: # < 10MB
129
+ metadata['size_category'] = 'medium'
130
+ elif size_bytes < 100 * 1024 * 1024: # < 100MB
131
+ metadata['size_category'] = 'large'
132
+ else: # >= 100MB
133
+ metadata['size_category'] = 'very_large'
134
+
135
+ # Add day of week
136
+ try:
137
+ if 'eventTime' in metadata:
138
+ event_time_str = metadata['eventTime']
139
+ if event_time_str.endswith('Z'):
140
+ event_time_str = event_time_str[:-1]
141
+
142
+ event_time = datetime.datetime.fromisoformat(event_time_str)
143
+ weekday_names = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
144
+ metadata['day_of_week'] = weekday_names[event_time.weekday()]
145
+
146
+ # Add quarter information
147
+ quarter = (event_time.month - 1) // 3 + 1
148
+ metadata['quarter'] = f"Q{quarter}"
149
+ metadata['yearQuarter'] = f"{event_time.year}-Q{quarter}"
150
+ except (ValueError, TypeError) as e:
151
+ log.warning(f"Could not extract additional time metadata: {e}")
152
+
153
+ return metadata
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunholo
3
- Version: 0.123.5
3
+ Version: 0.124.0
4
4
  Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
5
5
  Author-email: Holosun ApS <multivac@sunholo.com>
6
6
  License: Apache License, Version 2.0
@@ -1,27 +0,0 @@
1
-
2
- import datetime
3
- from ..custom_logging import log
4
-
5
- def audit_metadata(metadata, chunk_length=None):
6
-
7
- if 'eventTime' not in metadata:
8
- metadata['eventTime'] = datetime.datetime.now().isoformat(timespec='microseconds') + "Z"
9
- metadata['eventtime'] = metadata['eventTime']
10
-
11
- if 'source' not in metadata:
12
- if 'objectId' in metadata:
13
- metadata['source'] = metadata['objectId']
14
- elif 'url' in metadata:
15
- metadata['source'] = metadata['url']
16
- else:
17
- log.warning(f"No source found in metadata: {metadata}")
18
-
19
- if 'original_source' not in metadata:
20
- metadata['original_source'] = metadata.get('source')
21
- else:
22
- metadata['source'] = metadata['original_source']
23
-
24
- if 'chunk_length' not in metadata:
25
- metadata['chunk_length'] = chunk_length
26
-
27
- return metadata
File without changes
File without changes
File without changes
File without changes
File without changes