bestsbf 0.0.2__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 (234) hide show
  1. bestsbf-0.0.2/.gitignore +229 -0
  2. bestsbf-0.0.2/.pre-commit-config.yaml +23 -0
  3. bestsbf-0.0.2/.python-version +1 -0
  4. bestsbf-0.0.2/CHANGELOG.md +46 -0
  5. bestsbf-0.0.2/LICENSE +24 -0
  6. bestsbf-0.0.2/PKG-INFO +1181 -0
  7. bestsbf-0.0.2/README.md +1125 -0
  8. bestsbf-0.0.2/docker-compose.yml +19 -0
  9. bestsbf-0.0.2/my-bot.py +10 -0
  10. bestsbf-0.0.2/pyproject.toml +87 -0
  11. bestsbf-0.0.2/pytest.ini +27 -0
  12. bestsbf-0.0.2/requirements.txt +0 -0
  13. bestsbf-0.0.2/requirements_noversions.txt +293 -0
  14. bestsbf-0.0.2/ruff.toml +8 -0
  15. bestsbf-0.0.2/skills-lock.json +15 -0
  16. bestsbf-0.0.2/smart_bot_factory/__init__.py +3 -0
  17. bestsbf-0.0.2/smart_bot_factory/admin/__init__.py +12 -0
  18. bestsbf-0.0.2/smart_bot_factory/admin/admin_events.py +1062 -0
  19. bestsbf-0.0.2/smart_bot_factory/admin/admin_events_edit.py +477 -0
  20. bestsbf-0.0.2/smart_bot_factory/admin/admin_events_utils.py +1066 -0
  21. bestsbf-0.0.2/smart_bot_factory/admin/admin_logic.py +550 -0
  22. bestsbf-0.0.2/smart_bot_factory/admin/admin_manager.py +147 -0
  23. bestsbf-0.0.2/smart_bot_factory/admin/admin_polls.py +285 -0
  24. bestsbf-0.0.2/smart_bot_factory/admin/states.py +26 -0
  25. bestsbf-0.0.2/smart_bot_factory/admin/timeout_checker.py +509 -0
  26. bestsbf-0.0.2/smart_bot_factory/analytics/analytics_manager.py +487 -0
  27. bestsbf-0.0.2/smart_bot_factory/cli.py +1153 -0
  28. bestsbf-0.0.2/smart_bot_factory/config.py +304 -0
  29. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/prompts/1sales_context.txt +16 -0
  30. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/prompts/2product_info.txt +582 -0
  31. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/prompts/3objection_handling.txt +66 -0
  32. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/prompts/final_instructions.txt +204 -0
  33. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/prompts/help_message.txt +28 -0
  34. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/prompts/welcome_message.txt +8 -0
  35. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064229.txt +818 -0
  36. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064335.txt +32 -0
  37. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/reports/test_20250924_064638.txt +35 -0
  38. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/tests/quick_scenarios.yaml +133 -0
  39. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/tests/realistic_scenarios.yaml +108 -0
  40. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/tests/scenario_examples.yaml +46 -0
  41. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/welcome_file/welcome_file_msg.txt +16 -0
  42. bestsbf-0.0.2/smart_bot_factory/configs/growthmed-october-24/welcome_file//320/247/320/265/320/272 /320/273/320/270/321/201/321/202 /320/277/320/276 152/320/244/320/227 /320/270 323/320/244/320/227 /320/264/320/273/321/217 /320/274/320/265/320/264/320/270/321/206/320/270/320/275/321/213.pdf +0 -0
  43. bestsbf-0.0.2/smart_bot_factory/creation/__init__.py +7 -0
  44. bestsbf-0.0.2/smart_bot_factory/creation/bot_builder.py +1612 -0
  45. bestsbf-0.0.2/smart_bot_factory/creation/bot_testing.py +1748 -0
  46. bestsbf-0.0.2/smart_bot_factory/dashboard/__init__.py +3 -0
  47. bestsbf-0.0.2/smart_bot_factory/error_handling/__init__.py +85 -0
  48. bestsbf-0.0.2/smart_bot_factory/error_handling/context.py +69 -0
  49. bestsbf-0.0.2/smart_bot_factory/error_handling/exceptions.py +170 -0
  50. bestsbf-0.0.2/smart_bot_factory/error_handling/handler.py +344 -0
  51. bestsbf-0.0.2/smart_bot_factory/error_handling/middleware.py +83 -0
  52. bestsbf-0.0.2/smart_bot_factory/error_handling/migration_utils.py +58 -0
  53. bestsbf-0.0.2/smart_bot_factory/error_handling/retry.py +154 -0
  54. bestsbf-0.0.2/smart_bot_factory/event/__init__.py +15 -0
  55. bestsbf-0.0.2/smart_bot_factory/event/decorators/__init__.py +0 -0
  56. bestsbf-0.0.2/smart_bot_factory/event/decorators/admin.py +309 -0
  57. bestsbf-0.0.2/smart_bot_factory/event/decorators/checks.py +187 -0
  58. bestsbf-0.0.2/smart_bot_factory/event/decorators/constants.py +113 -0
  59. bestsbf-0.0.2/smart_bot_factory/event/decorators/db.py +277 -0
  60. bestsbf-0.0.2/smart_bot_factory/event/decorators/execution.py +49 -0
  61. bestsbf-0.0.2/smart_bot_factory/event/decorators/processor.py +270 -0
  62. bestsbf-0.0.2/smart_bot_factory/event/decorators/registry.py +416 -0
  63. bestsbf-0.0.2/smart_bot_factory/event/decorators/scheduling.py +340 -0
  64. bestsbf-0.0.2/smart_bot_factory/event/decorators/utils.py +193 -0
  65. bestsbf-0.0.2/smart_bot_factory/event/event_tools.py +59 -0
  66. bestsbf-0.0.2/smart_bot_factory/event/router.py +348 -0
  67. bestsbf-0.0.2/smart_bot_factory/event/router_manager.py +190 -0
  68. bestsbf-0.0.2/smart_bot_factory/file_router/__init__.py +8 -0
  69. bestsbf-0.0.2/smart_bot_factory/file_router/execution.py +87 -0
  70. bestsbf-0.0.2/smart_bot_factory/file_router/router.py +214 -0
  71. bestsbf-0.0.2/smart_bot_factory/file_router/sender.py +808 -0
  72. bestsbf-0.0.2/smart_bot_factory/handlers/__init__.py +38 -0
  73. bestsbf-0.0.2/smart_bot_factory/handlers/admin_middleware.py +24 -0
  74. bestsbf-0.0.2/smart_bot_factory/handlers/commands.py +360 -0
  75. bestsbf-0.0.2/smart_bot_factory/handlers/constants.py +54 -0
  76. bestsbf-0.0.2/smart_bot_factory/handlers/converters.py +130 -0
  77. bestsbf-0.0.2/smart_bot_factory/handlers/file_handlers.py +240 -0
  78. bestsbf-0.0.2/smart_bot_factory/handlers/handlers.py +488 -0
  79. bestsbf-0.0.2/smart_bot_factory/handlers/message_processing.py +337 -0
  80. bestsbf-0.0.2/smart_bot_factory/handlers/rate_limit_middleware.py +64 -0
  81. bestsbf-0.0.2/smart_bot_factory/handlers/states.py +9 -0
  82. bestsbf-0.0.2/smart_bot_factory/handlers/utils.py +336 -0
  83. bestsbf-0.0.2/smart_bot_factory/handlers/voice_handler.py +293 -0
  84. bestsbf-0.0.2/smart_bot_factory/integrations/__init__.py +1 -0
  85. bestsbf-0.0.2/smart_bot_factory/integrations/conversation_graph.py +276 -0
  86. bestsbf-0.0.2/smart_bot_factory/integrations/openai/knowledge/__init__.py +69 -0
  87. bestsbf-0.0.2/smart_bot_factory/integrations/openai/knowledge/auto_index.py +139 -0
  88. bestsbf-0.0.2/smart_bot_factory/integrations/openai/knowledge/context_enricher.py +476 -0
  89. bestsbf-0.0.2/smart_bot_factory/integrations/openai/knowledge/preamble_repair.py +148 -0
  90. bestsbf-0.0.2/smart_bot_factory/integrations/openai/knowledge/prompts_summary.py +238 -0
  91. bestsbf-0.0.2/smart_bot_factory/integrations/openai/knowledge/router.py +135 -0
  92. bestsbf-0.0.2/smart_bot_factory/integrations/openai/langchain_openai.py +671 -0
  93. bestsbf-0.0.2/smart_bot_factory/integrations/openai/prompt_loader.py +668 -0
  94. bestsbf-0.0.2/smart_bot_factory/integrations/openai/responce_models.py +83 -0
  95. bestsbf-0.0.2/smart_bot_factory/integrations/supabase_client.py +1900 -0
  96. bestsbf-0.0.2/smart_bot_factory/memory/__init__.py +7 -0
  97. bestsbf-0.0.2/smart_bot_factory/memory/memory_manager.py +420 -0
  98. bestsbf-0.0.2/smart_bot_factory/memory/static_memory.py +207 -0
  99. bestsbf-0.0.2/smart_bot_factory/message/__init__.py +58 -0
  100. bestsbf-0.0.2/smart_bot_factory/message/message_sender.py +666 -0
  101. bestsbf-0.0.2/smart_bot_factory/models/__init__.py +16 -0
  102. bestsbf-0.0.2/smart_bot_factory/models/ai_metadata.py +126 -0
  103. bestsbf-0.0.2/smart_bot_factory/models/utils.py +39 -0
  104. bestsbf-0.0.2/smart_bot_factory/rag/__init__.py +17 -0
  105. bestsbf-0.0.2/smart_bot_factory/rag/decorators.py +28 -0
  106. bestsbf-0.0.2/smart_bot_factory/rag/parser_loader.py +170 -0
  107. bestsbf-0.0.2/smart_bot_factory/rag/parser_rag_pipeline.py +264 -0
  108. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/__init__.py +11 -0
  109. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/bootstrap.py +66 -0
  110. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/debug_query.py +153 -0
  111. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/hybrid.py +44 -0
  112. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/indexer.py +127 -0
  113. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/llama_vector_store.py +181 -0
  114. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/openai_embed.py +26 -0
  115. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/query_planner.py +153 -0
  116. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/retriever.py +147 -0
  117. bestsbf-0.0.2/smart_bot_factory/rag/qdrant/settings.py +197 -0
  118. bestsbf-0.0.2/smart_bot_factory/rag/refresh_rag_handlers.py +69 -0
  119. bestsbf-0.0.2/smart_bot_factory/rag/router.py +53 -0
  120. bestsbf-0.0.2/smart_bot_factory/rag/supabase_vector.py +918 -0
  121. bestsbf-0.0.2/smart_bot_factory/rag/templates/__init__.py +3 -0
  122. bestsbf-0.0.2/smart_bot_factory/rag/templates/create_table.sql +7 -0
  123. bestsbf-0.0.2/smart_bot_factory/rag/templates/create_table_and_function_template.py +118 -0
  124. bestsbf-0.0.2/smart_bot_factory/rag/templates/match_function.sql +61 -0
  125. bestsbf-0.0.2/smart_bot_factory/rag/templates/match_keyword_template.py +89 -0
  126. bestsbf-0.0.2/smart_bot_factory/rag/templates/match_services_template.py +94 -0
  127. bestsbf-0.0.2/smart_bot_factory/rag/vectorstore.py +721 -0
  128. bestsbf-0.0.2/smart_bot_factory/router/__init__.py +10 -0
  129. bestsbf-0.0.2/smart_bot_factory/site_parser/__init__.py +4 -0
  130. bestsbf-0.0.2/smart_bot_factory/site_parser/parser.py +234 -0
  131. bestsbf-0.0.2/smart_bot_factory/site_parser/parser_prompt.py +76 -0
  132. bestsbf-0.0.2/smart_bot_factory/site_parser/sitemap.py +75 -0
  133. bestsbf-0.0.2/smart_bot_factory/supabase/__init__.py +7 -0
  134. bestsbf-0.0.2/smart_bot_factory/supabase/client.py +578 -0
  135. bestsbf-0.0.2/smart_bot_factory/supabase/migrations/20250321120000_sales_admins_last_poll.sql +6 -0
  136. bestsbf-0.0.2/smart_bot_factory/ui/aiogram_calendar/__init__.py +13 -0
  137. bestsbf-0.0.2/smart_bot_factory/ui/aiogram_calendar/common.py +62 -0
  138. bestsbf-0.0.2/smart_bot_factory/ui/aiogram_calendar/dialog_calendar.py +206 -0
  139. bestsbf-0.0.2/smart_bot_factory/ui/aiogram_calendar/schemas.py +97 -0
  140. bestsbf-0.0.2/smart_bot_factory/ui/aiogram_calendar/simple_calendar.py +183 -0
  141. bestsbf-0.0.2/smart_bot_factory/utils/__init__.py +14 -0
  142. bestsbf-0.0.2/smart_bot_factory/utils/bot_utils.py +1300 -0
  143. bestsbf-0.0.2/smart_bot_factory/utils/context.py +53 -0
  144. bestsbf-0.0.2/smart_bot_factory/utils/conversation_manager.py +608 -0
  145. bestsbf-0.0.2/smart_bot_factory/utils/debug_routing.py +94 -0
  146. bestsbf-0.0.2/smart_bot_factory/utils/performance.py +242 -0
  147. bestsbf-0.0.2/smart_bot_factory/utils/prompt_watcher.py +137 -0
  148. bestsbf-0.0.2/smart_bot_factory/utils/tool_router.py +75 -0
  149. bestsbf-0.0.2/smart_bot_factory/utils/user_prompt_loader.py +55 -0
  150. bestsbf-0.0.2/smart_bot_factory/utm_link_generator.py +123 -0
  151. bestsbf-0.0.2/test-bot.py +39 -0
  152. bestsbf-0.0.2/tests/__init__.py +1 -0
  153. bestsbf-0.0.2/tests/conftest.py +191 -0
  154. bestsbf-0.0.2/tests/test_admin/__init__.py +1 -0
  155. bestsbf-0.0.2/tests/test_admin/test_admin_events.py +314 -0
  156. bestsbf-0.0.2/tests/test_admin/test_admin_logic.py +367 -0
  157. bestsbf-0.0.2/tests/test_admin/test_admin_manager.py +263 -0
  158. bestsbf-0.0.2/tests/test_admin/test_admin_polls.py +27 -0
  159. bestsbf-0.0.2/tests/test_admin/test_states.py +24 -0
  160. bestsbf-0.0.2/tests/test_analytics/__init__.py +1 -0
  161. bestsbf-0.0.2/tests/test_analytics/test_analytics_manager.py +480 -0
  162. bestsbf-0.0.2/tests/test_analytics/test_analytics_manager_improved.py +455 -0
  163. bestsbf-0.0.2/tests/test_backward_compatibility.py +30 -0
  164. bestsbf-0.0.2/tests/test_cli/__init__.py +1 -0
  165. bestsbf-0.0.2/tests/test_cli/test_cli.py +364 -0
  166. bestsbf-0.0.2/tests/test_config/test_config.py +175 -0
  167. bestsbf-0.0.2/tests/test_creation/__init__.py +1 -0
  168. bestsbf-0.0.2/tests/test_creation/test_bot_builder.py +421 -0
  169. bestsbf-0.0.2/tests/test_creation/test_bot_testing.py +345 -0
  170. bestsbf-0.0.2/tests/test_error_handling/__init__.py +1 -0
  171. bestsbf-0.0.2/tests/test_error_handling/test_exceptions.py +51 -0
  172. bestsbf-0.0.2/tests/test_error_handling/test_handler.py +77 -0
  173. bestsbf-0.0.2/tests/test_error_handling/test_integration.py +23 -0
  174. bestsbf-0.0.2/tests/test_error_handling/test_retry.py +115 -0
  175. bestsbf-0.0.2/tests/test_event/test_router.py +203 -0
  176. bestsbf-0.0.2/tests/test_file_router/__init__.py +1 -0
  177. bestsbf-0.0.2/tests/test_file_router/test_execution.py +201 -0
  178. bestsbf-0.0.2/tests/test_file_router/test_router.py +181 -0
  179. bestsbf-0.0.2/tests/test_file_router/test_sender.py +370 -0
  180. bestsbf-0.0.2/tests/test_handlers/__init__.py +1 -0
  181. bestsbf-0.0.2/tests/test_handlers/test_commands.py +171 -0
  182. bestsbf-0.0.2/tests/test_handlers/test_constants.py +59 -0
  183. bestsbf-0.0.2/tests/test_handlers/test_converters.py +132 -0
  184. bestsbf-0.0.2/tests/test_handlers/test_file_handlers.py +176 -0
  185. bestsbf-0.0.2/tests/test_handlers/test_handlers.py +534 -0
  186. bestsbf-0.0.2/tests/test_handlers/test_message_processing.py +292 -0
  187. bestsbf-0.0.2/tests/test_handlers/test_states.py +19 -0
  188. bestsbf-0.0.2/tests/test_handlers/test_utils.py +179 -0
  189. bestsbf-0.0.2/tests/test_handlers/test_utils_extended.py +269 -0
  190. bestsbf-0.0.2/tests/test_handlers/test_utils_property_based.py +85 -0
  191. bestsbf-0.0.2/tests/test_handlers/test_voice_handler.py +276 -0
  192. bestsbf-0.0.2/tests/test_integrations/__init__.py +1 -0
  193. bestsbf-0.0.2/tests/test_integrations/test_ai_response_format.py +317 -0
  194. bestsbf-0.0.2/tests/test_integrations/test_conversation_graph_rag.py +59 -0
  195. bestsbf-0.0.2/tests/test_integrations/test_dialog_graph_branch_flags.py +126 -0
  196. bestsbf-0.0.2/tests/test_integrations/test_langchain_openai.py +225 -0
  197. bestsbf-0.0.2/tests/test_integrations/test_prompt_loader.py +184 -0
  198. bestsbf-0.0.2/tests/test_integrations/test_response_models.py +86 -0
  199. bestsbf-0.0.2/tests/test_integrations/test_supabase_client.py +242 -0
  200. bestsbf-0.0.2/tests/test_knowledge/test_auto_index.py +72 -0
  201. bestsbf-0.0.2/tests/test_knowledge/test_preamble_repair.py +64 -0
  202. bestsbf-0.0.2/tests/test_knowledge/test_prompts_summary.py +84 -0
  203. bestsbf-0.0.2/tests/test_memory/test_memory_manager.py +261 -0
  204. bestsbf-0.0.2/tests/test_memory/test_static_memory.py +303 -0
  205. bestsbf-0.0.2/tests/test_message/__init__.py +1 -0
  206. bestsbf-0.0.2/tests/test_message/test_init.py +31 -0
  207. bestsbf-0.0.2/tests/test_message/test_message_sender.py +561 -0
  208. bestsbf-0.0.2/tests/test_message/test_message_sender_assertions.py +564 -0
  209. bestsbf-0.0.2/tests/test_message/test_message_sender_coverage.py +442 -0
  210. bestsbf-0.0.2/tests/test_message/test_message_sender_edge_cases.py +590 -0
  211. bestsbf-0.0.2/tests/test_message/test_message_sender_integration.py +415 -0
  212. bestsbf-0.0.2/tests/test_models/__init__.py +1 -0
  213. bestsbf-0.0.2/tests/test_models/test_ai_metadata.py +102 -0
  214. bestsbf-0.0.2/tests/test_performance.py +36 -0
  215. bestsbf-0.0.2/tests/test_rag/__init__.py +0 -0
  216. bestsbf-0.0.2/tests/test_rag/test_decorators.py +67 -0
  217. bestsbf-0.0.2/tests/test_rag/test_qdrant_rag.py +311 -0
  218. bestsbf-0.0.2/tests/test_rag/test_rag_query_planner.py +225 -0
  219. bestsbf-0.0.2/tests/test_rag/test_router.py +111 -0
  220. bestsbf-0.0.2/tests/test_rag/test_supabase_vector.py +237 -0
  221. bestsbf-0.0.2/tests/test_rag/test_vectorstore.py +298 -0
  222. bestsbf-0.0.2/tests/test_site_parser/__init__.py +0 -0
  223. bestsbf-0.0.2/tests/test_site_parser/test_parser.py +418 -0
  224. bestsbf-0.0.2/tests/test_site_parser/test_parser_property_based.py +70 -0
  225. bestsbf-0.0.2/tests/test_site_parser/test_sitemap.py +126 -0
  226. bestsbf-0.0.2/tests/test_utils/test_bot_utils.py +110 -0
  227. bestsbf-0.0.2/tests/test_utils/test_conversation_manager.py +122 -0
  228. bestsbf-0.0.2/tests/test_utils/test_conversation_manager_property_based.py +86 -0
  229. bestsbf-0.0.2/tests/test_utils/test_debug_routing.py +201 -0
  230. bestsbf-0.0.2/tests/test_utils/test_prompt_watcher.py +144 -0
  231. bestsbf-0.0.2/tests/test_utils/test_tool_router.py +130 -0
  232. bestsbf-0.0.2/tests/test_utm_link_generator.py +337 -0
  233. bestsbf-0.0.2/uv.lock +5007 -0
  234. bestsbf-0.0.2/verify-bot.py +39 -0
@@ -0,0 +1,229 @@
1
+ bots/*
2
+
3
+ valera.py
4
+ publish.py
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/s
7
+ *.py[codz]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py.cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ # .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ #Pipfile.lock
100
+
101
+ # UV
102
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ #uv.lock
106
+
107
+ # poetry
108
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
110
+ # commonly ignored for libraries.
111
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
+ #poetry.lock
113
+ #poetry.toml
114
+
115
+ # pdm
116
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
+ #pdm.lock
120
+ #pdm.toml
121
+ .pdm-python
122
+ .pdm-build/
123
+
124
+ # pixi
125
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
+ #pixi.lock
127
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
+ # in the .venv directory. It is recommended not to include this directory in version control.
129
+ .pixi
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule
136
+ celerybeat.pid
137
+
138
+ # SageMath parsed files
139
+ *.sage.py
140
+
141
+ # Environments
142
+ .env
143
+ .env-old
144
+ .envrc
145
+ .venv
146
+ env/
147
+ venv/
148
+ ENV/
149
+ env.bak/
150
+ venv.bak/
151
+
152
+ # Добавить в .gitignore
153
+ configs/*/env
154
+ configs/*/.env
155
+ configs/*/.env-old
156
+ configs/*/reports/
157
+
158
+ # Spyder project settings
159
+ .spyderproject
160
+ .spyproject
161
+
162
+ # Rope project settings
163
+ .ropeproject
164
+
165
+ # mkdocs documentation
166
+ /site
167
+
168
+ # mypy
169
+ .mypy_cache/
170
+ .dmypy.json
171
+ dmypy.json
172
+
173
+ # Pyre type checker
174
+ .pyre/
175
+
176
+ # pytype static type analyzer
177
+ .pytype/
178
+
179
+ # Cython debug symbols
180
+ cython_debug/
181
+
182
+ # PyCharm
183
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
184
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
185
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
186
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
187
+ #.idea/
188
+
189
+ # Abstra
190
+ # Abstra is an AI-powered process automation framework.
191
+ # Ignore directories containing user credentials, local state, and settings.
192
+ # Learn more at https://abstra.io/docs
193
+ .abstra/
194
+
195
+ # Visual Studio Code
196
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
197
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
198
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
199
+ # you could uncomment the following to ignore the entire vscode folder
200
+ # .vscode/
201
+
202
+ # Ruff stuff:
203
+ .ruff_cache/
204
+
205
+ # PyPI configuration file
206
+ .pypirc
207
+
208
+ # Cursor
209
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
210
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
211
+ # refer to https://docs.cursor.com/context/ignore-files
212
+ .cursorignore
213
+ .cursorindexingignore
214
+ .cursor/
215
+
216
+ # Marimo
217
+ marimo/_static/
218
+ marimo/_lsp/
219
+ __marimo__/
220
+
221
+ # Временные папки для обработки файлов
222
+ temp_audio/
223
+ temp_with_msg/
224
+ temp_after_msg/
225
+
226
+ # Rag
227
+ rag_tools.py
228
+ mdclinica.py
229
+ pars_site.py
@@ -0,0 +1,23 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.0
4
+ hooks:
5
+ - id: ruff
6
+ args: ["--fix", "--exclude", "tests/"]
7
+ - id: ruff-format
8
+ args: ["--exclude", "tests/"]
9
+ - id: ruff
10
+ name: ruff (import sorting)
11
+ args: ["--select", "I", "--fix", "--exclude", "tests/"]
12
+
13
+ - repo: local
14
+ hooks:
15
+ - id: pytest
16
+ name: pytest
17
+ entry: uv run pytest
18
+ language: system
19
+ types: [python]
20
+ args: ["-q", "--tb=line", "-x", "--maxfail=1", "-m", "not slow", "--rootdir", "."]
21
+ pass_filenames: false
22
+ always_run: true
23
+ description: "Запускает быстрые тесты перед коммитом. Коммит будет заблокирован при ошибках."
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,46 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ### Added
6
+
7
+ - **Централизованная система error handling:**
8
+ - Кастомные исключения для всех типов ошибок
9
+ - Автоматическая классификация ошибок
10
+ - Structured logging с контекстом
11
+ - Метрики ошибок для мониторинга
12
+ - **Retry механизм:** exponential backoff, стратегии для OpenAI, Supabase, Telegram, декоратор `@with_retry`
13
+ - **Error boundary:** context manager `async with error_boundary()`, fallback, подавление ошибок
14
+ - **Telegram middleware:** автоматическая обработка ошибок в handlers, уведомления пользователей
15
+ - Модуль `smart_bot_factory.error_handling` (exceptions, handler, context, retry, middleware, migration_utils)
16
+ - 🔥 Hot Reload для промптов:
17
+ - File Watcher на базе `watchdog`
18
+ - Debouncing для частых сохранений
19
+ - Rate limiting: максимум 10 перезагрузок/мин
20
+ - Настройка `ENABLE_PROMPT_HOT_RELOAD` в `.env`
21
+ - Документация: `docs/HOT_RELOAD.md`
22
+
23
+ ### Changed
24
+
25
+ - Рефакторинг `message_sender.py`, `bot_utils.py`: использование централизованного error handling
26
+ - OpenAI запросы с автоматическим retry; Supabase add_message, get_chat_history, update_session с retry
27
+ - `process_user_message` обёрнут в error_boundary; `_process_ai_response` обрабатывает ошибки через ErrorHandler
28
+ - Рефакторинг: удалено дублирование кода конвертации сообщений.
29
+ - Все конвертации унифицированы через `MessageConverter`.
30
+ - Удалены дублированные методы `_openai_to_langchain` и `_openai_messages_to_langchain` из `bot_testing.py`.
31
+
32
+ ### Added
33
+
34
+ - Pydantic-модели для типобезопасности:
35
+ - `AIMetadata` — метаданные ответа AI
36
+ - `EventData` — модель события
37
+ - `FileEventData` — модель файлового события
38
+ - `SessionInfo` — информация о сессии
39
+ - `Message` — модель сообщения
40
+ - Утилита `parse_ai_metadata_safe()` для безопасного парсинга метаданных с fallback на исходный dict.
41
+ - Константа `AIMetadataKey.FILE_EVENTS`.
42
+ - Тесты: `tests/test_models/`, `tests/test_backward_compatibility.py`, `tests/test_performance.py`.
43
+
44
+ ### Fixed
45
+
46
+ - Улучшена валидация данных от AI в `message_processing._process_ai_response` через Pydantic с сохранением обратной совместимости.
bestsbf-0.0.2/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Kopatych
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
24
+