aiecs 1.5.1__py3-none-any.whl

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 (302) hide show
  1. aiecs/__init__.py +72 -0
  2. aiecs/__main__.py +41 -0
  3. aiecs/aiecs_client.py +469 -0
  4. aiecs/application/__init__.py +10 -0
  5. aiecs/application/executors/__init__.py +10 -0
  6. aiecs/application/executors/operation_executor.py +363 -0
  7. aiecs/application/knowledge_graph/__init__.py +7 -0
  8. aiecs/application/knowledge_graph/builder/__init__.py +37 -0
  9. aiecs/application/knowledge_graph/builder/document_builder.py +375 -0
  10. aiecs/application/knowledge_graph/builder/graph_builder.py +356 -0
  11. aiecs/application/knowledge_graph/builder/schema_mapping.py +531 -0
  12. aiecs/application/knowledge_graph/builder/structured_pipeline.py +443 -0
  13. aiecs/application/knowledge_graph/builder/text_chunker.py +319 -0
  14. aiecs/application/knowledge_graph/extractors/__init__.py +27 -0
  15. aiecs/application/knowledge_graph/extractors/base.py +100 -0
  16. aiecs/application/knowledge_graph/extractors/llm_entity_extractor.py +327 -0
  17. aiecs/application/knowledge_graph/extractors/llm_relation_extractor.py +349 -0
  18. aiecs/application/knowledge_graph/extractors/ner_entity_extractor.py +244 -0
  19. aiecs/application/knowledge_graph/fusion/__init__.py +23 -0
  20. aiecs/application/knowledge_graph/fusion/entity_deduplicator.py +387 -0
  21. aiecs/application/knowledge_graph/fusion/entity_linker.py +343 -0
  22. aiecs/application/knowledge_graph/fusion/knowledge_fusion.py +580 -0
  23. aiecs/application/knowledge_graph/fusion/relation_deduplicator.py +189 -0
  24. aiecs/application/knowledge_graph/pattern_matching/__init__.py +21 -0
  25. aiecs/application/knowledge_graph/pattern_matching/pattern_matcher.py +344 -0
  26. aiecs/application/knowledge_graph/pattern_matching/query_executor.py +378 -0
  27. aiecs/application/knowledge_graph/profiling/__init__.py +12 -0
  28. aiecs/application/knowledge_graph/profiling/query_plan_visualizer.py +199 -0
  29. aiecs/application/knowledge_graph/profiling/query_profiler.py +223 -0
  30. aiecs/application/knowledge_graph/reasoning/__init__.py +27 -0
  31. aiecs/application/knowledge_graph/reasoning/evidence_synthesis.py +347 -0
  32. aiecs/application/knowledge_graph/reasoning/inference_engine.py +504 -0
  33. aiecs/application/knowledge_graph/reasoning/logic_form_parser.py +167 -0
  34. aiecs/application/knowledge_graph/reasoning/logic_parser/__init__.py +79 -0
  35. aiecs/application/knowledge_graph/reasoning/logic_parser/ast_builder.py +513 -0
  36. aiecs/application/knowledge_graph/reasoning/logic_parser/ast_nodes.py +630 -0
  37. aiecs/application/knowledge_graph/reasoning/logic_parser/ast_validator.py +654 -0
  38. aiecs/application/knowledge_graph/reasoning/logic_parser/error_handler.py +477 -0
  39. aiecs/application/knowledge_graph/reasoning/logic_parser/parser.py +390 -0
  40. aiecs/application/knowledge_graph/reasoning/logic_parser/query_context.py +217 -0
  41. aiecs/application/knowledge_graph/reasoning/logic_query_integration.py +169 -0
  42. aiecs/application/knowledge_graph/reasoning/query_planner.py +872 -0
  43. aiecs/application/knowledge_graph/reasoning/reasoning_engine.py +554 -0
  44. aiecs/application/knowledge_graph/retrieval/__init__.py +19 -0
  45. aiecs/application/knowledge_graph/retrieval/retrieval_strategies.py +596 -0
  46. aiecs/application/knowledge_graph/search/__init__.py +59 -0
  47. aiecs/application/knowledge_graph/search/hybrid_search.py +423 -0
  48. aiecs/application/knowledge_graph/search/reranker.py +295 -0
  49. aiecs/application/knowledge_graph/search/reranker_strategies.py +553 -0
  50. aiecs/application/knowledge_graph/search/text_similarity.py +398 -0
  51. aiecs/application/knowledge_graph/traversal/__init__.py +15 -0
  52. aiecs/application/knowledge_graph/traversal/enhanced_traversal.py +329 -0
  53. aiecs/application/knowledge_graph/traversal/path_scorer.py +269 -0
  54. aiecs/application/knowledge_graph/validators/__init__.py +13 -0
  55. aiecs/application/knowledge_graph/validators/relation_validator.py +189 -0
  56. aiecs/application/knowledge_graph/visualization/__init__.py +11 -0
  57. aiecs/application/knowledge_graph/visualization/graph_visualizer.py +321 -0
  58. aiecs/common/__init__.py +9 -0
  59. aiecs/common/knowledge_graph/__init__.py +17 -0
  60. aiecs/common/knowledge_graph/runnable.py +484 -0
  61. aiecs/config/__init__.py +16 -0
  62. aiecs/config/config.py +498 -0
  63. aiecs/config/graph_config.py +137 -0
  64. aiecs/config/registry.py +23 -0
  65. aiecs/core/__init__.py +46 -0
  66. aiecs/core/interface/__init__.py +34 -0
  67. aiecs/core/interface/execution_interface.py +152 -0
  68. aiecs/core/interface/storage_interface.py +171 -0
  69. aiecs/domain/__init__.py +289 -0
  70. aiecs/domain/agent/__init__.py +189 -0
  71. aiecs/domain/agent/base_agent.py +697 -0
  72. aiecs/domain/agent/exceptions.py +103 -0
  73. aiecs/domain/agent/graph_aware_mixin.py +559 -0
  74. aiecs/domain/agent/hybrid_agent.py +490 -0
  75. aiecs/domain/agent/integration/__init__.py +26 -0
  76. aiecs/domain/agent/integration/context_compressor.py +222 -0
  77. aiecs/domain/agent/integration/context_engine_adapter.py +252 -0
  78. aiecs/domain/agent/integration/retry_policy.py +219 -0
  79. aiecs/domain/agent/integration/role_config.py +213 -0
  80. aiecs/domain/agent/knowledge_aware_agent.py +646 -0
  81. aiecs/domain/agent/lifecycle.py +296 -0
  82. aiecs/domain/agent/llm_agent.py +300 -0
  83. aiecs/domain/agent/memory/__init__.py +12 -0
  84. aiecs/domain/agent/memory/conversation.py +197 -0
  85. aiecs/domain/agent/migration/__init__.py +14 -0
  86. aiecs/domain/agent/migration/conversion.py +160 -0
  87. aiecs/domain/agent/migration/legacy_wrapper.py +90 -0
  88. aiecs/domain/agent/models.py +317 -0
  89. aiecs/domain/agent/observability.py +407 -0
  90. aiecs/domain/agent/persistence.py +289 -0
  91. aiecs/domain/agent/prompts/__init__.py +29 -0
  92. aiecs/domain/agent/prompts/builder.py +161 -0
  93. aiecs/domain/agent/prompts/formatters.py +189 -0
  94. aiecs/domain/agent/prompts/template.py +255 -0
  95. aiecs/domain/agent/registry.py +260 -0
  96. aiecs/domain/agent/tool_agent.py +257 -0
  97. aiecs/domain/agent/tools/__init__.py +12 -0
  98. aiecs/domain/agent/tools/schema_generator.py +221 -0
  99. aiecs/domain/community/__init__.py +155 -0
  100. aiecs/domain/community/agent_adapter.py +477 -0
  101. aiecs/domain/community/analytics.py +481 -0
  102. aiecs/domain/community/collaborative_workflow.py +642 -0
  103. aiecs/domain/community/communication_hub.py +645 -0
  104. aiecs/domain/community/community_builder.py +320 -0
  105. aiecs/domain/community/community_integration.py +800 -0
  106. aiecs/domain/community/community_manager.py +813 -0
  107. aiecs/domain/community/decision_engine.py +879 -0
  108. aiecs/domain/community/exceptions.py +225 -0
  109. aiecs/domain/community/models/__init__.py +33 -0
  110. aiecs/domain/community/models/community_models.py +268 -0
  111. aiecs/domain/community/resource_manager.py +457 -0
  112. aiecs/domain/community/shared_context_manager.py +603 -0
  113. aiecs/domain/context/__init__.py +58 -0
  114. aiecs/domain/context/context_engine.py +989 -0
  115. aiecs/domain/context/conversation_models.py +354 -0
  116. aiecs/domain/context/graph_memory.py +467 -0
  117. aiecs/domain/execution/__init__.py +12 -0
  118. aiecs/domain/execution/model.py +57 -0
  119. aiecs/domain/knowledge_graph/__init__.py +19 -0
  120. aiecs/domain/knowledge_graph/models/__init__.py +52 -0
  121. aiecs/domain/knowledge_graph/models/entity.py +130 -0
  122. aiecs/domain/knowledge_graph/models/evidence.py +194 -0
  123. aiecs/domain/knowledge_graph/models/inference_rule.py +186 -0
  124. aiecs/domain/knowledge_graph/models/path.py +179 -0
  125. aiecs/domain/knowledge_graph/models/path_pattern.py +173 -0
  126. aiecs/domain/knowledge_graph/models/query.py +272 -0
  127. aiecs/domain/knowledge_graph/models/query_plan.py +187 -0
  128. aiecs/domain/knowledge_graph/models/relation.py +136 -0
  129. aiecs/domain/knowledge_graph/schema/__init__.py +23 -0
  130. aiecs/domain/knowledge_graph/schema/entity_type.py +135 -0
  131. aiecs/domain/knowledge_graph/schema/graph_schema.py +271 -0
  132. aiecs/domain/knowledge_graph/schema/property_schema.py +155 -0
  133. aiecs/domain/knowledge_graph/schema/relation_type.py +171 -0
  134. aiecs/domain/knowledge_graph/schema/schema_manager.py +496 -0
  135. aiecs/domain/knowledge_graph/schema/type_enums.py +205 -0
  136. aiecs/domain/task/__init__.py +13 -0
  137. aiecs/domain/task/dsl_processor.py +613 -0
  138. aiecs/domain/task/model.py +62 -0
  139. aiecs/domain/task/task_context.py +268 -0
  140. aiecs/infrastructure/__init__.py +24 -0
  141. aiecs/infrastructure/graph_storage/__init__.py +11 -0
  142. aiecs/infrastructure/graph_storage/base.py +601 -0
  143. aiecs/infrastructure/graph_storage/batch_operations.py +449 -0
  144. aiecs/infrastructure/graph_storage/cache.py +429 -0
  145. aiecs/infrastructure/graph_storage/distributed.py +226 -0
  146. aiecs/infrastructure/graph_storage/error_handling.py +390 -0
  147. aiecs/infrastructure/graph_storage/graceful_degradation.py +306 -0
  148. aiecs/infrastructure/graph_storage/health_checks.py +378 -0
  149. aiecs/infrastructure/graph_storage/in_memory.py +514 -0
  150. aiecs/infrastructure/graph_storage/index_optimization.py +483 -0
  151. aiecs/infrastructure/graph_storage/lazy_loading.py +410 -0
  152. aiecs/infrastructure/graph_storage/metrics.py +357 -0
  153. aiecs/infrastructure/graph_storage/migration.py +413 -0
  154. aiecs/infrastructure/graph_storage/pagination.py +471 -0
  155. aiecs/infrastructure/graph_storage/performance_monitoring.py +466 -0
  156. aiecs/infrastructure/graph_storage/postgres.py +871 -0
  157. aiecs/infrastructure/graph_storage/query_optimizer.py +635 -0
  158. aiecs/infrastructure/graph_storage/schema_cache.py +290 -0
  159. aiecs/infrastructure/graph_storage/sqlite.py +623 -0
  160. aiecs/infrastructure/graph_storage/streaming.py +495 -0
  161. aiecs/infrastructure/messaging/__init__.py +13 -0
  162. aiecs/infrastructure/messaging/celery_task_manager.py +383 -0
  163. aiecs/infrastructure/messaging/websocket_manager.py +298 -0
  164. aiecs/infrastructure/monitoring/__init__.py +34 -0
  165. aiecs/infrastructure/monitoring/executor_metrics.py +174 -0
  166. aiecs/infrastructure/monitoring/global_metrics_manager.py +213 -0
  167. aiecs/infrastructure/monitoring/structured_logger.py +48 -0
  168. aiecs/infrastructure/monitoring/tracing_manager.py +410 -0
  169. aiecs/infrastructure/persistence/__init__.py +24 -0
  170. aiecs/infrastructure/persistence/context_engine_client.py +187 -0
  171. aiecs/infrastructure/persistence/database_manager.py +333 -0
  172. aiecs/infrastructure/persistence/file_storage.py +754 -0
  173. aiecs/infrastructure/persistence/redis_client.py +220 -0
  174. aiecs/llm/__init__.py +86 -0
  175. aiecs/llm/callbacks/__init__.py +11 -0
  176. aiecs/llm/callbacks/custom_callbacks.py +264 -0
  177. aiecs/llm/client_factory.py +420 -0
  178. aiecs/llm/clients/__init__.py +33 -0
  179. aiecs/llm/clients/base_client.py +193 -0
  180. aiecs/llm/clients/googleai_client.py +181 -0
  181. aiecs/llm/clients/openai_client.py +131 -0
  182. aiecs/llm/clients/vertex_client.py +437 -0
  183. aiecs/llm/clients/xai_client.py +184 -0
  184. aiecs/llm/config/__init__.py +51 -0
  185. aiecs/llm/config/config_loader.py +275 -0
  186. aiecs/llm/config/config_validator.py +236 -0
  187. aiecs/llm/config/model_config.py +151 -0
  188. aiecs/llm/utils/__init__.py +10 -0
  189. aiecs/llm/utils/validate_config.py +91 -0
  190. aiecs/main.py +363 -0
  191. aiecs/scripts/__init__.py +3 -0
  192. aiecs/scripts/aid/VERSION_MANAGEMENT.md +97 -0
  193. aiecs/scripts/aid/__init__.py +19 -0
  194. aiecs/scripts/aid/version_manager.py +215 -0
  195. aiecs/scripts/dependance_check/DEPENDENCY_SYSTEM_SUMMARY.md +242 -0
  196. aiecs/scripts/dependance_check/README_DEPENDENCY_CHECKER.md +310 -0
  197. aiecs/scripts/dependance_check/__init__.py +17 -0
  198. aiecs/scripts/dependance_check/dependency_checker.py +938 -0
  199. aiecs/scripts/dependance_check/dependency_fixer.py +391 -0
  200. aiecs/scripts/dependance_check/download_nlp_data.py +396 -0
  201. aiecs/scripts/dependance_check/quick_dependency_check.py +270 -0
  202. aiecs/scripts/dependance_check/setup_nlp_data.sh +217 -0
  203. aiecs/scripts/dependance_patch/__init__.py +7 -0
  204. aiecs/scripts/dependance_patch/fix_weasel/README_WEASEL_PATCH.md +126 -0
  205. aiecs/scripts/dependance_patch/fix_weasel/__init__.py +11 -0
  206. aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.py +128 -0
  207. aiecs/scripts/dependance_patch/fix_weasel/fix_weasel_validator.sh +82 -0
  208. aiecs/scripts/dependance_patch/fix_weasel/patch_weasel_library.sh +188 -0
  209. aiecs/scripts/dependance_patch/fix_weasel/run_weasel_patch.sh +41 -0
  210. aiecs/scripts/tools_develop/README.md +449 -0
  211. aiecs/scripts/tools_develop/TOOL_AUTO_DISCOVERY.md +234 -0
  212. aiecs/scripts/tools_develop/__init__.py +21 -0
  213. aiecs/scripts/tools_develop/check_type_annotations.py +259 -0
  214. aiecs/scripts/tools_develop/validate_tool_schemas.py +422 -0
  215. aiecs/scripts/tools_develop/verify_tools.py +356 -0
  216. aiecs/tasks/__init__.py +1 -0
  217. aiecs/tasks/worker.py +172 -0
  218. aiecs/tools/__init__.py +299 -0
  219. aiecs/tools/apisource/__init__.py +99 -0
  220. aiecs/tools/apisource/intelligence/__init__.py +19 -0
  221. aiecs/tools/apisource/intelligence/data_fusion.py +381 -0
  222. aiecs/tools/apisource/intelligence/query_analyzer.py +413 -0
  223. aiecs/tools/apisource/intelligence/search_enhancer.py +388 -0
  224. aiecs/tools/apisource/monitoring/__init__.py +9 -0
  225. aiecs/tools/apisource/monitoring/metrics.py +303 -0
  226. aiecs/tools/apisource/providers/__init__.py +115 -0
  227. aiecs/tools/apisource/providers/base.py +664 -0
  228. aiecs/tools/apisource/providers/census.py +401 -0
  229. aiecs/tools/apisource/providers/fred.py +564 -0
  230. aiecs/tools/apisource/providers/newsapi.py +412 -0
  231. aiecs/tools/apisource/providers/worldbank.py +357 -0
  232. aiecs/tools/apisource/reliability/__init__.py +12 -0
  233. aiecs/tools/apisource/reliability/error_handler.py +375 -0
  234. aiecs/tools/apisource/reliability/fallback_strategy.py +391 -0
  235. aiecs/tools/apisource/tool.py +850 -0
  236. aiecs/tools/apisource/utils/__init__.py +9 -0
  237. aiecs/tools/apisource/utils/validators.py +338 -0
  238. aiecs/tools/base_tool.py +201 -0
  239. aiecs/tools/docs/__init__.py +121 -0
  240. aiecs/tools/docs/ai_document_orchestrator.py +599 -0
  241. aiecs/tools/docs/ai_document_writer_orchestrator.py +2403 -0
  242. aiecs/tools/docs/content_insertion_tool.py +1333 -0
  243. aiecs/tools/docs/document_creator_tool.py +1317 -0
  244. aiecs/tools/docs/document_layout_tool.py +1166 -0
  245. aiecs/tools/docs/document_parser_tool.py +994 -0
  246. aiecs/tools/docs/document_writer_tool.py +1818 -0
  247. aiecs/tools/knowledge_graph/__init__.py +17 -0
  248. aiecs/tools/knowledge_graph/graph_reasoning_tool.py +734 -0
  249. aiecs/tools/knowledge_graph/graph_search_tool.py +923 -0
  250. aiecs/tools/knowledge_graph/kg_builder_tool.py +476 -0
  251. aiecs/tools/langchain_adapter.py +542 -0
  252. aiecs/tools/schema_generator.py +275 -0
  253. aiecs/tools/search_tool/__init__.py +100 -0
  254. aiecs/tools/search_tool/analyzers.py +589 -0
  255. aiecs/tools/search_tool/cache.py +260 -0
  256. aiecs/tools/search_tool/constants.py +128 -0
  257. aiecs/tools/search_tool/context.py +216 -0
  258. aiecs/tools/search_tool/core.py +749 -0
  259. aiecs/tools/search_tool/deduplicator.py +123 -0
  260. aiecs/tools/search_tool/error_handler.py +271 -0
  261. aiecs/tools/search_tool/metrics.py +371 -0
  262. aiecs/tools/search_tool/rate_limiter.py +178 -0
  263. aiecs/tools/search_tool/schemas.py +277 -0
  264. aiecs/tools/statistics/__init__.py +80 -0
  265. aiecs/tools/statistics/ai_data_analysis_orchestrator.py +643 -0
  266. aiecs/tools/statistics/ai_insight_generator_tool.py +505 -0
  267. aiecs/tools/statistics/ai_report_orchestrator_tool.py +694 -0
  268. aiecs/tools/statistics/data_loader_tool.py +564 -0
  269. aiecs/tools/statistics/data_profiler_tool.py +658 -0
  270. aiecs/tools/statistics/data_transformer_tool.py +573 -0
  271. aiecs/tools/statistics/data_visualizer_tool.py +495 -0
  272. aiecs/tools/statistics/model_trainer_tool.py +487 -0
  273. aiecs/tools/statistics/statistical_analyzer_tool.py +459 -0
  274. aiecs/tools/task_tools/__init__.py +86 -0
  275. aiecs/tools/task_tools/chart_tool.py +732 -0
  276. aiecs/tools/task_tools/classfire_tool.py +922 -0
  277. aiecs/tools/task_tools/image_tool.py +447 -0
  278. aiecs/tools/task_tools/office_tool.py +684 -0
  279. aiecs/tools/task_tools/pandas_tool.py +635 -0
  280. aiecs/tools/task_tools/report_tool.py +635 -0
  281. aiecs/tools/task_tools/research_tool.py +392 -0
  282. aiecs/tools/task_tools/scraper_tool.py +715 -0
  283. aiecs/tools/task_tools/stats_tool.py +688 -0
  284. aiecs/tools/temp_file_manager.py +130 -0
  285. aiecs/tools/tool_executor/__init__.py +37 -0
  286. aiecs/tools/tool_executor/tool_executor.py +881 -0
  287. aiecs/utils/LLM_output_structor.py +445 -0
  288. aiecs/utils/__init__.py +34 -0
  289. aiecs/utils/base_callback.py +47 -0
  290. aiecs/utils/cache_provider.py +695 -0
  291. aiecs/utils/execution_utils.py +184 -0
  292. aiecs/utils/logging.py +1 -0
  293. aiecs/utils/prompt_loader.py +14 -0
  294. aiecs/utils/token_usage_repository.py +323 -0
  295. aiecs/ws/__init__.py +0 -0
  296. aiecs/ws/socket_server.py +52 -0
  297. aiecs-1.5.1.dist-info/METADATA +608 -0
  298. aiecs-1.5.1.dist-info/RECORD +302 -0
  299. aiecs-1.5.1.dist-info/WHEEL +5 -0
  300. aiecs-1.5.1.dist-info/entry_points.txt +10 -0
  301. aiecs-1.5.1.dist-info/licenses/LICENSE +225 -0
  302. aiecs-1.5.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,608 @@
1
+ Metadata-Version: 2.4
2
+ Name: aiecs
3
+ Version: 1.5.1
4
+ Summary: AI Execute Services - A middleware framework for AI-powered task execution and tool orchestration
5
+ Author-email: AIECS Team <iretbl@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/aiecs-team/aiecs
8
+ Project-URL: Bug Tracker, https://github.com/aiecs-team/aiecs/issues
9
+ Project-URL: Documentation, https://aiecs.readthedocs.io
10
+ Keywords: ai,middleware,llm,orchestration,async,tools
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Framework :: FastAPI
19
+ Classifier: Framework :: Celery
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: <3.13,>=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: fastapi<0.116.0,>=0.115.12
25
+ Requires-Dist: httpx<0.29.0,>=0.28.1
26
+ Requires-Dist: uvicorn[standard]<0.35.0,>=0.34.2
27
+ Requires-Dist: python-dotenv<2.0.0,>=1.1.0
28
+ Requires-Dist: pydantic<3.0.0,>=2.11.5
29
+ Requires-Dist: pydantic-settings<3.0.0,>=2.9.1
30
+ Requires-Dist: cachetools<6.0.0,>=5.0.0
31
+ Requires-Dist: typing-extensions<5.0.0,>=4.13.2
32
+ Requires-Dist: aiofiles<25.0.0,>=24.1.0
33
+ Requires-Dist: celery<6.0.0,>=5.5.2
34
+ Requires-Dist: redis<7.0.0,>=6.2.0
35
+ Requires-Dist: python-socketio<6.0.0,>=5.13.0
36
+ Requires-Dist: python-engineio<5.0.0,>=4.12.1
37
+ Requires-Dist: tenacity<10.0.0,>=9.1.2
38
+ Requires-Dist: flower<3.0.0,>=2.0.1
39
+ Requires-Dist: openai<1.76.0,>=1.68.2
40
+ Requires-Dist: google-cloud-aiplatform<2.0.0,>=1.80.0
41
+ Requires-Dist: google-generativeai<1.0.0,>=0.8.0
42
+ Requires-Dist: google-api-python-client<3.0.0,>=2.108.0
43
+ Requires-Dist: google-auth<3.0.0,>=2.25.0
44
+ Requires-Dist: google-auth-httplib2<1.0.0,>=0.2.0
45
+ Requires-Dist: google-auth-oauthlib<2.0.0,>=1.2.0
46
+ Requires-Dist: langchain<0.4.0,>=0.3.26
47
+ Requires-Dist: langgraph<0.6.0,>=0.5.3
48
+ Requires-Dist: weasel==0.4.1
49
+ Requires-Dist: spacy<4.0.0,>=3.8.7
50
+ Requires-Dist: rake-nltk<2.0.0,>=1.0.6
51
+ Requires-Dist: numpy<3.0.0,>=2.2.6
52
+ Requires-Dist: pandas<3.0.0,>=2.2.3
53
+ Requires-Dist: scipy<2.0.0,>=1.15.3
54
+ Requires-Dist: scikit-learn<2.0.0,>=1.5.0
55
+ Requires-Dist: statsmodels<0.15.0,>=0.14.4
56
+ Requires-Dist: pyreadstat<2.0.0,>=1.2.9
57
+ Requires-Dist: tabulate<0.10.0,>=0.9.0
58
+ Requires-Dist: python-docx<2.0.0,>=1.1.2
59
+ Requires-Dist: python-pptx<2.0.0,>=1.0.2
60
+ Requires-Dist: openpyxl<4.0.0,>=3.1.5
61
+ Requires-Dist: pdfplumber<0.12.0,>=0.11.7
62
+ Requires-Dist: pdfminer-six==20250506
63
+ Requires-Dist: tika<3.0.0,>=2.6.0
64
+ Requires-Dist: matplotlib<4.0.0,>=3.10.3
65
+ Requires-Dist: seaborn<0.14.0,>=0.13.2
66
+ Requires-Dist: jinja2<4.0.0,>=3.1.6
67
+ Requires-Dist: beautifulsoup4<5.0.0,>=4.13.4
68
+ Requires-Dist: lxml<6.0.0,>=5.4.0
69
+ Requires-Dist: playwright<2.0.0,>=1.52.0
70
+ Requires-Dist: pytesseract<0.4.0,>=0.3.13
71
+ Requires-Dist: pillow<12.0.0,>=11.2.1
72
+ Requires-Dist: scrapy<3.0.0,>=2.13.3
73
+ Requires-Dist: pyyaml<7.0.0,>=6.0.2
74
+ Requires-Dist: markdown<4.0,>=3.8
75
+ Requires-Dist: bleach<7.0.0,>=6.2.0
76
+ Requires-Dist: sqlalchemy<3.0.0,>=2.0.41
77
+ Requires-Dist: asyncpg<1.0.0,>=0.30.0
78
+ Requires-Dist: aiosqlite<1.0.0,>=0.20.0
79
+ Requires-Dist: networkx<4.0.0,>=3.0
80
+ Requires-Dist: lark-parser<0.13.0,>=0.12.0
81
+ Requires-Dist: prometheus-client<1.0.0,>=0.21.1
82
+ Requires-Dist: jaeger-client<5.0.0,>=4.8.0
83
+ Requires-Dist: opentracing<3.0.0,>=2.4.0
84
+ Requires-Dist: psutil<8.0.0,>=7.0.0
85
+ Dynamic: license-file
86
+
87
+ # AIECS - AI Execute Services
88
+
89
+ [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
90
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
91
+ [![PyPI version](https://badge.fury.io/py/aiecs.svg)](https://badge.fury.io/py/aiecs)
92
+
93
+ AIECS (AI Execute Services) is a powerful Python middleware framework for building AI-powered applications with tool orchestration, task execution, and multi-provider LLM support.
94
+
95
+ ## Features
96
+
97
+ - **Multi-Provider LLM Support**: Seamlessly integrate with OpenAI, Google Vertex AI, and xAI
98
+ - **Tool Orchestration**: Extensible tool system for various tasks (web scraping, data analysis, document processing, etc.)
99
+ - **Asynchronous Task Execution**: Built on Celery for scalable task processing
100
+ - **Real-time Communication**: WebSocket support for live updates and progress tracking
101
+ - **Enterprise-Ready**: Production-grade architecture with PostgreSQL, Redis, and Google Cloud Storage integration
102
+ - **Extensible Architecture**: Easy to add custom tools and AI providers
103
+
104
+ ## Installation
105
+
106
+ ### From PyPI (Recommended)
107
+
108
+ ```bash
109
+ pip install aiecs
110
+ ```
111
+
112
+ ### From Source
113
+
114
+ ```bash
115
+ # Clone the repository
116
+ git clone https://github.com/aiecs-team/aiecs.git
117
+ cd aiecs
118
+
119
+ # Install in development mode
120
+ pip install -e .
121
+
122
+ # Or install with development dependencies
123
+ pip install -e ".[dev]"
124
+ ```
125
+
126
+ ### Post-Installation Setup
127
+
128
+ After installation, you can use the built-in tools to set up dependencies and verify your installation:
129
+
130
+ ```bash
131
+ # Check all dependencies
132
+ aiecs-check-deps
133
+
134
+ # Quick dependency check
135
+ aiecs-quick-check
136
+
137
+ # Download required NLP models and data
138
+ aiecs-download-nlp-data
139
+
140
+ # Fix common dependency issues automatically
141
+ aiecs-fix-deps
142
+
143
+ # Apply Weasel library patch (if needed)
144
+ aiecs-patch-weasel
145
+ ```
146
+
147
+ ## Quick Start
148
+
149
+ ### Basic Usage
150
+
151
+ ```python
152
+ from aiecs import AIECS
153
+ from aiecs.domain.task.task_context import TaskContext
154
+
155
+ # Initialize AIECS
156
+ aiecs = AIECS()
157
+
158
+ # Create a task context
159
+ context = TaskContext(
160
+ mode="execute",
161
+ service="default",
162
+ user_id="user123",
163
+ metadata={
164
+ "aiPreference": {
165
+ "provider": "OpenAI",
166
+ "model": "gpt-4"
167
+ }
168
+ },
169
+ data={
170
+ "task": "Analyze this text and extract key points",
171
+ "content": "Your text here..."
172
+ }
173
+ )
174
+
175
+ # Execute task
176
+ result = await aiecs.execute(context)
177
+ print(result)
178
+ ```
179
+
180
+ ### Using Tools
181
+
182
+ ```python
183
+ from aiecs.tools import get_tool
184
+
185
+ # Get a specific tool
186
+ scraper = get_tool("scraper_tool")
187
+
188
+ # Execute tool
189
+ result = await scraper.execute({
190
+ "url": "https://example.com",
191
+ "extract": ["title", "content"]
192
+ })
193
+ ```
194
+
195
+ ### Custom Tool Development
196
+
197
+ ```python
198
+ from aiecs.tools import register_tool
199
+ from aiecs.tools.base_tool import BaseTool
200
+
201
+ @register_tool("my_custom_tool")
202
+ class MyCustomTool(BaseTool):
203
+ """Custom tool for specific tasks"""
204
+
205
+ name = "my_custom_tool"
206
+ description = "Does something specific"
207
+
208
+ async def execute(self, params: dict) -> dict:
209
+ # Your tool logic here
210
+ return {"result": "success"}
211
+ ```
212
+
213
+ ## Configuration
214
+
215
+ Create a `.env` file with the following variables:
216
+
217
+ ```env
218
+ # LLM Providers
219
+ OPENAI_API_KEY=your_openai_key
220
+ VERTEX_PROJECT_ID=your_gcp_project
221
+ VERTEX_LOCATION=us-central1
222
+ GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json
223
+ XAI_API_KEY=your_xai_key
224
+
225
+ # Database
226
+ DB_HOST=localhost
227
+ DB_USER=postgres
228
+ DB_PASSWORD=your_password
229
+ DB_NAME=aiecs_db
230
+ DB_PORT=5432
231
+
232
+ # Redis (for Celery)
233
+ CELERY_BROKER_URL=redis://localhost:6379/0
234
+
235
+ # Google Cloud Storage
236
+ GOOGLE_CLOUD_PROJECT_ID=your_project_id
237
+ GOOGLE_CLOUD_STORAGE_BUCKET=your_bucket_name
238
+
239
+ # CORS
240
+ CORS_ALLOWED_ORIGINS=http://localhost:3000,https://yourdomain.com
241
+ ```
242
+
243
+ ## Command Line Tools
244
+
245
+ AIECS provides several command-line tools for setup and maintenance:
246
+
247
+ ### Dependency Management
248
+
249
+ ```bash
250
+ # Check all dependencies (comprehensive)
251
+ aiecs-check-deps
252
+
253
+ # Quick dependency check
254
+ aiecs-quick-check
255
+
256
+ # Automatically fix missing dependencies
257
+ aiecs-fix-deps --non-interactive
258
+
259
+ # Fix dependencies interactively (default)
260
+ aiecs-fix-deps
261
+ ```
262
+
263
+ ### Setup and Configuration
264
+
265
+ ```bash
266
+ # Download required NLP models and data
267
+ aiecs-download-nlp-data
268
+
269
+ # Apply Weasel library patch (fixes validator conflicts)
270
+ aiecs-patch-weasel
271
+ ```
272
+
273
+ ### Main Application
274
+
275
+ ```bash
276
+ # Start the AIECS server
277
+ aiecs
278
+
279
+ # Or start with custom configuration
280
+ aiecs --host 0.0.0.0 --port 8000
281
+ ```
282
+
283
+ ## Running as a Service
284
+
285
+ ### Start the API Server
286
+
287
+ ```bash
288
+ # Using the aiecs command (recommended)
289
+ aiecs
290
+
291
+ # Using uvicorn directly
292
+ uvicorn aiecs.main:app --host 0.0.0.0 --port 8000
293
+
294
+ # Or using the Python module
295
+ python -m aiecs
296
+ ```
297
+
298
+ ### Start Celery Workers
299
+
300
+ ```bash
301
+ # Start worker
302
+ celery -A aiecs.tasks.worker.celery_app worker --loglevel=info
303
+
304
+ # Start beat scheduler (for periodic tasks)
305
+ celery -A aiecs.tasks.worker.celery_app beat --loglevel=info
306
+
307
+ # Start Flower (Celery monitoring)
308
+ celery -A aiecs.tasks.worker.celery_app flower
309
+ ```
310
+
311
+ ## API Endpoints
312
+
313
+ - `GET /health` - Health check
314
+ - `GET /api/tools` - List available tools
315
+ - `GET /api/services` - List available AI services
316
+ - `GET /api/providers` - List LLM providers
317
+ - `POST /api/execute` - Execute a task
318
+ - `GET /api/task/{task_id}` - Get task status
319
+ - `DELETE /api/task/{task_id}` - Cancel a task
320
+
321
+ ## WebSocket Events
322
+
323
+ Connect to the WebSocket endpoint for real-time updates:
324
+
325
+ ```javascript
326
+ const socket = io('http://localhost:8000');
327
+
328
+ socket.on('connect', () => {
329
+ console.log('Connected to AIECS');
330
+
331
+ // Register user for updates
332
+ socket.emit('register', { user_id: 'user123' });
333
+ });
334
+
335
+ socket.on('progress', (data) => {
336
+ console.log('Task progress:', data);
337
+ });
338
+ ```
339
+
340
+ ## Available Tools
341
+
342
+ AIECS comes with a comprehensive set of pre-built tools:
343
+
344
+ - **Web Tools**: Web scraping, search API integration
345
+ - **Data Analysis**: Pandas operations, statistical analysis
346
+ - **Document Processing**: PDF, Word, PowerPoint handling
347
+ - **Image Processing**: OCR, image manipulation
348
+ - **Research Tools**: Academic research, report generation
349
+ - **Chart Generation**: Data visualization tools
350
+
351
+ ## Architecture
352
+
353
+ AIECS follows a clean architecture pattern with clear separation of concerns:
354
+
355
+ ```
356
+ aiecs/
357
+ โ”œโ”€โ”€ domain/ # Core business logic
358
+ โ”œโ”€โ”€ application/ # Use cases and application services
359
+ โ”œโ”€โ”€ infrastructure/ # External services and adapters
360
+ โ”œโ”€โ”€ llm/ # LLM provider implementations
361
+ โ”œโ”€โ”€ tools/ # Tool implementations
362
+ โ”œโ”€โ”€ config/ # Configuration management
363
+ โ””โ”€โ”€ main.py # FastAPI application entry point
364
+ ```
365
+
366
+ ## Development
367
+
368
+ ### Setting up Development Environment
369
+
370
+ ```bash
371
+ # Clone the repository
372
+ git clone https://github.com/yourusername/aiecs.git
373
+ cd aiecs
374
+
375
+ # Install dependencies
376
+ pip install -e ".[dev]"
377
+
378
+ # Run tests
379
+ pytest
380
+
381
+ # Run linting
382
+ flake8 aiecs/
383
+ mypy aiecs/
384
+ ```
385
+
386
+ ### Contributing
387
+
388
+ 1. Fork the repository
389
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
390
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
391
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
392
+ 5. Open a Pull Request
393
+
394
+ ## Troubleshooting
395
+
396
+ ### Common Issues
397
+
398
+ 1. **Missing Dependencies**: Use the built-in dependency checker and fixer:
399
+ ```bash
400
+ # Check what's missing
401
+ aiecs-check-deps
402
+
403
+ # Automatically fix issues
404
+ aiecs-fix-deps --non-interactive
405
+ ```
406
+
407
+ 2. **Weasel Library Validator Error**: If you encounter duplicate validator function errors:
408
+ ```bash
409
+ aiecs-patch-weasel
410
+ ```
411
+
412
+ 3. **Missing NLP Models**: Download required models and data:
413
+ ```bash
414
+ aiecs-download-nlp-data
415
+ ```
416
+
417
+ 4. **Database Connection Issues**: Ensure PostgreSQL is running and credentials are correct
418
+
419
+ 5. **Redis Connection Issues**: Verify Redis is running for Celery task queue
420
+
421
+ ### Dependency Check Output
422
+
423
+ The dependency checker provides detailed information about:
424
+ - โœ… Available dependencies
425
+ - โŒ Missing critical dependencies
426
+ - โš ๏ธ Missing optional dependencies
427
+ - ๐Ÿ“ฆ System-level requirements
428
+ - ๐Ÿค– AI models and data files
429
+
430
+ Example output:
431
+ ```
432
+ ๐Ÿ” AIECS Quick Dependency Check
433
+ ==================================================
434
+
435
+ ๐Ÿ“ฆ Critical Dependencies:
436
+ โœ… All critical dependencies are available
437
+
438
+ ๐Ÿ”ง Tool-Specific Dependencies:
439
+ โœ… Image Tool
440
+ โœ… Classfire Tool
441
+ โœ… Office Tool
442
+ โœ… Stats Tool
443
+ โœ… Report Tool
444
+ โœ… Scraper Tool
445
+
446
+ โœ… All dependencies are satisfied!
447
+ ```
448
+
449
+ ## Development and Packaging
450
+
451
+ ### Building the Package
452
+
453
+ To build the distribution packages:
454
+
455
+ ```bash
456
+ # Clean previous builds
457
+ rm -rf build/ dist/ *.egg-info/
458
+
459
+ # Build both wheel and source distribution
460
+ python3 -m build --sdist --wheel
461
+ ```
462
+
463
+ ### Environment Cleanup
464
+
465
+ For development and before releasing, you may want to clean up the environment completely. Here's the comprehensive cleanup process:
466
+
467
+ #### 1. Clean Python Cache and Build Files
468
+
469
+ ```bash
470
+ # Remove Python cache files
471
+ find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
472
+ find . -name "*.pyc" -delete 2>/dev/null || true
473
+ find . -name "*.pyo" -delete 2>/dev/null || true
474
+
475
+ # Remove build and packaging artifacts
476
+ rm -rf build/ *.egg-info/ .eggs/
477
+
478
+ # Remove test and coverage cache
479
+ rm -rf .pytest_cache/ .coverage*
480
+ ```
481
+
482
+ #### 2. Clean Log and Temporary Files
483
+
484
+ ```bash
485
+ # Remove log files
486
+ rm -f *.log dependency_report.txt
487
+
488
+ # Remove temporary directories
489
+ rm -rf /tmp/wheel_*
490
+
491
+ # Remove backup files
492
+ find . -name "*.backup.*" -delete 2>/dev/null || true
493
+ ```
494
+
495
+ #### 3. Uninstall AIECS Package (if installed)
496
+
497
+ ```bash
498
+ # Uninstall the package completely
499
+ pip uninstall aiecs -y
500
+
501
+ # Verify removal
502
+ pip list | grep aiecs || echo "โœ… aiecs package completely removed"
503
+ ```
504
+
505
+ #### 4. Clean Downloaded NLP Data and Models
506
+
507
+ If you've used the AIECS NLP tools, you may want to remove downloaded data:
508
+
509
+ ```bash
510
+ # Remove NLTK data (stopwords, punkt, wordnet, etc.)
511
+ rm -rf ~/nltk_data
512
+
513
+ # Remove spaCy models
514
+ pip uninstall en-core-web-sm zh-core-web-sm spacy-pkuseg -y 2>/dev/null || true
515
+
516
+ # Verify spaCy models removal
517
+ python3 -c "import spacy; print('spaCy models:', spacy.util.get_installed_models())" 2>/dev/null || echo "โœ… spaCy models removed"
518
+ ```
519
+
520
+ #### 5. Complete Cleanup Script
521
+
522
+ For convenience, here's a complete cleanup script:
523
+
524
+ ```bash
525
+ #!/bin/bash
526
+ echo "๐Ÿงน Starting complete AIECS environment cleanup..."
527
+
528
+ # Python cache and build files
529
+ echo "๐Ÿ“ Cleaning Python cache and build files..."
530
+ find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
531
+ find . -name "*.pyc" -delete 2>/dev/null || true
532
+ find . -name "*.pyo" -delete 2>/dev/null || true
533
+ rm -rf build/ *.egg-info/ .eggs/ .pytest_cache/ .coverage*
534
+
535
+ # Log and temporary files
536
+ echo "๐Ÿ“ Cleaning log and temporary files..."
537
+ rm -f *.log dependency_report.txt
538
+ rm -rf /tmp/wheel_*
539
+ find . -name "*.backup.*" -delete 2>/dev/null || true
540
+
541
+ # Uninstall package
542
+ echo "๐Ÿ—‘๏ธ Uninstalling AIECS package..."
543
+ pip uninstall aiecs -y 2>/dev/null || true
544
+
545
+ # Clean NLP data
546
+ echo "๐Ÿค– Cleaning NLP data and models..."
547
+ rm -rf ~/nltk_data
548
+ pip uninstall en-core-web-sm zh-core-web-sm spacy-pkuseg -y 2>/dev/null || true
549
+
550
+ # Verify final state
551
+ echo "โœ… Cleanup complete! Final package state:"
552
+ ls -la dist/ 2>/dev/null || echo "No dist/ directory found"
553
+ echo "Environment is now clean and ready for release."
554
+ ```
555
+
556
+ #### What Gets Preserved
557
+
558
+ The cleanup process preserves:
559
+ - โœ… Source code files
560
+ - โœ… Test files and coverage reports (for maintenance)
561
+ - โœ… Configuration files (`.gitignore`, `pyproject.toml`, etc.)
562
+ - โœ… Documentation files
563
+ - โœ… Final distribution packages in `dist/`
564
+
565
+ #### What Gets Removed
566
+
567
+ The cleanup removes:
568
+ - โŒ Python cache files (`__pycache__/`, `*.pyc`)
569
+ - โŒ Build artifacts (`build/`, `*.egg-info/`)
570
+ - โŒ Log files (`*.log`, `dependency_report.txt`)
571
+ - โŒ Installed AIECS package and command-line tools
572
+ - โŒ Downloaded NLP data and models (~110MB)
573
+ - โŒ Temporary and backup files
574
+
575
+ ### Release Preparation
576
+
577
+ After cleanup, your `dist/` directory should contain only:
578
+
579
+ ```
580
+ dist/
581
+ โ”œโ”€โ”€ aiecs-1.0.0-py3-none-any.whl # Production-ready wheel package
582
+ โ””โ”€โ”€ aiecs-1.0.0.tar.gz # Production-ready source package
583
+ ```
584
+
585
+ These packages are ready for:
586
+ - PyPI publication: `twine upload dist/*`
587
+ - GitHub Releases
588
+ - Private repository distribution
589
+
590
+ ## License
591
+
592
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
593
+
594
+ ## Acknowledgments
595
+
596
+ - Built with FastAPI, Celery, and modern Python async patterns
597
+ - Integrates with leading AI providers
598
+ - Inspired by enterprise-grade middleware architectures
599
+
600
+ ## Support
601
+
602
+ - Documentation: [https://aiecs.readthedocs.io](https://aiecs.readthedocs.io)
603
+ - Issues: [GitHub Issues](https://github.com/yourusername/aiecs/issues)
604
+ - Discussions: [GitHub Discussions](https://github.com/yourusername/aiecs/discussions)
605
+
606
+ ---
607
+
608
+ Made with โค๏ธ by the AIECS Team