sunholo 0.140.12__tar.gz → 0.140.13__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 (188) hide show
  1. {sunholo-0.140.12/src/sunholo.egg-info → sunholo-0.140.13}/PKG-INFO +61 -37
  2. {sunholo-0.140.12 → sunholo-0.140.13}/README.md +60 -36
  3. {sunholo-0.140.12 → sunholo-0.140.13}/pyproject.toml +1 -1
  4. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/chat_history.py +2 -2
  5. {sunholo-0.140.12 → sunholo-0.140.13/src/sunholo.egg-info}/PKG-INFO +61 -37
  6. {sunholo-0.140.12 → sunholo-0.140.13}/LICENSE.txt +0 -0
  7. {sunholo-0.140.12 → sunholo-0.140.13}/MANIFEST.in +0 -0
  8. {sunholo-0.140.12 → sunholo-0.140.13}/setup.cfg +0 -0
  9. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/__init__.py +0 -0
  10. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/__init__.py +0 -0
  11. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/dispatch_to_qa.py +0 -0
  12. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/fastapi/__init__.py +0 -0
  13. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/fastapi/base.py +0 -0
  14. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/fastapi/qna_routes.py +0 -0
  15. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/flask/__init__.py +0 -0
  16. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/flask/base.py +0 -0
  17. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/flask/vac_routes.py +0 -0
  18. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/langserve.py +0 -0
  19. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/pubsub.py +0 -0
  20. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/route.py +0 -0
  21. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/special_commands.py +0 -0
  22. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/swagger.py +0 -0
  23. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/archive/__init__.py +0 -0
  24. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/archive/archive.py +0 -0
  25. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/__init__.py +0 -0
  26. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/gcloud.py +0 -0
  27. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/refresh.py +0 -0
  28. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/run.py +0 -0
  29. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/__init__.py +0 -0
  30. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/auth.py +0 -0
  31. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/blobs.py +0 -0
  32. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/event_grid.py +0 -0
  33. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/__init__.py +0 -0
  34. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/discord.py +0 -0
  35. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/github_webhook.py +0 -0
  36. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/webapp.py +0 -0
  37. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/__init__.py +0 -0
  38. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/azure.py +0 -0
  39. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/doc_handling.py +0 -0
  40. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/encode_metadata.py +0 -0
  41. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/images.py +0 -0
  42. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/loaders.py +0 -0
  43. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/message_data.py +0 -0
  44. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/pdfs.py +0 -0
  45. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/process_chunker_data.py +0 -0
  46. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/publish.py +0 -0
  47. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/pubsub.py +0 -0
  48. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/splitter.py +0 -0
  49. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/__init__.py +0 -0
  50. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/chat_vac.py +0 -0
  51. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/cli.py +0 -0
  52. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/cli_init.py +0 -0
  53. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/configs.py +0 -0
  54. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/deploy.py +0 -0
  55. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/embedder.py +0 -0
  56. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/merge_texts.py +0 -0
  57. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/run_proxy.py +0 -0
  58. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/sun_rich.py +0 -0
  59. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/swagger.py +0 -0
  60. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/vertex.py +0 -0
  61. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/__init__.py +0 -0
  62. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/llm.py +0 -0
  63. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/retriever.py +0 -0
  64. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/vectorstore.py +0 -0
  65. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/custom_logging.py +0 -0
  66. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/__init__.py +0 -0
  67. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/alloydb.py +0 -0
  68. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/alloydb_client.py +0 -0
  69. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/database.py +0 -0
  70. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/lancedb.py +0 -0
  71. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/create_function.sql +0 -0
  72. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/create_function_time.sql +0 -0
  73. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/create_table.sql +0 -0
  74. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/delete_source_row.sql +0 -0
  75. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/return_sources.sql +0 -0
  76. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/setup.sql +0 -0
  77. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/static_dbs.py +0 -0
  78. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/uuid.py +0 -0
  79. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/__init__.py +0 -0
  80. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/chunker_handler.py +0 -0
  81. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/cli.py +0 -0
  82. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/create_new.py +0 -0
  83. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/discovery_engine_client.py +0 -0
  84. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/get_ai_search_chunks.py +0 -0
  85. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/embedder/__init__.py +0 -0
  86. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/embedder/embed_chunk.py +0 -0
  87. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/embedder/embed_metadata.py +0 -0
  88. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/excel/__init__.py +0 -0
  89. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/excel/plugin.py +0 -0
  90. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/__init__.py +0 -0
  91. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/add_file.py +0 -0
  92. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/download_folder.py +0 -0
  93. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/download_gcs_text.py +0 -0
  94. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/download_url.py +0 -0
  95. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/extract_and_sign.py +0 -0
  96. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/metadata.py +0 -0
  97. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/__init__.py +0 -0
  98. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/file_handling.py +0 -0
  99. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/genaiv2.py +0 -0
  100. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/images.py +0 -0
  101. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/init.py +0 -0
  102. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/process_funcs_cls.py +0 -0
  103. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/safety.py +0 -0
  104. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/__init__.py +0 -0
  105. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/async_class.py +0 -0
  106. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/direct_vac_func.py +0 -0
  107. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/invoke_vac_utils.py +0 -0
  108. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langchain_types.py +0 -0
  109. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/__init__.py +0 -0
  110. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/callback.py +0 -0
  111. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/evals.py +0 -0
  112. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/prompts.py +0 -0
  113. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/__init__.py +0 -0
  114. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/get_files.py +0 -0
  115. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/import_files.py +0 -0
  116. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/llamaindex_class.py +0 -0
  117. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/user_history.py +0 -0
  118. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/lookup/__init__.py +0 -0
  119. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/lookup/model_lookup.yaml +0 -0
  120. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/mcp/__init__.py +0 -0
  121. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/mcp/cli.py +0 -0
  122. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/ollama/__init__.py +0 -0
  123. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/ollama/ollama_images.py +0 -0
  124. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/pubsub/__init__.py +0 -0
  125. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/pubsub/process_pubsub.py +0 -0
  126. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/pubsub/pubsub_manager.py +0 -0
  127. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/qna/__init__.py +0 -0
  128. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/qna/parsers.py +0 -0
  129. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/qna/retry.py +0 -0
  130. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/senses/__init__.py +0 -0
  131. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/senses/stream_voice.py +0 -0
  132. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/__init__.py +0 -0
  133. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/content_buffer.py +0 -0
  134. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/langserve.py +0 -0
  135. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/stream_lookup.py +0 -0
  136. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/streaming.py +0 -0
  137. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/summarise/__init__.py +0 -0
  138. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/summarise/summarise.py +0 -0
  139. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/__init__.py +0 -0
  140. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/agent_service.py +0 -0
  141. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/app.py +0 -0
  142. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/my_log.py +0 -0
  143. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/tools/__init__.py +0 -0
  144. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/tools/your_agent.py +0 -0
  145. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/vac_service.py +0 -0
  146. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/__init__.py +0 -0
  147. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/app.py +0 -0
  148. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/my_log.py +0 -0
  149. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/vac_service.py +0 -0
  150. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/system_services/__init__.py +0 -0
  151. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/system_services/app.py +0 -0
  152. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/system_services/my_log.py +0 -0
  153. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/terraform/__init__.py +0 -0
  154. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/terraform/tfvars_editor.py +0 -0
  155. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/tools/__init__.py +0 -0
  156. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/tools/web_browser.py +0 -0
  157. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/__init__.py +0 -0
  158. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/api_key.py +0 -0
  159. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/big_context.py +0 -0
  160. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/config.py +0 -0
  161. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/config_class.py +0 -0
  162. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/config_schema.py +0 -0
  163. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/gcp.py +0 -0
  164. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/gcp_project.py +0 -0
  165. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/mime.py +0 -0
  166. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/parsers.py +0 -0
  167. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/timedelta.py +0 -0
  168. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/user_ids.py +0 -0
  169. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/version.py +0 -0
  170. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/__init__.py +0 -0
  171. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/extensions_call.py +0 -0
  172. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/extensions_class.py +0 -0
  173. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/genai_functions.py +0 -0
  174. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/init.py +0 -0
  175. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/memory_tools.py +0 -0
  176. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/safety.py +0 -0
  177. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/type_dict_to_json.py +0 -0
  178. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/SOURCES.txt +0 -0
  179. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/dependency_links.txt +0 -0
  180. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/entry_points.txt +0 -0
  181. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/requires.txt +0 -0
  182. {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/top_level.txt +0 -0
  183. {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_async.py +0 -0
  184. {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_async_genai2.py +0 -0
  185. {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_chat_history.py +0 -0
  186. {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_config.py +0 -0
  187. {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_genai2.py +0 -0
  188. {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_unstructured.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunholo
3
- Version: 0.140.12
3
+ Version: 0.140.13
4
4
  Summary: AI DevOps - a package to help deploy GenAI to the Cloud.
5
5
  Author-email: Holosun ApS <multivac@sunholo.com>
6
6
  License: Apache License, Version 2.0
@@ -393,78 +393,102 @@ sunholo proxy list # List running proxies
393
393
 
394
394
  ## 📝 Examples
395
395
 
396
- ### Vertex AI Chat with Memory
396
+ ### Chat with History Extraction
397
397
 
398
398
  ```python
399
399
  from sunholo.utils import ConfigManager
400
400
  from sunholo.components import pick_llm
401
- from sunholo.agents import memory_client
401
+ from sunholo.agents import extract_chat_history
402
402
 
403
403
  config = ConfigManager('my-agent')
404
404
  llm = pick_llm(config=config)
405
- memory = memory_client(config=config)
406
405
 
407
- # Chat with context
408
- response = llm.invoke("What is Google Cloud?")
409
- memory.add_message("user", "What is Google Cloud?")
410
- memory.add_message("assistant", response)
406
+ # Extract chat history from messages
407
+ chat_history = [
408
+ {"role": "user", "content": "Hello"},
409
+ {"role": "assistant", "content": "Hi there!"}
410
+ ]
411
+ history_str = extract_chat_history(chat_history)
412
+
413
+ # Use in prompt
414
+ response = llm.invoke(f"Given this history:\n{history_str}\n\nUser: How are you?")
411
415
  ```
412
416
 
413
- ### Document Processing with Discovery Engine
417
+ ### Document Processing with Chunker
414
418
 
415
419
  ```python
416
- from sunholo.discovery_engine import DiscoveryEngineClient
417
- from sunholo.chunker import chunk_doc
420
+ from sunholo.chunker import direct_file_to_embed
421
+ from sunholo.utils import ConfigManager
418
422
 
419
- # Initialize client
420
- client = DiscoveryEngineClient(
421
- project_id='my-project',
422
- data_store_id='my-datastore'
423
+ config = ConfigManager('my-agent')
424
+
425
+ # Process a file directly
426
+ result = direct_file_to_embed(
427
+ "document.pdf",
428
+ embed_prefix="doc",
429
+ metadata={"source": "user_upload"},
430
+ vectorstore=config.vacConfig("vectorstore")
423
431
  )
432
+ ```
433
+
434
+ ### Vertex AI with Memory Tools
435
+
436
+ ```python
437
+ from sunholo.vertex import get_vertex_memories
438
+ from sunholo.utils import ConfigManager
439
+
440
+ config = ConfigManager('my-agent')
424
441
 
425
- # Process and index document
426
- chunks = chunk_doc.chunk_file("document.pdf", chunk_size=1000)
427
- client.import_documents(chunks)
442
+ # Get Vertex AI memory configuration
443
+ memory_config = get_vertex_memories(config)
428
444
 
429
- # Search
430
- results = client.search("What is the main topic?")
445
+ # Use with Vertex AI
446
+ if memory_config:
447
+ print(f"Memory tools configured: {memory_config}")
431
448
  ```
432
449
 
433
- ### Streaming Flask API
450
+ ### Streaming Response with Flask
434
451
 
435
452
  ```python
436
- from sunholo.agents import dispatch_to_qa
453
+ from sunholo.agents import send_to_qa
454
+ from flask import Response, request
437
455
 
438
456
  @app.route('/vac/streaming/<vac_name>', methods=['POST'])
439
457
  def streaming_endpoint(vac_name):
440
458
  question = request.json.get('user_input')
441
459
 
442
460
  def generate():
443
- for chunk in dispatch_to_qa(
461
+ # Stream responses from the QA system
462
+ response = send_to_qa(
444
463
  question,
445
464
  vac_name=vac_name,
446
465
  stream=True
447
- ):
448
- yield f"data: {chunk}\n\n"
466
+ )
467
+ if hasattr(response, '__iter__'):
468
+ for chunk in response:
469
+ yield f"data: {chunk}\n\n"
470
+ else:
471
+ yield f"data: {response}\n\n"
449
472
 
450
473
  return Response(generate(), content_type='text/event-stream')
451
474
  ```
452
475
 
453
- ### Deploy from Template
476
+ ### Discovery Engine Integration
454
477
 
455
- ```bash
456
- # Create from template
457
- sunholo init my-api --template agent
458
-
459
- # Customize configuration
460
- cd my-api
461
- vi config/vac_config.yaml
478
+ ```python
479
+ from sunholo.discovery_engine import DiscoveryEngineClient
462
480
 
463
- # Test locally
464
- sunholo vac chat my-agent --local
481
+ # Initialize client
482
+ client = DiscoveryEngineClient(
483
+ project_id='my-project',
484
+ data_store_id='my-datastore'
485
+ )
465
486
 
466
- # Deploy to production
467
- sunholo deploy my-agent
487
+ # Search documents
488
+ results = client.search("What is Vertex AI?")
489
+ for result in results:
490
+ print(f"Content: {result.chunk.content}")
491
+ print(f"Score: {result.relevance_score}")
468
492
  ```
469
493
 
470
494
  ## 🧪 Testing
@@ -207,78 +207,102 @@ sunholo proxy list # List running proxies
207
207
 
208
208
  ## 📝 Examples
209
209
 
210
- ### Vertex AI Chat with Memory
210
+ ### Chat with History Extraction
211
211
 
212
212
  ```python
213
213
  from sunholo.utils import ConfigManager
214
214
  from sunholo.components import pick_llm
215
- from sunholo.agents import memory_client
215
+ from sunholo.agents import extract_chat_history
216
216
 
217
217
  config = ConfigManager('my-agent')
218
218
  llm = pick_llm(config=config)
219
- memory = memory_client(config=config)
220
219
 
221
- # Chat with context
222
- response = llm.invoke("What is Google Cloud?")
223
- memory.add_message("user", "What is Google Cloud?")
224
- memory.add_message("assistant", response)
220
+ # Extract chat history from messages
221
+ chat_history = [
222
+ {"role": "user", "content": "Hello"},
223
+ {"role": "assistant", "content": "Hi there!"}
224
+ ]
225
+ history_str = extract_chat_history(chat_history)
226
+
227
+ # Use in prompt
228
+ response = llm.invoke(f"Given this history:\n{history_str}\n\nUser: How are you?")
225
229
  ```
226
230
 
227
- ### Document Processing with Discovery Engine
231
+ ### Document Processing with Chunker
228
232
 
229
233
  ```python
230
- from sunholo.discovery_engine import DiscoveryEngineClient
231
- from sunholo.chunker import chunk_doc
234
+ from sunholo.chunker import direct_file_to_embed
235
+ from sunholo.utils import ConfigManager
232
236
 
233
- # Initialize client
234
- client = DiscoveryEngineClient(
235
- project_id='my-project',
236
- data_store_id='my-datastore'
237
+ config = ConfigManager('my-agent')
238
+
239
+ # Process a file directly
240
+ result = direct_file_to_embed(
241
+ "document.pdf",
242
+ embed_prefix="doc",
243
+ metadata={"source": "user_upload"},
244
+ vectorstore=config.vacConfig("vectorstore")
237
245
  )
246
+ ```
247
+
248
+ ### Vertex AI with Memory Tools
249
+
250
+ ```python
251
+ from sunholo.vertex import get_vertex_memories
252
+ from sunholo.utils import ConfigManager
253
+
254
+ config = ConfigManager('my-agent')
238
255
 
239
- # Process and index document
240
- chunks = chunk_doc.chunk_file("document.pdf", chunk_size=1000)
241
- client.import_documents(chunks)
256
+ # Get Vertex AI memory configuration
257
+ memory_config = get_vertex_memories(config)
242
258
 
243
- # Search
244
- results = client.search("What is the main topic?")
259
+ # Use with Vertex AI
260
+ if memory_config:
261
+ print(f"Memory tools configured: {memory_config}")
245
262
  ```
246
263
 
247
- ### Streaming Flask API
264
+ ### Streaming Response with Flask
248
265
 
249
266
  ```python
250
- from sunholo.agents import dispatch_to_qa
267
+ from sunholo.agents import send_to_qa
268
+ from flask import Response, request
251
269
 
252
270
  @app.route('/vac/streaming/<vac_name>', methods=['POST'])
253
271
  def streaming_endpoint(vac_name):
254
272
  question = request.json.get('user_input')
255
273
 
256
274
  def generate():
257
- for chunk in dispatch_to_qa(
275
+ # Stream responses from the QA system
276
+ response = send_to_qa(
258
277
  question,
259
278
  vac_name=vac_name,
260
279
  stream=True
261
- ):
262
- yield f"data: {chunk}\n\n"
280
+ )
281
+ if hasattr(response, '__iter__'):
282
+ for chunk in response:
283
+ yield f"data: {chunk}\n\n"
284
+ else:
285
+ yield f"data: {response}\n\n"
263
286
 
264
287
  return Response(generate(), content_type='text/event-stream')
265
288
  ```
266
289
 
267
- ### Deploy from Template
290
+ ### Discovery Engine Integration
268
291
 
269
- ```bash
270
- # Create from template
271
- sunholo init my-api --template agent
272
-
273
- # Customize configuration
274
- cd my-api
275
- vi config/vac_config.yaml
292
+ ```python
293
+ from sunholo.discovery_engine import DiscoveryEngineClient
276
294
 
277
- # Test locally
278
- sunholo vac chat my-agent --local
295
+ # Initialize client
296
+ client = DiscoveryEngineClient(
297
+ project_id='my-project',
298
+ data_store_id='my-datastore'
299
+ )
279
300
 
280
- # Deploy to production
281
- sunholo deploy my-agent
301
+ # Search documents
302
+ results = client.search("What is Vertex AI?")
303
+ for result in results:
304
+ print(f"Content: {result.chunk.content}")
305
+ print(f"Score: {result.relevance_score}")
282
306
  ```
283
307
 
284
308
  ## 🧪 Testing
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sunholo"
7
- version = "0.140.12"
7
+ version = "0.140.13"
8
8
  description = "AI DevOps - a package to help deploy GenAI to the Cloud."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -441,10 +441,10 @@ def create_message_element(message: dict):
441
441
  ```
442
442
  """
443
443
  if 'text' in message: # This is a Slack or Google Chat message
444
- log.info(f"Found text element - {message['text']}")
444
+ #log.info(f"Found text element - {message['text']}")
445
445
  return message['text']
446
446
  elif 'content' in message: # Discord or OpenAI history message
447
- log.info(f"Found content element - {message['content']}")
447
+ #log.info(f"Found content element - {message['content']}")
448
448
  return message['content']
449
449
  else:
450
450
  raise KeyError(f"Could not extract 'content' or 'text' element from message: {message}, {type(message)}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sunholo
3
- Version: 0.140.12
3
+ Version: 0.140.13
4
4
  Summary: AI DevOps - a package to help deploy GenAI to the Cloud.
5
5
  Author-email: Holosun ApS <multivac@sunholo.com>
6
6
  License: Apache License, Version 2.0
@@ -393,78 +393,102 @@ sunholo proxy list # List running proxies
393
393
 
394
394
  ## 📝 Examples
395
395
 
396
- ### Vertex AI Chat with Memory
396
+ ### Chat with History Extraction
397
397
 
398
398
  ```python
399
399
  from sunholo.utils import ConfigManager
400
400
  from sunholo.components import pick_llm
401
- from sunholo.agents import memory_client
401
+ from sunholo.agents import extract_chat_history
402
402
 
403
403
  config = ConfigManager('my-agent')
404
404
  llm = pick_llm(config=config)
405
- memory = memory_client(config=config)
406
405
 
407
- # Chat with context
408
- response = llm.invoke("What is Google Cloud?")
409
- memory.add_message("user", "What is Google Cloud?")
410
- memory.add_message("assistant", response)
406
+ # Extract chat history from messages
407
+ chat_history = [
408
+ {"role": "user", "content": "Hello"},
409
+ {"role": "assistant", "content": "Hi there!"}
410
+ ]
411
+ history_str = extract_chat_history(chat_history)
412
+
413
+ # Use in prompt
414
+ response = llm.invoke(f"Given this history:\n{history_str}\n\nUser: How are you?")
411
415
  ```
412
416
 
413
- ### Document Processing with Discovery Engine
417
+ ### Document Processing with Chunker
414
418
 
415
419
  ```python
416
- from sunholo.discovery_engine import DiscoveryEngineClient
417
- from sunholo.chunker import chunk_doc
420
+ from sunholo.chunker import direct_file_to_embed
421
+ from sunholo.utils import ConfigManager
418
422
 
419
- # Initialize client
420
- client = DiscoveryEngineClient(
421
- project_id='my-project',
422
- data_store_id='my-datastore'
423
+ config = ConfigManager('my-agent')
424
+
425
+ # Process a file directly
426
+ result = direct_file_to_embed(
427
+ "document.pdf",
428
+ embed_prefix="doc",
429
+ metadata={"source": "user_upload"},
430
+ vectorstore=config.vacConfig("vectorstore")
423
431
  )
432
+ ```
433
+
434
+ ### Vertex AI with Memory Tools
435
+
436
+ ```python
437
+ from sunholo.vertex import get_vertex_memories
438
+ from sunholo.utils import ConfigManager
439
+
440
+ config = ConfigManager('my-agent')
424
441
 
425
- # Process and index document
426
- chunks = chunk_doc.chunk_file("document.pdf", chunk_size=1000)
427
- client.import_documents(chunks)
442
+ # Get Vertex AI memory configuration
443
+ memory_config = get_vertex_memories(config)
428
444
 
429
- # Search
430
- results = client.search("What is the main topic?")
445
+ # Use with Vertex AI
446
+ if memory_config:
447
+ print(f"Memory tools configured: {memory_config}")
431
448
  ```
432
449
 
433
- ### Streaming Flask API
450
+ ### Streaming Response with Flask
434
451
 
435
452
  ```python
436
- from sunholo.agents import dispatch_to_qa
453
+ from sunholo.agents import send_to_qa
454
+ from flask import Response, request
437
455
 
438
456
  @app.route('/vac/streaming/<vac_name>', methods=['POST'])
439
457
  def streaming_endpoint(vac_name):
440
458
  question = request.json.get('user_input')
441
459
 
442
460
  def generate():
443
- for chunk in dispatch_to_qa(
461
+ # Stream responses from the QA system
462
+ response = send_to_qa(
444
463
  question,
445
464
  vac_name=vac_name,
446
465
  stream=True
447
- ):
448
- yield f"data: {chunk}\n\n"
466
+ )
467
+ if hasattr(response, '__iter__'):
468
+ for chunk in response:
469
+ yield f"data: {chunk}\n\n"
470
+ else:
471
+ yield f"data: {response}\n\n"
449
472
 
450
473
  return Response(generate(), content_type='text/event-stream')
451
474
  ```
452
475
 
453
- ### Deploy from Template
476
+ ### Discovery Engine Integration
454
477
 
455
- ```bash
456
- # Create from template
457
- sunholo init my-api --template agent
458
-
459
- # Customize configuration
460
- cd my-api
461
- vi config/vac_config.yaml
478
+ ```python
479
+ from sunholo.discovery_engine import DiscoveryEngineClient
462
480
 
463
- # Test locally
464
- sunholo vac chat my-agent --local
481
+ # Initialize client
482
+ client = DiscoveryEngineClient(
483
+ project_id='my-project',
484
+ data_store_id='my-datastore'
485
+ )
465
486
 
466
- # Deploy to production
467
- sunholo deploy my-agent
487
+ # Search documents
488
+ results = client.search("What is Vertex AI?")
489
+ for result in results:
490
+ print(f"Content: {result.chunk.content}")
491
+ print(f"Score: {result.relevance_score}")
468
492
  ```
469
493
 
470
494
  ## 🧪 Testing
File without changes
File without changes
File without changes