cwyodmodules 0.3.47__tar.gz → 0.3.49__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 (123) hide show
  1. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/PKG-INFO +2 -2
  2. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/env_helper.py +33 -33
  3. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/mgmt_config.py +48 -32
  4. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules.egg-info/PKG-INFO +2 -2
  5. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules.egg-info/requires.txt +1 -1
  6. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/pyproject.toml +10 -2
  7. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/LICENSE +0 -0
  8. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/README.md +0 -0
  9. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/__init__.py +0 -0
  10. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/api/__init__.py +0 -0
  11. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/api/chat_history.py +0 -0
  12. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/__init__.py +0 -0
  13. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/__init__.py +0 -0
  14. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/chat_history/auth_utils.py +0 -0
  15. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/chat_history/cosmosdb.py +0 -0
  16. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/chat_history/database_client_base.py +0 -0
  17. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/chat_history/database_factory.py +0 -0
  18. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/chat_history/postgresdbservice.py +0 -0
  19. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/chat_history/sample_user.py +0 -0
  20. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/common/__init__.py +0 -0
  21. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/common/answer.py +0 -0
  22. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/common/source_document.py +0 -0
  23. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/__init__.py +0 -0
  24. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/chunking_strategy.py +0 -0
  25. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/document_chunking_base.py +0 -0
  26. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/fixed_size_overlap.py +0 -0
  27. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/layout.py +0 -0
  28. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/page.py +0 -0
  29. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/paragraph.py +0 -0
  30. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_chunking/strategies.py +0 -0
  31. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/__init__.py +0 -0
  32. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/document_loading_base.py +0 -0
  33. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/layout.py +0 -0
  34. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/read.py +0 -0
  35. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/strategies.py +0 -0
  36. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/web.py +0 -0
  37. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/document_loading/word_document.py +0 -0
  38. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/__init__.py +0 -0
  39. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/azure_blob_storage_client.py +0 -0
  40. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/azure_computer_vision_client.py +0 -0
  41. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/azure_form_recognizer_helper.py +0 -0
  42. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/azure_postgres_helper.py +0 -0
  43. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/azure_postgres_helper_light_rag.py +0 -0
  44. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/azure_search_helper.py +0 -0
  45. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/agent_mode.py +0 -0
  46. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/assistant_strategy.py +0 -0
  47. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/config_helper.py +0 -0
  48. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/conversation_flow.py +0 -0
  49. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/database_type.py +0 -0
  50. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/default.json +0 -0
  51. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/default_contract_assistant_prompt.txt +0 -0
  52. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/default_employee_assistant_prompt.txt +0 -0
  53. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/config/embedding_config.py +0 -0
  54. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/document_chunking_helper.py +0 -0
  55. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/document_loading_helper.py +0 -0
  56. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/embedders/embedder_base.py +0 -0
  57. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/embedders/embedder_factory.py +0 -0
  58. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/embedders/integrated_vectorization_embedder.py +0 -0
  59. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/embedders/postgres_embedder.py +0 -0
  60. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/embedders/push_embedder.py +0 -0
  61. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/lightrag_helper.py +0 -0
  62. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/llm_helper.py +0 -0
  63. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/helpers/orchestrator_helper.py +0 -0
  64. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_datasource.py +0 -0
  65. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_index.py +0 -0
  66. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_indexer.py +0 -0
  67. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_skillset.py +0 -0
  68. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/loggers/conversation_logger.py +0 -0
  69. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/__init__.py +0 -0
  70. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/lang_chain_agent.py +0 -0
  71. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/open_ai_functions.py +0 -0
  72. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/orchestration_strategy.py +0 -0
  73. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/orchestrator_base.py +0 -0
  74. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/prompt_flow.py +0 -0
  75. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/semantic_kernel_orchestrator.py +0 -0
  76. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/orchestrator/strategies.py +0 -0
  77. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/parser/__init__.py +0 -0
  78. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/parser/output_parser_tool.py +0 -0
  79. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/parser/parser_base.py +0 -0
  80. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/plugins/chat_plugin.py +0 -0
  81. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/plugins/outlook_calendar_plugin.py +0 -0
  82. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/plugins/post_answering_plugin.py +0 -0
  83. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/azure_search_handler.py +0 -0
  84. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/azure_search_handler_light_rag.py +0 -0
  85. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/integrated_vectorization_search_handler.py +0 -0
  86. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/lightrag_search_handler.py +0 -0
  87. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/postgres_search_handler.py +0 -0
  88. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/postgres_search_handler_light_rag.py +0 -0
  89. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/search.py +0 -0
  90. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/search/search_handler_base.py +0 -0
  91. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/__init__.py +0 -0
  92. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/answer_processing_base.py +0 -0
  93. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/answering_tool_base.py +0 -0
  94. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/content_safety_checker.py +0 -0
  95. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/post_prompt_tool.py +0 -0
  96. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/question_answer_tool.py +0 -0
  97. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/batch/utilities/tools/text_processing_tool.py +0 -0
  98. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/__init__.py +0 -0
  99. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/config.py +0 -0
  100. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/database/__init__.py +0 -0
  101. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/database/base.py +0 -0
  102. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/database/models.py +0 -0
  103. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/indexing/__init__.py +0 -0
  104. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/indexing/chunking.py +0 -0
  105. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/indexing/extraction.py +0 -0
  106. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/indexing/types.py +0 -0
  107. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/indexing/upsert.py +0 -0
  108. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/indexing/utils.py +0 -0
  109. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/llm/__init__.py +0 -0
  110. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/llm/llm.py +0 -0
  111. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/llm/prompt.py +0 -0
  112. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/main.py +0 -0
  113. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/query/__init__.py +0 -0
  114. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/query/generate.py +0 -0
  115. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/query/graph_search.py +0 -0
  116. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/query/types.py +0 -0
  117. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules/graphrag/query/vector_search.py +0 -0
  118. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules.egg-info/SOURCES.txt +0 -0
  119. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules.egg-info/dependency_links.txt +0 -0
  120. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/cwyodmodules.egg-info/top_level.txt +0 -0
  121. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/setup.cfg +0 -0
  122. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/tests/test_api.py +0 -0
  123. {cwyodmodules-0.3.47 → cwyodmodules-0.3.49}/tests/test_batch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cwyodmodules
3
- Version: 0.3.47
3
+ Version: 0.3.49
4
4
  Summary: Add your description here
5
5
  Author-email: Patrik <patrikhartl@gmail.com>
6
6
  Classifier: Operating System :: OS Independent
@@ -40,7 +40,7 @@ Requires-Dist: azure-search-documents==11.6.0b4
40
40
  Requires-Dist: semantic-kernel==1.3.0
41
41
  Requires-Dist: pydantic==2.7.4
42
42
  Requires-Dist: pandas>=2.2.3
43
- Requires-Dist: azpaddypy>=0.3.5
43
+ Requires-Dist: azpaddypy>=0.3.7
44
44
  Dynamic: license-file
45
45
 
46
46
  # paddypy
@@ -7,7 +7,7 @@ from ..orchestrator.orchestration_strategy import OrchestrationStrategy
7
7
  from ..helpers.config.conversation_flow import ConversationFlow
8
8
  from ..helpers.config.database_type import DatabaseType
9
9
 
10
- from mgmt_config import logger, identity, keyvault, create_keyvault_client
10
+ from mgmt_config import logger, identity, keyvault, head_keyvault
11
11
 
12
12
 
13
13
 
@@ -29,23 +29,23 @@ class EnvHelper:
29
29
 
30
30
  logger.info("Initializing EnvHelper")
31
31
 
32
+ if not keyvault:
33
+ raise ValueError("keyvault is not configured. Please set 'key_vault_uri' environment variable.")
34
+
35
+ if not head_keyvault:
36
+ raise ValueError("head_keyvault is not configured. Please set 'head_key_vault_uri' environment variable.")
37
+
32
38
  # Wrapper for Azure Key Vault
33
39
  os.environ["APPLICATIONINSIGHTS_ENABLED"] = "true"
34
40
 
35
- self.secretHelper = keyvault
36
-
37
- self.secretHelperHead = create_keyvault_client(
38
- vault_url=os.environ["head_key_vault_uri"]
39
- )
40
-
41
- # self.secretHelper = SecretHelper(
41
+ # keyvault = SecretHelper(
42
42
  # keyvault_uri="https://www.kv-main-cwyod-res1.vault.azure.net/"
43
43
  # )
44
- # self.secretHelperHead = SecretHelper(
44
+ # head_keyvault = SecretHelper(
45
45
  # keyvault_uri="https://www.kv-main-cwyod-hd-res1.vault.azure.net/"
46
46
  # )
47
47
 
48
- self.LOGLEVEL = self.secretHelper.get_secret("logging-level")
48
+ self.LOGLEVEL = keyvault.get_secret("logging-level")
49
49
  self.LOG_EXECUTION = self.get_env_var_bool(
50
50
  "LOG_EXECUTION", "True"
51
51
  )
@@ -57,18 +57,18 @@ class EnvHelper:
57
57
  )
58
58
 
59
59
  # Azure
60
- self.AZURE_SUBSCRIPTION_ID = self.secretHelper.get_secret("subscription-id")
61
- self.AZURE_RESOURCE_GROUP = self.secretHelper.get_secret("resource-group-name")
62
- self.AZURE_HEAD_RESOURCE_GROUP = self.secretHelperHead.get_secret(
60
+ self.AZURE_SUBSCRIPTION_ID = keyvault.get_secret("subscription-id")
61
+ self.AZURE_RESOURCE_GROUP = keyvault.get_secret("resource-group-name")
62
+ self.AZURE_HEAD_RESOURCE_GROUP = head_keyvault.get_secret(
63
63
  "resource-group-name"
64
64
  )
65
- self.AZURE_RESOURCE_ENVIRONMENT = self.secretHelper.get_secret(
65
+ self.AZURE_RESOURCE_ENVIRONMENT = keyvault.get_secret(
66
66
  "resource-group-environment"
67
67
  )
68
68
  self.AZURE_RESOURCE_PRIVATE = (
69
- self.secretHelper.get_secret("run-private-endpoint").lower() == "true"
69
+ keyvault.get_secret("run-private-endpoint").lower() == "true"
70
70
  )
71
- self.PROJECT_CODE = self.secretHelper.get_secret("project-code")
71
+ self.PROJECT_CODE = keyvault.get_secret("project-code")
72
72
  self.APP_NAME = os.getenv("REFLECTION_NAME", "Default")
73
73
  self.POSTGRESQL_NAME = (
74
74
  f"psql-main-{self.PROJECT_CODE}-{self.AZURE_RESOURCE_ENVIRONMENT}"
@@ -83,7 +83,7 @@ class EnvHelper:
83
83
  f"https://{self.AZURE_BLOB_ACCOUNT_NAME}.blob.core.windows.net/"
84
84
  )
85
85
 
86
- self.AZURE_FUNCTION_APP_ENDPOINT = self.secretHelper.get_secret(
86
+ self.AZURE_FUNCTION_APP_ENDPOINT = keyvault.get_secret(
87
87
  f"func-backend-{self.PROJECT_CODE}-{self.AZURE_RESOURCE_ENVIRONMENT}-endpoint"
88
88
  )
89
89
  self.AZURE_BLOB_CONTAINER_NAME = "documents"
@@ -115,7 +115,7 @@ class EnvHelper:
115
115
  self.AZURE_COSMOSDB_CONVERSATIONS_CONTAINER = os.getenv(
116
116
  "AZURE_COSMOSDB_CONVERSATIONS_CONTAINER_NAME", ""
117
117
  )
118
- self.AZURE_COSMOSDB_ACCOUNT_KEY = self.secretHelper.get_secret(
118
+ self.AZURE_COSMOSDB_ACCOUNT_KEY = keyvault.get_secret(
119
119
  "AZURE_COSMOSDB_ACCOUNT_KEY"
120
120
  )
121
121
  self.AZURE_COSMOSDB_ENABLE_FEEDBACK = (
@@ -142,10 +142,10 @@ class EnvHelper:
142
142
  self.POSTGRESQL_HOST = azure_postgresql_info.get("host", "")
143
143
  else:
144
144
  self.POSTGRESQL_USER = "cwyod_project_uai"
145
- self.POSTGRESQL_DATABASE = self.secretHelper.get_secret(
145
+ self.POSTGRESQL_DATABASE = keyvault.get_secret(
146
146
  f"{self.POSTGRESQL_NAME}-default-database-name"
147
147
  )
148
- self.POSTGRESQL_HOST = self.secretHelper.get_secret(
148
+ self.POSTGRESQL_HOST = keyvault.get_secret(
149
149
  f"{self.POSTGRESQL_NAME}-server-name"
150
150
  )
151
151
  # Ensure integrated vectorization is disabled for PostgreSQL
@@ -177,11 +177,11 @@ class EnvHelper:
177
177
  True if self.AZURE_OPENAI_STREAM.lower() == "true" else False
178
178
  )
179
179
 
180
- # self.AZURE_COMPUTER_VISION_NAME = self.secretHelperHead.get_secret(
180
+ # self.AZURE_COMPUTER_VISION_NAME = head_keyvault.get_secret(
181
181
  # "cognitive-kind-ComputerVision"
182
182
  # )
183
183
  self.AZURE_COMPUTER_VISION_NAME = ""
184
- # self.AZURE_COMPUTER_VISION_ENDPOINT = self.secretHelperHead.get_secret(
184
+ # self.AZURE_COMPUTER_VISION_ENDPOINT = head_keyvault.get_secret(
185
185
  # f"{self.AZURE_COMPUTER_VISION_NAME}-endpoint"
186
186
  # )
187
187
  self.AZURE_COMPUTER_VISION_ENDPOINT = ""
@@ -197,16 +197,16 @@ class EnvHelper:
197
197
  self.AZURE_OPENAI_API_KEY = ""
198
198
  self.AZURE_COMPUTER_VISION_KEY = None
199
199
  else:
200
- self.AZURE_SEARCH_KEY = self.secretHelper.get_secret("AZURE_SEARCH_KEY")
201
- self.AZURE_OPENAI_API_KEY = self.secretHelper.get_secret(
200
+ self.AZURE_SEARCH_KEY = keyvault.get_secret("AZURE_SEARCH_KEY")
201
+ self.AZURE_OPENAI_API_KEY = keyvault.get_secret(
202
202
  "AZURE_OPENAI_API_KEY"
203
203
  )
204
- self.AZURE_COMPUTER_VISION_KEY = self.secretHelper.get_secret(
204
+ self.AZURE_COMPUTER_VISION_KEY = keyvault.get_secret(
205
205
  "AZURE_COMPUTER_VISION_KEY"
206
206
  )
207
207
 
208
208
  # Set env for Azure OpenAI
209
- self.AZURE_AI_SERVICES_NAME = self.secretHelperHead.get_secret(
209
+ self.AZURE_AI_SERVICES_NAME = head_keyvault.get_secret(
210
210
  "cognitive-kind-AIServices"
211
211
  )
212
212
  self.AZURE_OPENAI_ENDPOINT = (
@@ -226,10 +226,10 @@ class EnvHelper:
226
226
 
227
227
  # Azure Form Recognizer
228
228
 
229
- self.AZURE_FORM_RECOGNIZER_NAME = self.secretHelper.get_secret(
229
+ self.AZURE_FORM_RECOGNIZER_NAME = keyvault.get_secret(
230
230
  "cognitive-kind-FormRecognizer"
231
231
  )
232
- self.AZURE_FORM_RECOGNIZER_ENDPOINT = self.secretHelper.get_secret(
232
+ self.AZURE_FORM_RECOGNIZER_ENDPOINT = keyvault.get_secret(
233
233
  f"{self.AZURE_FORM_RECOGNIZER_NAME}-endpoint"
234
234
  )
235
235
 
@@ -238,18 +238,18 @@ class EnvHelper:
238
238
  self.APPLICATIONINSIGHTS_ENABLED = "True"
239
239
 
240
240
  # Azure AI Content Safety
241
- self.AZURE_CONTENT_SAFETY_NAME = self.secretHelperHead.get_secret(
241
+ self.AZURE_CONTENT_SAFETY_NAME = head_keyvault.get_secret(
242
242
  "cognitive-kind-ContentSafety"
243
243
  )
244
- self.AZURE_CONTENT_SAFETY_ENDPOINT = self.secretHelperHead.get_secret(
244
+ self.AZURE_CONTENT_SAFETY_ENDPOINT = head_keyvault.get_secret(
245
245
  f"{self.AZURE_CONTENT_SAFETY_NAME}-endpoint"
246
246
  )
247
247
 
248
248
  # Speech Service
249
- self.AZURE_SPEECH_SERVICE_NAME = self.secretHelperHead.get_secret(
249
+ self.AZURE_SPEECH_SERVICE_NAME = head_keyvault.get_secret(
250
250
  "cognitive-kind-SpeechServices"
251
251
  )
252
- self.AZURE_SPEECH_ENDPOINT = self.secretHelperHead.get_secret(
252
+ self.AZURE_SPEECH_ENDPOINT = head_keyvault.get_secret(
253
253
  f"{self.AZURE_SPEECH_SERVICE_NAME}-endpoint"
254
254
  )
255
255
 
@@ -262,7 +262,7 @@ class EnvHelper:
262
262
  self.AZURE_SPEECH_REGION_ENDPOINT = (
263
263
  f"https://{self.AZURE_SPEECH_SERVICE_REGION}.api.cognitive.microsoft.com/"
264
264
  )
265
- self.AZURE_SPEECH_KEY = self.secretHelperHead.get_secret(f"{self.AZURE_SPEECH_SERVICE_NAME}-key") # changed from None to allow private endpoint communication
265
+ self.AZURE_SPEECH_KEY = head_keyvault.get_secret(f"{self.AZURE_SPEECH_SERVICE_NAME}-key") # changed from None to allow private endpoint communication
266
266
 
267
267
  self.LOAD_CONFIG_FROM_BLOB_STORAGE = self.get_env_var_bool(
268
268
  "LOAD_CONFIG_FROM_BLOB_STORAGE"
@@ -1,24 +1,24 @@
1
1
  """
2
2
  Azure Project Management Configuration Template
3
3
 
4
- This template provides standardized configuration for Azure logging, identity,
5
- and KeyVault management across projects. It creates singleton instances of
6
- AzureLogger, AzureIdentity, and AzureKeyVault that can be imported and used
7
- throughout your application.
4
+ This template provides standardized configuration for Azure logging and identity
5
+ management across projects. It creates singleton instances of AzureLogger and
6
+ AzureIdentity that can be imported and used throughout your application.
8
7
 
9
8
  Usage:
10
- from mgmt_config import logger, identity, keyvault
9
+ from mgmt_config import logger, identity
11
10
 
12
11
  logger.info("Application started")
13
12
  credential = identity.get_credential()
14
- secret = keyvault.get_secret("my-secret") if keyvault else None
15
13
  """
16
14
 
17
15
  import os
18
16
  from typing import Optional, Dict, Any
19
- from azpaddypy.mgmt.logging import create_app_logger
17
+ from azpaddypy.mgmt.logging import create_app_logger, create_function_logger
20
18
  from azpaddypy.mgmt.identity import create_azure_identity
21
- from azpaddypy.resources.keyvault import create_azure_keyvault, AzureKeyVault
19
+ from azpaddypy.resources.keyvault import create_azure_keyvault
20
+
21
+ # Alias for import in other packages
22
22
 
23
23
  # =============================================================================
24
24
  # SERVICE CONFIGURATION
@@ -68,29 +68,40 @@ IDENTITY_CONNECTION_STRING = LOGGER_CONNECTION_STRING
68
68
  # KEYVAULT CONFIGURATION
69
69
  # =============================================================================
70
70
 
71
- # KeyVault URL (optional, will be None if not configured)
71
+ # Azure Key Vault URL (required for Key Vault operations)
72
72
  KEYVAULT_URL = os.getenv("key_vault_uri")
73
+ HEAD_KEYVAULT_URL = os.getenv("head_key_vault_uri")
73
74
 
74
- # KeyVault client enablement settings
75
+ # Enable specific Key Vault client types
75
76
  KEYVAULT_ENABLE_SECRETS = os.getenv("KEYVAULT_ENABLE_SECRETS", "true").lower() == "true"
76
77
  KEYVAULT_ENABLE_KEYS = os.getenv("KEYVAULT_ENABLE_KEYS", "false").lower() == "true"
77
78
  KEYVAULT_ENABLE_CERTIFICATES = os.getenv("KEYVAULT_ENABLE_CERTIFICATES", "false").lower() == "true"
78
79
 
79
- # Connection string for KeyVault logging (uses same as logger by default)
80
+ # Connection string for keyvault logging (uses same as logger by default)
80
81
  KEYVAULT_CONNECTION_STRING = LOGGER_CONNECTION_STRING
81
82
 
82
83
  # =============================================================================
83
84
  # INITIALIZE SERVICES
84
85
  # =============================================================================
85
-
86
86
  # Create logger instance
87
- logger = create_app_logger(
88
- service_name=SERVICE_NAME,
89
- service_version=SERVICE_VERSION,
90
- connection_string=LOGGER_CONNECTION_STRING,
91
- enable_console_logging=LOGGER_ENABLE_CONSOLE,
92
- instrumentation_options=LOGGER_INSTRUMENTATION_OPTIONS,
93
- )
87
+ if "functionapp" in os.getenv("REFLECTION_KIND", "app"):
88
+ logger = create_function_logger(
89
+ function_app_name=os.getenv("REFLECTION_NAME", "app"),
90
+ function_name="backend",
91
+ service_version=SERVICE_VERSION,
92
+ connection_string=LOGGER_CONNECTION_STRING,
93
+ instrumentation_options=LOGGER_INSTRUMENTATION_OPTIONS,
94
+ )
95
+ logger.info("Function logger initialized")
96
+ else:
97
+ logger = create_app_logger(
98
+ service_name=SERVICE_NAME,
99
+ service_version=SERVICE_VERSION,
100
+ connection_string=LOGGER_CONNECTION_STRING,
101
+ enable_console_logging=LOGGER_ENABLE_CONSOLE,
102
+ instrumentation_options=LOGGER_INSTRUMENTATION_OPTIONS,
103
+ )
104
+ logger.info("App logger initialized")
94
105
 
95
106
  # Create identity instance with shared logger
96
107
  identity = create_azure_identity(
@@ -103,7 +114,7 @@ identity = create_azure_identity(
103
114
  logger=logger,
104
115
  )
105
116
 
106
- # Create KeyVault instance with shared logger and identity (only if URL is configured)
117
+ # Create keyvault instance with shared logger and identity (if URL is configured)
107
118
  keyvault = None
108
119
  if KEYVAULT_URL:
109
120
  keyvault = create_azure_keyvault(
@@ -118,12 +129,10 @@ if KEYVAULT_URL:
118
129
  enable_certificates=KEYVAULT_ENABLE_CERTIFICATES,
119
130
  )
120
131
 
121
- def create_keyvault_client(vault_url: str) -> Optional[AzureKeyVault]:
122
- """Creates a secondary KeyVault client for a different vault."""
123
- if not vault_url:
124
- return None
125
- return create_azure_keyvault(
126
- vault_url=vault_url,
132
+ head_keyvault = None
133
+ if HEAD_KEYVAULT_URL:
134
+ head_keyvault = create_azure_keyvault(
135
+ vault_url=HEAD_KEYVAULT_URL,
127
136
  azure_identity=identity,
128
137
  service_name=SERVICE_NAME,
129
138
  service_version=SERVICE_VERSION,
@@ -139,7 +148,7 @@ def create_keyvault_client(vault_url: str) -> Optional[AzureKeyVault]:
139
148
  # =============================================================================
140
149
 
141
150
  # Validate critical configuration
142
- if SERVICE_NAME == "your-service-name":
151
+ if SERVICE_NAME == __name__:
143
152
  logger.warning(
144
153
  "SERVICE_NAME is not configured. Please set SERVICE_NAME environment variable or update this template.",
145
154
  extra={"configuration_issue": "service_name_not_set"}
@@ -153,10 +162,16 @@ if not LOGGER_CONNECTION_STRING:
153
162
 
154
163
  if not KEYVAULT_URL:
155
164
  logger.info(
156
- "No KeyVault URL configured. KeyVault operations will be disabled.",
165
+ "No Key Vault URL configured. Key Vault operations will be disabled.",
157
166
  extra={"keyvault_status": "disabled"}
158
167
  )
159
168
 
169
+ if not HEAD_KEYVAULT_URL:
170
+ logger.info(
171
+ "No Head Key Vault URL configured. Head Key Vault operations will be disabled.",
172
+ extra={"head_keyvault_status": "disabled"}
173
+ )
174
+
160
175
  # Log successful initialization
161
176
  logger.info(
162
177
  f"Management configuration initialized for service '{SERVICE_NAME}' v{SERVICE_VERSION}",
@@ -167,9 +182,10 @@ logger.info(
167
182
  "token_cache_enabled": IDENTITY_ENABLE_TOKEN_CACHE,
168
183
  "telemetry_enabled": bool(LOGGER_CONNECTION_STRING),
169
184
  "keyvault_enabled": bool(KEYVAULT_URL),
170
- "keyvault_secrets_enabled": KEYVAULT_ENABLE_SECRETS,
171
- "keyvault_keys_enabled": KEYVAULT_ENABLE_KEYS,
172
- "keyvault_certificates_enabled": KEYVAULT_ENABLE_CERTIFICATES,
185
+ "head_keyvault_enabled": bool(HEAD_KEYVAULT_URL),
186
+ "keyvault_secrets_enabled": KEYVAULT_ENABLE_SECRETS if KEYVAULT_URL else False,
187
+ "keyvault_keys_enabled": KEYVAULT_ENABLE_KEYS if KEYVAULT_URL else False,
188
+ "keyvault_certificates_enabled": KEYVAULT_ENABLE_CERTIFICATES if KEYVAULT_URL else False,
173
189
  }
174
190
  )
175
191
 
@@ -178,4 +194,4 @@ logger.info(
178
194
  # =============================================================================
179
195
 
180
196
  # Export logger, identity, and keyvault for use in applications
181
- __all__ = ["logger", "identity", "keyvault", "create_keyvault_client"]
197
+ __all__ = ["logger", "identity", "keyvault", "head_keyvault"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cwyodmodules
3
- Version: 0.3.47
3
+ Version: 0.3.49
4
4
  Summary: Add your description here
5
5
  Author-email: Patrik <patrikhartl@gmail.com>
6
6
  Classifier: Operating System :: OS Independent
@@ -40,7 +40,7 @@ Requires-Dist: azure-search-documents==11.6.0b4
40
40
  Requires-Dist: semantic-kernel==1.3.0
41
41
  Requires-Dist: pydantic==2.7.4
42
42
  Requires-Dist: pandas>=2.2.3
43
- Requires-Dist: azpaddypy>=0.3.5
43
+ Requires-Dist: azpaddypy>=0.3.7
44
44
  Dynamic: license-file
45
45
 
46
46
  # paddypy
@@ -31,4 +31,4 @@ azure-search-documents==11.6.0b4
31
31
  semantic-kernel==1.3.0
32
32
  pydantic==2.7.4
33
33
  pandas>=2.2.3
34
- azpaddypy>=0.3.5
34
+ azpaddypy>=0.3.7
@@ -3,7 +3,7 @@ name = "cwyodmodules"
3
3
  authors = [
4
4
  { name="Patrik", email="patrikhartl@gmail.com" },
5
5
  ]
6
- version = '0.3.47'
6
+ version = '0.3.49'
7
7
  description = "Add your description here"
8
8
  readme = "README.md"
9
9
  requires-python = "==3.11.11"
@@ -44,7 +44,15 @@ dependencies = [
44
44
  "semantic-kernel==1.3.0",
45
45
  "pydantic==2.7.4",
46
46
  "pandas>=2.2.3",
47
- "azpaddypy>=0.3.5",
47
+ "azpaddypy>=0.3.7",
48
48
  ]
49
+
50
+ [tool.uv]
51
+ dev-dependencies = [
52
+ "pytest==8.4.1",
53
+ "pytest-asyncio==1.0.0",
54
+ "anyio==4.9.0"
55
+ ]
56
+
49
57
  [tool.setuptools.package-data]
50
58
  '*' = ['*.json','*.txt']
File without changes
File without changes
File without changes