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.
- {sunholo-0.140.12/src/sunholo.egg-info → sunholo-0.140.13}/PKG-INFO +61 -37
- {sunholo-0.140.12 → sunholo-0.140.13}/README.md +60 -36
- {sunholo-0.140.12 → sunholo-0.140.13}/pyproject.toml +1 -1
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/chat_history.py +2 -2
- {sunholo-0.140.12 → sunholo-0.140.13/src/sunholo.egg-info}/PKG-INFO +61 -37
- {sunholo-0.140.12 → sunholo-0.140.13}/LICENSE.txt +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/MANIFEST.in +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/setup.cfg +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/dispatch_to_qa.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/fastapi/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/fastapi/base.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/fastapi/qna_routes.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/flask/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/flask/base.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/flask/vac_routes.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/langserve.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/pubsub.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/route.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/special_commands.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/agents/swagger.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/archive/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/archive/archive.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/gcloud.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/refresh.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/auth/run.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/auth.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/blobs.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/azure/event_grid.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/discord.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/github_webhook.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/bots/webapp.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/azure.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/doc_handling.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/encode_metadata.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/images.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/loaders.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/message_data.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/pdfs.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/process_chunker_data.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/publish.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/pubsub.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/chunker/splitter.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/chat_vac.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/cli.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/cli_init.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/configs.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/deploy.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/embedder.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/merge_texts.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/run_proxy.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/sun_rich.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/swagger.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/cli/vertex.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/llm.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/retriever.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/components/vectorstore.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/custom_logging.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/alloydb.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/alloydb_client.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/database.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/lancedb.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/create_function.sql +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/create_function_time.sql +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/create_table.sql +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/delete_source_row.sql +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/return_sources.sql +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/sql/sb/setup.sql +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/static_dbs.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/database/uuid.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/chunker_handler.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/cli.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/create_new.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/discovery_engine_client.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/get_ai_search_chunks.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/embedder/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/embedder/embed_chunk.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/embedder/embed_metadata.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/excel/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/excel/plugin.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/add_file.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/download_folder.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/download_gcs_text.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/download_url.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/extract_and_sign.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/gcs/metadata.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/file_handling.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/genaiv2.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/images.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/init.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/process_funcs_cls.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/genai/safety.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/async_class.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/direct_vac_func.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/invoke/invoke_vac_utils.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langchain_types.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/callback.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/evals.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/langfuse/prompts.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/get_files.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/import_files.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/llamaindex_class.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/llamaindex/user_history.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/lookup/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/lookup/model_lookup.yaml +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/mcp/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/mcp/cli.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/ollama/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/ollama/ollama_images.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/pubsub/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/pubsub/process_pubsub.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/pubsub/pubsub_manager.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/qna/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/qna/parsers.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/qna/retry.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/senses/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/senses/stream_voice.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/content_buffer.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/langserve.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/stream_lookup.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/streaming/streaming.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/summarise/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/summarise/summarise.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/agent_service.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/app.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/my_log.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/tools/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/tools/your_agent.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/agent/vac_service.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/app.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/my_log.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/project/vac_service.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/system_services/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/system_services/app.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/templates/system_services/my_log.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/terraform/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/terraform/tfvars_editor.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/tools/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/tools/web_browser.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/api_key.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/big_context.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/config.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/config_class.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/config_schema.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/gcp.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/gcp_project.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/mime.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/parsers.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/timedelta.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/user_ids.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/utils/version.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/__init__.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/extensions_call.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/extensions_class.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/genai_functions.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/init.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/memory_tools.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/safety.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/vertex/type_dict_to_json.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/SOURCES.txt +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/dependency_links.txt +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/entry_points.txt +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/requires.txt +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo.egg-info/top_level.txt +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_async.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_async_genai2.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_chat_history.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_config.py +0 -0
- {sunholo-0.140.12 → sunholo-0.140.13}/tests/test_genai2.py +0 -0
- {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.
|
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
|
-
###
|
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
|
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
|
-
#
|
408
|
-
|
409
|
-
|
410
|
-
|
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
|
417
|
+
### Document Processing with Chunker
|
414
418
|
|
415
419
|
```python
|
416
|
-
from sunholo.
|
417
|
-
from sunholo.
|
420
|
+
from sunholo.chunker import direct_file_to_embed
|
421
|
+
from sunholo.utils import ConfigManager
|
418
422
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
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
|
-
#
|
426
|
-
|
427
|
-
client.import_documents(chunks)
|
442
|
+
# Get Vertex AI memory configuration
|
443
|
+
memory_config = get_vertex_memories(config)
|
428
444
|
|
429
|
-
#
|
430
|
-
|
445
|
+
# Use with Vertex AI
|
446
|
+
if memory_config:
|
447
|
+
print(f"Memory tools configured: {memory_config}")
|
431
448
|
```
|
432
449
|
|
433
|
-
### Streaming Flask
|
450
|
+
### Streaming Response with Flask
|
434
451
|
|
435
452
|
```python
|
436
|
-
from sunholo.agents import
|
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
|
-
|
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
|
-
|
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
|
-
###
|
476
|
+
### Discovery Engine Integration
|
454
477
|
|
455
|
-
```
|
456
|
-
|
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
|
-
#
|
464
|
-
|
481
|
+
# Initialize client
|
482
|
+
client = DiscoveryEngineClient(
|
483
|
+
project_id='my-project',
|
484
|
+
data_store_id='my-datastore'
|
485
|
+
)
|
465
486
|
|
466
|
-
#
|
467
|
-
|
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
|
-
###
|
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
|
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
|
-
#
|
222
|
-
|
223
|
-
|
224
|
-
|
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
|
231
|
+
### Document Processing with Chunker
|
228
232
|
|
229
233
|
```python
|
230
|
-
from sunholo.
|
231
|
-
from sunholo.
|
234
|
+
from sunholo.chunker import direct_file_to_embed
|
235
|
+
from sunholo.utils import ConfigManager
|
232
236
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
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
|
-
#
|
240
|
-
|
241
|
-
client.import_documents(chunks)
|
256
|
+
# Get Vertex AI memory configuration
|
257
|
+
memory_config = get_vertex_memories(config)
|
242
258
|
|
243
|
-
#
|
244
|
-
|
259
|
+
# Use with Vertex AI
|
260
|
+
if memory_config:
|
261
|
+
print(f"Memory tools configured: {memory_config}")
|
245
262
|
```
|
246
263
|
|
247
|
-
### Streaming Flask
|
264
|
+
### Streaming Response with Flask
|
248
265
|
|
249
266
|
```python
|
250
|
-
from sunholo.agents import
|
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
|
-
|
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
|
-
|
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
|
-
###
|
290
|
+
### Discovery Engine Integration
|
268
291
|
|
269
|
-
```
|
270
|
-
|
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
|
-
#
|
278
|
-
|
295
|
+
# Initialize client
|
296
|
+
client = DiscoveryEngineClient(
|
297
|
+
project_id='my-project',
|
298
|
+
data_store_id='my-datastore'
|
299
|
+
)
|
279
300
|
|
280
|
-
#
|
281
|
-
|
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
|
@@ -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.
|
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
|
-
###
|
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
|
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
|
-
#
|
408
|
-
|
409
|
-
|
410
|
-
|
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
|
417
|
+
### Document Processing with Chunker
|
414
418
|
|
415
419
|
```python
|
416
|
-
from sunholo.
|
417
|
-
from sunholo.
|
420
|
+
from sunholo.chunker import direct_file_to_embed
|
421
|
+
from sunholo.utils import ConfigManager
|
418
422
|
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
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
|
-
#
|
426
|
-
|
427
|
-
client.import_documents(chunks)
|
442
|
+
# Get Vertex AI memory configuration
|
443
|
+
memory_config = get_vertex_memories(config)
|
428
444
|
|
429
|
-
#
|
430
|
-
|
445
|
+
# Use with Vertex AI
|
446
|
+
if memory_config:
|
447
|
+
print(f"Memory tools configured: {memory_config}")
|
431
448
|
```
|
432
449
|
|
433
|
-
### Streaming Flask
|
450
|
+
### Streaming Response with Flask
|
434
451
|
|
435
452
|
```python
|
436
|
-
from sunholo.agents import
|
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
|
-
|
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
|
-
|
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
|
-
###
|
476
|
+
### Discovery Engine Integration
|
454
477
|
|
455
|
-
```
|
456
|
-
|
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
|
-
#
|
464
|
-
|
481
|
+
# Initialize client
|
482
|
+
client = DiscoveryEngineClient(
|
483
|
+
project_id='my-project',
|
484
|
+
data_store_id='my-datastore'
|
485
|
+
)
|
465
486
|
|
466
|
-
#
|
467
|
-
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{sunholo-0.140.12 → sunholo-0.140.13}/src/sunholo/discovery_engine/discovery_engine_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|