cwyodmodules 0.3.27__tar.gz → 0.3.29__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 (120) hide show
  1. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/PKG-INFO +1 -1
  2. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/api/chat_history.py +1 -1
  3. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/chat_history/auth_utils.py +1 -1
  4. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_computer_vision_client.py +4 -2
  5. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_form_recognizer_helper.py +1 -1
  6. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_identity_helper.py +15 -11
  7. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_postgres_helper.py +7 -7
  8. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_postgres_helper_light_rag.py +6 -6
  9. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_search_helper.py +2 -2
  10. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/config_helper.py +1 -1
  11. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/embedders/integrated_vectorization_embedder.py +1 -1
  12. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/embedders/postgres_embedder.py +1 -1
  13. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/embedders/push_embedder.py +1 -1
  14. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/lightrag_helper.py +9 -8
  15. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/llm_helper.py +2 -2
  16. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/secret_helper.py +1 -1
  17. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_index.py +2 -2
  18. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_indexer.py +2 -2
  19. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_skillset.py +2 -2
  20. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/lang_chain_agent.py +1 -1
  21. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/open_ai_functions.py +1 -1
  22. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/orchestrator_base.py +9 -3
  23. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/prompt_flow.py +1 -1
  24. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/azure_search_handler.py +1 -1
  25. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/azure_search_handler_light_rag.py +2 -2
  26. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/lightrag_search_handler.py +3 -2
  27. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules.egg-info/PKG-INFO +1 -1
  28. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/pyproject.toml +1 -1
  29. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/LICENSE +0 -0
  30. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/README.md +0 -0
  31. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/api/__init__.py +0 -0
  32. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/__init__.py +0 -0
  33. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/__init__.py +0 -0
  34. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/chat_history/cosmosdb.py +0 -0
  35. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/chat_history/database_client_base.py +0 -0
  36. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/chat_history/database_factory.py +0 -0
  37. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/chat_history/postgresdbservice.py +0 -0
  38. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/chat_history/sample_user.py +0 -0
  39. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/common/__init__.py +0 -0
  40. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/common/answer.py +0 -0
  41. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/common/source_document.py +0 -0
  42. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/__init__.py +0 -0
  43. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/chunking_strategy.py +0 -0
  44. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/document_chunking_base.py +0 -0
  45. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/fixed_size_overlap.py +0 -0
  46. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/layout.py +0 -0
  47. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/page.py +0 -0
  48. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/paragraph.py +0 -0
  49. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_chunking/strategies.py +0 -0
  50. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/__init__.py +0 -0
  51. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/document_loading_base.py +0 -0
  52. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/layout.py +0 -0
  53. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/read.py +0 -0
  54. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/strategies.py +0 -0
  55. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/web.py +0 -0
  56. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/document_loading/word_document.py +0 -0
  57. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/__init__.py +0 -0
  58. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/azure_blob_storage_client.py +0 -0
  59. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/assistant_strategy.py +0 -0
  60. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/conversation_flow.py +0 -0
  61. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/database_type.py +0 -0
  62. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/default.json +0 -0
  63. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/default_contract_assistant_prompt.txt +0 -0
  64. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/default_employee_assistant_prompt.txt +0 -0
  65. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/config/embedding_config.py +0 -0
  66. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/document_chunking_helper.py +0 -0
  67. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/document_loading_helper.py +0 -0
  68. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/embedders/embedder_base.py +0 -0
  69. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/embedders/embedder_factory.py +0 -0
  70. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/env_helper.py +0 -0
  71. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/helpers/orchestrator_helper.py +0 -0
  72. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/integrated_vectorization/azure_search_datasource.py +0 -0
  73. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/loggers/conversation_logger.py +0 -0
  74. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/__init__.py +0 -0
  75. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/orchestration_strategy.py +0 -0
  76. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/semantic_kernel_orchestrator.py +0 -0
  77. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/orchestrator/strategies.py +0 -0
  78. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/parser/__init__.py +0 -0
  79. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/parser/output_parser_tool.py +0 -0
  80. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/parser/parser_base.py +0 -0
  81. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/plugins/chat_plugin.py +0 -0
  82. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/plugins/outlook_calendar_plugin.py +0 -0
  83. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/plugins/post_answering_plugin.py +0 -0
  84. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/integrated_vectorization_search_handler.py +0 -0
  85. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/postgres_search_handler.py +0 -0
  86. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/postgres_search_handler_light_rag.py +0 -0
  87. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/search.py +0 -0
  88. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/search/search_handler_base.py +0 -0
  89. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/__init__.py +0 -0
  90. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/answer_processing_base.py +0 -0
  91. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/answering_tool_base.py +0 -0
  92. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/content_safety_checker.py +0 -0
  93. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/post_prompt_tool.py +0 -0
  94. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/question_answer_tool.py +0 -0
  95. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/batch/utilities/tools/text_processing_tool.py +0 -0
  96. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/__init__.py +0 -0
  97. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/config.py +0 -0
  98. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/database/__init__.py +0 -0
  99. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/database/base.py +0 -0
  100. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/database/models.py +0 -0
  101. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/indexing/__init__.py +0 -0
  102. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/indexing/chunking.py +0 -0
  103. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/indexing/extraction.py +0 -0
  104. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/indexing/types.py +0 -0
  105. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/indexing/upsert.py +0 -0
  106. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/indexing/utils.py +0 -0
  107. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/llm/__init__.py +0 -0
  108. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/llm/llm.py +0 -0
  109. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/llm/prompt.py +0 -0
  110. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/main.py +0 -0
  111. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/query/__init__.py +0 -0
  112. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/query/generate.py +0 -0
  113. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/query/graph_search.py +0 -0
  114. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/query/types.py +0 -0
  115. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules/graphrag/query/vector_search.py +0 -0
  116. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules.egg-info/SOURCES.txt +0 -0
  117. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules.egg-info/dependency_links.txt +0 -0
  118. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules.egg-info/requires.txt +0 -0
  119. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/cwyodmodules.egg-info/top_level.txt +0 -0
  120. {cwyodmodules-0.3.27 → cwyodmodules-0.3.29}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cwyodmodules
3
- Version: 0.3.27
3
+ Version: 0.3.29
4
4
  Summary: Add your description here
5
5
  Author-email: Patrik <patrikhartl@gmail.com>
6
6
  Classifier: Operating System :: OS Independent
@@ -14,7 +14,7 @@ from ..batch.utilities.chat_history.database_factory import DatabaseFactory
14
14
 
15
15
  # load_dotenv()
16
16
  bp_chat_history_response = Blueprint("chat_history", __name__)
17
- logger = logging.getLogger(__name__ + ".base_package")
17
+ logger = logging.getLogger("__main__")
18
18
  logger.setLevel(level=os.environ.get("LOGLEVEL", "INFO").upper())
19
19
 
20
20
  env_helper: EnvHelper = EnvHelper()
@@ -27,7 +27,7 @@ def get_authenticated_user_details(request_headers):
27
27
 
28
28
 
29
29
  def get_tenantid(client_principal_b64):
30
- logger = logging.getLogger(__name__ + ".base_package")
30
+ logger = logging.getLogger("__main__")
31
31
  tenant_id = ""
32
32
  if client_principal_b64:
33
33
  try:
@@ -7,7 +7,7 @@ from requests import Response
7
7
 
8
8
  from .env_helper import EnvHelper
9
9
 
10
- logger = logging.getLogger(__name__ + ".base_package")
10
+ logger = logging.getLogger("__main__")
11
11
 
12
12
 
13
13
  class AzureComputerVisionClient:
@@ -56,7 +56,9 @@ class AzureComputerVisionClient:
56
56
  if self.use_keys:
57
57
  headers["Ocp-Apim-Subscription-Key"] = self.key
58
58
  else:
59
- access_information = self.azure_identity_helper.get_token_provider(scopes=self.__TOKEN_SCOPE)
59
+ access_information = self.azure_identity_helper.get_token_provider(
60
+ scopes=self.__TOKEN_SCOPE
61
+ )
60
62
  headers["Authorization"] = "Bearer " + access_information()
61
63
 
62
64
  return requests.post(
@@ -6,7 +6,7 @@ import html
6
6
  import traceback
7
7
  from .env_helper import EnvHelper
8
8
 
9
- logger = logging.getLogger(__name__ + ".base_package")
9
+ logger = logging.getLogger("__main__")
10
10
 
11
11
 
12
12
  class AzureFormRecognizerClient:
@@ -1,3 +1,4 @@
1
+ import os
1
2
  from azure.identity import (
2
3
  ChainedTokenCredential,
3
4
  ManagedIdentityCredential,
@@ -22,6 +23,8 @@ class AzureIdentityHelper:
22
23
  # Configure in-memory token cache persistence
23
24
  # For in-memory, unencrypted storage is typically allowed for simplicity during development.
24
25
  # In production, especially with shared environments, consider the security implications.
26
+ client_secret_available = os.getenv("AZURE_CLIENT_SECRET") is not None
27
+
25
28
  token_cache_options = TokenCachePersistenceOptions(allow_unencrypted_storage=True)
26
29
 
27
30
  # Create individual credential instances
@@ -34,10 +37,18 @@ class AzureIdentityHelper:
34
37
 
35
38
  # Create a chain of credentials
36
39
  # The chain will try credentials in the order they are provided.
37
- self._credential = ChainedTokenCredential(
38
- managed_identity_credential,
39
- environment_credential
40
- )
40
+ if client_secret_available:
41
+ logger.info("Using Environment Credential first with token cache persistence.")
42
+ self._credential = ChainedTokenCredential(
43
+ environment_credential,
44
+ managed_identity_credential
45
+ )
46
+ else:
47
+ logger.info("Using Managed Identity Credential first with token cache persistence.")
48
+ self._credential = ChainedTokenCredential(
49
+ managed_identity_credential,
50
+ environment_credential
51
+ )
41
52
 
42
53
  def get_credential(self) -> ChainedTokenCredential:
43
54
  """
@@ -62,10 +73,3 @@ class AzureIdentityHelper:
62
73
  with tracer.start_as_current_span("AzureIdentityHelper.get_token_provider"):
63
74
  logger.info("Retrieving ChainedTokenCredential provider.")
64
75
  return get_bearer_token_provider(self._credential, scopes)
65
-
66
-
67
- # Example usage (optional, for testing or demonstration):
68
- if __name__ == "__main__":
69
- helper = AzureIdentityHelper()
70
- credential = helper.get_credential()
71
- print("Successfully created ChainedTokenCredential.")
@@ -5,7 +5,7 @@ from ..helpers.azure_identity_helper import AzureIdentityHelper
5
5
  from .llm_helper import LLMHelper
6
6
  from .env_helper import EnvHelper
7
7
 
8
- logger = logging.getLogger(__name__ + ".base_package")
8
+ logger = logging.getLogger("__main__")
9
9
 
10
10
 
11
11
  class AzurePostgresHelper:
@@ -25,12 +25,12 @@ class AzurePostgresHelper:
25
25
  dbname = self.env_helper.POSTGRESQL_DATABASE
26
26
 
27
27
  # Acquire the access token
28
- access_information = self.azure_identity_helper.get_token(scopes="https://ossrdbms-aad.database.windows.net/.default")
28
+ access_information = self.azure_identity_helper.get_token(
29
+ scopes="https://ossrdbms-aad.database.windows.net/.default"
30
+ )
29
31
  token = access_information.token
30
32
  # Use the token in the connection string
31
- conn_string = (
32
- f"host={host} user={user} dbname={dbname} password={token}"
33
- )
33
+ conn_string = f"host={host} user={user} dbname={dbname} password={token}"
34
34
  keepalive_kwargs = {
35
35
  "keepalives": 1,
36
36
  "keepalives_idle": 30,
@@ -277,7 +277,7 @@ class AzurePostgresHelper:
277
277
  raise
278
278
  finally:
279
279
  conn.close()
280
-
280
+
281
281
  def store_with_lightrag(self, documents_to_upload):
282
282
  """
283
283
  Stores documents using LightRAG for enhanced vector and text storage capabilities.
@@ -290,4 +290,4 @@ class AzurePostgresHelper:
290
290
  logger.error(f"Error storing documents with LightRAG: {e}")
291
291
  raise
292
292
  finally:
293
- conn.close()
293
+ conn.close()
@@ -6,7 +6,7 @@ from .env_helper import EnvHelper
6
6
  from .lightrag_helper import LightRAGHelper
7
7
  from ..helpers.azure_identity_helper import AzureIdentityHelper
8
8
 
9
- logger = logging.getLogger(__name__ + ".base_package")
9
+ logger = logging.getLogger("__main__")
10
10
 
11
11
 
12
12
  class AzurePostgresHelper:
@@ -27,12 +27,12 @@ class AzurePostgresHelper:
27
27
  dbname = self.env_helper.POSTGRESQL_DATABASE
28
28
 
29
29
  # Acquire the access token
30
- access_information = self.azure_identity_helper.get_token(scopes="https://ossrdbms-aad.database.windows.net/.default")
30
+ access_information = self.azure_identity_helper.get_token(
31
+ scopes="https://ossrdbms-aad.database.windows.net/.default"
32
+ )
31
33
  token = access_information.token
32
34
  # Use the token in the connection string
33
- conn_string = (
34
- f"host={host} user={user} dbname={dbname} password={token}"
35
- )
35
+ conn_string = f"host={host} user={user} dbname={dbname} password={token}"
36
36
  keepalive_kwargs = {
37
37
  "keepalives": 1,
38
38
  "keepalives_idle": 30,
@@ -292,4 +292,4 @@ class AzurePostgresHelper:
292
292
  logger.error(f"Error storing documents with LightRAG: {e}")
293
293
  raise
294
294
  finally:
295
- conn.close()
295
+ conn.close()
@@ -30,7 +30,7 @@ from ..helpers.azure_computer_vision_client import AzureComputerVisionClient
30
30
  from .llm_helper import LLMHelper
31
31
  from .env_helper import EnvHelper
32
32
 
33
- logger = logging.getLogger(__name__ + ".base_package")
33
+ logger = logging.getLogger("__main__")
34
34
 
35
35
 
36
36
  class AzureSearchHelper:
@@ -41,7 +41,7 @@ class AzureSearchHelper:
41
41
  self.llm_helper = LLMHelper()
42
42
  self.env_helper = EnvHelper()
43
43
  self.azure_identity_helper = AzureIdentityHelper()
44
-
44
+
45
45
  search_credential = self._search_credential()
46
46
  self.search_client = self._create_search_client(search_credential)
47
47
  self.search_index_client = self._create_search_index_client(search_credential)
@@ -18,7 +18,7 @@ from .database_type import DatabaseType
18
18
  CONFIG_CONTAINER_NAME = "config"
19
19
  CONFIG_FILE_NAME = "active.json"
20
20
  ADVANCED_IMAGE_PROCESSING_FILE_TYPES = ["jpeg", "jpg", "png", "tiff", "bmp"]
21
- logger = logging.getLogger(__name__ + ".base_package")
21
+ logger = logging.getLogger("__main__")
22
22
 
23
23
 
24
24
  class Config:
@@ -8,7 +8,7 @@ from ...integrated_vectorization.azure_search_skillset import AzureSearchSkillse
8
8
  from ..config.config_helper import ConfigHelper
9
9
  import logging
10
10
 
11
- logger = logging.getLogger(__name__ + ".base_package")
11
+ logger = logging.getLogger("__main__")
12
12
 
13
13
 
14
14
  class IntegratedVectorizationEmbedder(EmbedderBase):
@@ -15,7 +15,7 @@ from ..document_loading_helper import DocumentLoading
15
15
  from ..document_chunking_helper import DocumentChunking
16
16
  from ...common.source_document import SourceDocument
17
17
 
18
- logger = logging.getLogger(__name__ + ".base_package")
18
+ logger = logging.getLogger("__main__")
19
19
 
20
20
 
21
21
  class PostgresEmbedder(EmbedderBase):
@@ -19,7 +19,7 @@ from ..document_loading_helper import DocumentLoading
19
19
  from ..document_chunking_helper import DocumentChunking
20
20
  from ...common.source_document import SourceDocument
21
21
 
22
- logger = logging.getLogger(__name__ + ".base_package")
22
+ logger = logging.getLogger("__main__")
23
23
 
24
24
 
25
25
  class PushEmbedder(EmbedderBase):
@@ -3,7 +3,8 @@ import psycopg2
3
3
  from psycopg2.extras import execute_values, RealDictCursor
4
4
  from ..helpers.azure_identity_helper import AzureIdentityHelper
5
5
 
6
- logger = logging.getLogger(__name__ + ".base_package")
6
+ logger = logging.getLogger("__main__")
7
+
7
8
 
8
9
  class LightRAGHelper:
9
10
  def __init__(self, env_helper):
@@ -21,12 +22,12 @@ class LightRAGHelper:
21
22
  dbname = self.env_helper.POSTGRESQL_DATABASE
22
23
 
23
24
  # Acquire the access token
24
- access_information = self.azure_identity_helper.get_token(scopes="https://ossrdbms-aad.database.windows.net/.default")
25
- token = access_information.token
26
- # Use the token in the connection string
27
- conn_string = (
28
- f"host={host} user={user} dbname={dbname} password={token}"
25
+ access_information = self.azure_identity_helper.get_token(
26
+ scopes="https://ossrdbms-aad.database.windows.net/.default"
29
27
  )
28
+ token = access_information.token
29
+ # Use the token in the connection string
30
+ conn_string = f"host={host} user={user} dbname={dbname} password={token}"
30
31
  keepalive_kwargs = {
31
32
  "keepalives": 1,
32
33
  "keepalives_idle": 30,
@@ -83,7 +84,7 @@ class LightRAGHelper:
83
84
  ORDER BY vector <=> %s::vector
84
85
  LIMIT %s
85
86
  """,
86
- (query_vector, top_k)
87
+ (query_vector, top_k),
87
88
  )
88
89
  results = cur.fetchall()
89
90
  logger.info(f"Retrieved {len(results)} vectors.")
@@ -92,4 +93,4 @@ class LightRAGHelper:
92
93
  logger.error(f"Error retrieving vectors: {e}")
93
94
  raise
94
95
  finally:
95
- conn.close()
96
+ conn.close()
@@ -11,7 +11,7 @@ from azure.ai.ml import MLClient
11
11
  from ..helpers.azure_identity_helper import AzureIdentityHelper
12
12
  from .env_helper import EnvHelper
13
13
 
14
- logger = logging.getLogger(__name__ + ".base_package")
14
+ logger = logging.getLogger("__main__")
15
15
 
16
16
 
17
17
  class LLMHelper:
@@ -19,7 +19,7 @@ class LLMHelper:
19
19
  logger.info("Initializing LLMHelper")
20
20
  self.env_helper: EnvHelper = EnvHelper()
21
21
  self.azure_identity_helper = AzureIdentityHelper()
22
-
22
+
23
23
  self.auth_type_keys = self.env_helper.is_auth_type_keys()
24
24
  self.token_provider = self.env_helper.AZURE_TOKEN_PROVIDER
25
25
 
@@ -2,7 +2,7 @@ import logging
2
2
  from ..helpers.azure_identity_helper import AzureIdentityHelper
3
3
  from azure.keyvault.secrets import SecretClient
4
4
 
5
- logger = logging.getLogger(__name__ + ".base_package")
5
+ logger = logging.getLogger("__main__")
6
6
 
7
7
 
8
8
  class SecretHelper:
@@ -25,7 +25,7 @@ from ..helpers.azure_identity_helper import AzureIdentityHelper
25
25
  from azure.core.credentials import AzureKeyCredential
26
26
  from ..helpers.llm_helper import LLMHelper
27
27
 
28
- logger = logging.getLogger(__name__ + ".base_package")
28
+ logger = logging.getLogger("__main__")
29
29
 
30
30
 
31
31
  class AzureSearchIndex:
@@ -35,7 +35,7 @@ class AzureSearchIndex:
35
35
  self.env_helper = env_helper
36
36
  self.llm_helper = llm_helper
37
37
  self.azure_identity_helper = AzureIdentityHelper()
38
-
38
+
39
39
  self.index_client = SearchIndexClient(
40
40
  self.env_helper.AZURE_SEARCH_SERVICE,
41
41
  (
@@ -5,14 +5,14 @@ from ..helpers.env_helper import EnvHelper
5
5
  from ..helpers.azure_identity_helper import AzureIdentityHelper
6
6
  from azure.core.credentials import AzureKeyCredential
7
7
 
8
- logger = logging.getLogger(__name__ + ".base_package")
8
+ logger = logging.getLogger("__main__")
9
9
 
10
10
 
11
11
  class AzureSearchIndexer:
12
12
  def __init__(self, env_helper: EnvHelper):
13
13
  self.env_helper = env_helper
14
14
  self.azure_identity_helper = AzureIdentityHelper()
15
-
15
+
16
16
  self.indexer_client = SearchIndexerClient(
17
17
  self.env_helper.AZURE_SEARCH_SERVICE,
18
18
  (
@@ -18,7 +18,7 @@ from ..helpers.env_helper import EnvHelper
18
18
  from ..helpers.azure_identity_helper import AzureIdentityHelper
19
19
  from azure.core.credentials import AzureKeyCredential
20
20
 
21
- logger = logging.getLogger(__name__ + ".base_package")
21
+ logger = logging.getLogger("__main__")
22
22
 
23
23
 
24
24
  class AzureSearchSkillset:
@@ -29,7 +29,7 @@ class AzureSearchSkillset:
29
29
  ):
30
30
  self.env_helper = env_helper
31
31
  self.azure_identity_helper = AzureIdentityHelper()
32
-
32
+
33
33
  self.indexer_client = SearchIndexerClient(
34
34
  self.env_helper.AZURE_SEARCH_SERVICE,
35
35
  (
@@ -13,7 +13,7 @@ from ..tools.question_answer_tool import QuestionAnswerTool
13
13
  from ..tools.text_processing_tool import TextProcessingTool
14
14
  from ..common.answer import Answer
15
15
 
16
- logger = logging.getLogger(__name__ + ".base_package")
16
+ logger = logging.getLogger("__main__")
17
17
 
18
18
 
19
19
  class LangChainAgent(OrchestratorBase):
@@ -10,7 +10,7 @@ from ..tools.question_answer_tool import QuestionAnswerTool
10
10
  from ..tools.text_processing_tool import TextProcessingTool
11
11
  from ..common.answer import Answer
12
12
 
13
- logger = logging.getLogger(__name__ + ".base_package")
13
+ logger = logging.getLogger("__main__")
14
14
 
15
15
 
16
16
  class OpenAIFunctionsOrchestrator(OrchestratorBase):
@@ -7,7 +7,7 @@ from ..helpers.config.config_helper import ConfigHelper
7
7
  from ..parser.output_parser_tool import OutputParserTool
8
8
  from ..tools.content_safety_checker import ContentSafetyChecker
9
9
 
10
- logger = logging.getLogger(__name__ + ".base_package")
10
+ logger = logging.getLogger("__main__")
11
11
 
12
12
 
13
13
  class OrchestratorBase(ABC):
@@ -46,7 +46,11 @@ class OrchestratorBase(ABC):
46
46
 
47
47
  @abstractmethod
48
48
  async def orchestrate(
49
- self, user_message: str, chat_history: List[dict], request_headers, **kwargs: dict
49
+ self,
50
+ user_message: str,
51
+ chat_history: List[dict],
52
+ request_headers,
53
+ **kwargs: dict,
50
54
  ) -> list[dict]:
51
55
  """
52
56
  Abstract method to orchestrate the conversation. This method must be implemented by subclasses.
@@ -133,7 +137,9 @@ class OrchestratorBase(ABC):
133
137
  Returns:
134
138
  dict: The result of the orchestration as a dictionary.
135
139
  """
136
- result = await self.orchestrate(user_message, chat_history, request_headers, **kwargs)
140
+ result = await self.orchestrate(
141
+ user_message, chat_history, request_headers, **kwargs
142
+ )
137
143
  if str(self.config.logging.log_tokens).lower() == "true":
138
144
  custom_dimensions = {
139
145
  "conversation_id": conversation_id,
@@ -9,7 +9,7 @@ from ..common.source_document import SourceDocument
9
9
  from ..helpers.llm_helper import LLMHelper
10
10
  from ..helpers.env_helper import EnvHelper
11
11
 
12
- logger = logging.getLogger(__name__ + ".base_package")
12
+ logger = logging.getLogger("__main__")
13
13
 
14
14
 
15
15
  class PromptFlowOrchestrator(OrchestratorBase):
@@ -10,7 +10,7 @@ import json
10
10
  from azure.search.documents.models import VectorizedQuery
11
11
  import tiktoken
12
12
 
13
- logger = logging.getLogger(__name__ + ".base_package")
13
+ logger = logging.getLogger("__main__")
14
14
 
15
15
 
16
16
  class AzureSearchHandler(SearchHandlerBase):
@@ -5,7 +5,7 @@ from .search_handler_base import SearchHandlerBase
5
5
  from ..common.source_document import SourceDocument
6
6
  import json
7
7
 
8
- logger = logging.getLogger(__name__ + ".base_package")
8
+ logger = logging.getLogger("__main__")
9
9
 
10
10
 
11
11
  class AzureSearchHandlerLightRag(SearchHandlerBase):
@@ -82,4 +82,4 @@ class AzureSearchHandlerLightRag(SearchHandlerBase):
82
82
  page_number=source.get("page_number"),
83
83
  )
84
84
  )
85
- return source_documents
85
+ return source_documents
@@ -4,7 +4,8 @@ from ..helpers.lightrag_helper import LightRAGHelper
4
4
  from .search_handler_base import SearchHandlerBase
5
5
  from ..common.source_document import SourceDocument
6
6
 
7
- logger = logging.getLogger(__name__ + ".base_package")
7
+ logger = logging.getLogger("__main__")
8
+
8
9
 
9
10
  class LightRAGSearchHandler(SearchHandlerBase):
10
11
  def __init__(self, env_helper):
@@ -56,4 +57,4 @@ class LightRAGSearchHandler(SearchHandlerBase):
56
57
 
57
58
  def get_unique_files(self):
58
59
  logger.info("Fetching unique files from LightRAG.")
59
- return self.lightrag_helper.get_unique_files()
60
+ return self.lightrag_helper.get_unique_files()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cwyodmodules
3
- Version: 0.3.27
3
+ Version: 0.3.29
4
4
  Summary: Add your description here
5
5
  Author-email: Patrik <patrikhartl@gmail.com>
6
6
  Classifier: Operating System :: OS Independent
@@ -3,7 +3,7 @@ name = "cwyodmodules"
3
3
  authors = [
4
4
  { name="Patrik", email="patrikhartl@gmail.com" },
5
5
  ]
6
- version = '0.3.27'
6
+ version = '0.3.29'
7
7
  description = "Add your description here"
8
8
  readme = "README.md"
9
9
  requires-python = "==3.11.11"
File without changes
File without changes
File without changes