agentsociety2 2.0.0__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.

Potentially problematic release.


This version of agentsociety2 might be problematic. Click here for more details.

Files changed (197) hide show
  1. agentsociety2/__init__.py +40 -0
  2. agentsociety2/agent/__init__.py +4 -0
  3. agentsociety2/agent/base.py +790 -0
  4. agentsociety2/agent/donothing.py +167 -0
  5. agentsociety2/agent/person.py +3145 -0
  6. agentsociety2/backend/API_REFERENCE.md +348 -0
  7. agentsociety2/backend/README.md +355 -0
  8. agentsociety2/backend/__init__.py +2 -0
  9. agentsociety2/backend/analysis/README.md +225 -0
  10. agentsociety2/backend/analysis/__init__.py +95 -0
  11. agentsociety2/backend/analysis/agents.py +977 -0
  12. agentsociety2/backend/analysis/eda.py +147 -0
  13. agentsociety2/backend/analysis/models.py +334 -0
  14. agentsociety2/backend/analysis/prompts.py +78 -0
  15. agentsociety2/backend/analysis/report_generator.py +802 -0
  16. agentsociety2/backend/analysis/service.py +1081 -0
  17. agentsociety2/backend/analysis/skills/00_xml_contract.md +9 -0
  18. agentsociety2/backend/analysis/skills/10_visualization_reliability.md +15 -0
  19. agentsociety2/backend/analysis/skills/20_core_skills.md +76 -0
  20. agentsociety2/backend/analysis/skills/30_advanced_analysis.md +51 -0
  21. agentsociety2/backend/analysis/tool_executor.py +620 -0
  22. agentsociety2/backend/analysis/utils.py +334 -0
  23. agentsociety2/backend/app.py +184 -0
  24. agentsociety2/backend/models.py +68 -0
  25. agentsociety2/backend/routers/__init__.py +5 -0
  26. agentsociety2/backend/routers/chat.py +179 -0
  27. agentsociety2/backend/routers/custom.py +331 -0
  28. agentsociety2/backend/routers/experiments.py +485 -0
  29. agentsociety2/backend/routers/literature.py +281 -0
  30. agentsociety2/backend/routers/mineru.py +274 -0
  31. agentsociety2/backend/routers/modules.py +71 -0
  32. agentsociety2/backend/routers/prefill_params.py +176 -0
  33. agentsociety2/backend/routers/replay.py +844 -0
  34. agentsociety2/backend/routers/workspace.py +192 -0
  35. agentsociety2/backend/run.py +47 -0
  36. agentsociety2/backend/services/__init__.py +2 -0
  37. agentsociety2/backend/services/completion_service.py +673 -0
  38. agentsociety2/backend/services/custom/__init__.py +9 -0
  39. agentsociety2/backend/services/custom/generator.py +168 -0
  40. agentsociety2/backend/services/custom/scanner.py +274 -0
  41. agentsociety2/backend/services/custom/script_generator.py +302 -0
  42. agentsociety2/backend/sse/__init__.py +21 -0
  43. agentsociety2/backend/sse/models.py +65 -0
  44. agentsociety2/backend/tasks/__init__.py +5 -0
  45. agentsociety2/backend/tasks/manager.py +327 -0
  46. agentsociety2/backend/tools/__init__.py +2 -0
  47. agentsociety2/backend/tools/analysis_workspace.py +310 -0
  48. agentsociety2/backend/tools/base.py +95 -0
  49. agentsociety2/backend/tools/data_analysis.py +155 -0
  50. agentsociety2/backend/tools/experiment_analysis.py +596 -0
  51. agentsociety2/backend/tools/experiment_config.py +1630 -0
  52. agentsociety2/backend/tools/file_system.py +916 -0
  53. agentsociety2/backend/tools/generate_paper.py +787 -0
  54. agentsociety2/backend/tools/hypothesis.py +691 -0
  55. agentsociety2/backend/tools/literature_models.py +173 -0
  56. agentsociety2/backend/tools/literature_search.py +430 -0
  57. agentsociety2/backend/tools/load_literature.py +362 -0
  58. agentsociety2/backend/tools/miro_web_research.py +190 -0
  59. agentsociety2/backend/tools/registry.py +161 -0
  60. agentsociety2/backend/tools/run_experiment.py +755 -0
  61. agentsociety2/backend/tools/run_shell_command.py +320 -0
  62. agentsociety2/backend/tools/write_todo.py +180 -0
  63. agentsociety2/code_executor/__init__.py +23 -0
  64. agentsociety2/code_executor/api.py +191 -0
  65. agentsociety2/code_executor/code_executor.py +96 -0
  66. agentsociety2/code_executor/code_generator.py +284 -0
  67. agentsociety2/code_executor/code_saver.py +88 -0
  68. agentsociety2/code_executor/dependency_detector.py +203 -0
  69. agentsociety2/code_executor/docker_runner.py +295 -0
  70. agentsociety2/code_executor/local_executor.py +145 -0
  71. agentsociety2/code_executor/models.py +130 -0
  72. agentsociety2/code_executor/path_config.py +167 -0
  73. agentsociety2/code_executor/runtime_config.py +118 -0
  74. agentsociety2/config/__init__.py +17 -0
  75. agentsociety2/config/config.py +673 -0
  76. agentsociety2/config/list_models.py +92 -0
  77. agentsociety2/contrib/__init__.py +0 -0
  78. agentsociety2/contrib/agent/__init__.py +19 -0
  79. agentsociety2/contrib/agent/commons_tragedy_agent.py +415 -0
  80. agentsociety2/contrib/agent/llm_donor_agent.py +610 -0
  81. agentsociety2/contrib/agent/prisoners_dilemma_agent.py +330 -0
  82. agentsociety2/contrib/agent/public_goods_agent.py +354 -0
  83. agentsociety2/contrib/agent/trust_game_agent.py +577 -0
  84. agentsociety2/contrib/agent/volunteer_dilemma_agent.py +372 -0
  85. agentsociety2/contrib/env/__init__.py +35 -0
  86. agentsociety2/contrib/env/commons_tragedy.py +355 -0
  87. agentsociety2/contrib/env/economy_space.py +359 -0
  88. agentsociety2/contrib/env/endowment_effect.py +273 -0
  89. agentsociety2/contrib/env/event_space.py +483 -0
  90. agentsociety2/contrib/env/global_information.py +100 -0
  91. agentsociety2/contrib/env/mobility_space/__init__.py +11 -0
  92. agentsociety2/contrib/env/mobility_space/download_sim.py +56 -0
  93. agentsociety2/contrib/env/mobility_space/environment.py +934 -0
  94. agentsociety2/contrib/env/mobility_space/map.py +933 -0
  95. agentsociety2/contrib/env/mobility_space/replay_tables.py +38 -0
  96. agentsociety2/contrib/env/mobility_space/utils/__init__.py +13 -0
  97. agentsociety2/contrib/env/mobility_space/utils/const.py +244 -0
  98. agentsociety2/contrib/env/mobility_space/utils/map_utils.py +154 -0
  99. agentsociety2/contrib/env/mobility_space/utils/port.py +54 -0
  100. agentsociety2/contrib/env/prisoners_dilemma.py +288 -0
  101. agentsociety2/contrib/env/public_goods.py +272 -0
  102. agentsociety2/contrib/env/reputation_game.py +823 -0
  103. agentsociety2/contrib/env/self_enhancement.py +290 -0
  104. agentsociety2/contrib/env/self_reference_effect.py +570 -0
  105. agentsociety2/contrib/env/simple_social_space.py +408 -0
  106. agentsociety2/contrib/env/social_media/__init__.py +18 -0
  107. agentsociety2/contrib/env/social_media/models.py +397 -0
  108. agentsociety2/contrib/env/social_media/recommend.py +301 -0
  109. agentsociety2/contrib/env/social_media/recommendation/README.md +719 -0
  110. agentsociety2/contrib/env/social_media/recommendation/__init__.py +36 -0
  111. agentsociety2/contrib/env/social_media/recommendation/algorithms/__init__.py +38 -0
  112. agentsociety2/contrib/env/social_media/recommendation/algorithms/core.py +248 -0
  113. agentsociety2/contrib/env/social_media/recommendation/algorithms/deepfm/__init__.py +12 -0
  114. agentsociety2/contrib/env/social_media/recommendation/algorithms/deepfm/config.py +49 -0
  115. agentsociety2/contrib/env/social_media/recommendation/algorithms/deepfm/model.py +431 -0
  116. agentsociety2/contrib/env/social_media/recommendation/algorithms/din/__init__.py +12 -0
  117. agentsociety2/contrib/env/social_media/recommendation/algorithms/din/config.py +53 -0
  118. agentsociety2/contrib/env/social_media/recommendation/algorithms/din/model.py +689 -0
  119. agentsociety2/contrib/env/social_media/recommendation/algorithms/lightgcn/__init__.py +12 -0
  120. agentsociety2/contrib/env/social_media/recommendation/algorithms/lightgcn/config.py +43 -0
  121. agentsociety2/contrib/env/social_media/recommendation/algorithms/lightgcn/model.py +435 -0
  122. agentsociety2/contrib/env/social_media/recommendation/algorithms/mf/__init__.py +15 -0
  123. agentsociety2/contrib/env/social_media/recommendation/algorithms/mf/config.py +34 -0
  124. agentsociety2/contrib/env/social_media/recommendation/algorithms/mf/enhanced_config.py +93 -0
  125. agentsociety2/contrib/env/social_media/recommendation/algorithms/mf/enhanced_model.py +427 -0
  126. agentsociety2/contrib/env/social_media/recommendation/algorithms/mf/model.py +335 -0
  127. agentsociety2/contrib/env/social_media/recommendation/algorithms/ncf/__init__.py +12 -0
  128. agentsociety2/contrib/env/social_media/recommendation/algorithms/ncf/config.py +45 -0
  129. agentsociety2/contrib/env/social_media/recommendation/algorithms/ncf/model.py +408 -0
  130. agentsociety2/contrib/env/social_media/recommendation/algorithms/sasrec/__init__.py +14 -0
  131. agentsociety2/contrib/env/social_media/recommendation/algorithms/sasrec/sasrec_algorithm.py +438 -0
  132. agentsociety2/contrib/env/social_media/recommendation/algorithms/sasrec/sasrec_config.py +119 -0
  133. agentsociety2/contrib/env/social_media/recommendation/algorithms/sasrec/sasrec_model.py +391 -0
  134. agentsociety2/contrib/env/social_media/recommendation/metrics.py +266 -0
  135. agentsociety2/contrib/env/social_media/recommendation/models.py +110 -0
  136. agentsociety2/contrib/env/social_media/recommendation/service.py +236 -0
  137. agentsociety2/contrib/env/social_media/recommendation/storage.py +173 -0
  138. agentsociety2/contrib/env/social_media/recommendation/trainer.py +229 -0
  139. agentsociety2/contrib/env/social_media/replay_tables.py +105 -0
  140. agentsociety2/contrib/env/social_media/schemas.py +144 -0
  141. agentsociety2/contrib/env/social_media/social_media_space.py +1974 -0
  142. agentsociety2/contrib/env/trust_game.py +471 -0
  143. agentsociety2/contrib/env/volunteer_dilemma.py +247 -0
  144. agentsociety2/custom/README.md +247 -0
  145. agentsociety2/custom/__init__.py +16 -0
  146. agentsociety2/custom/agents/__init__.py +23 -0
  147. agentsociety2/custom/agents/examples/advanced_agent.py +137 -0
  148. agentsociety2/custom/agents/examples/simple_agent.py +132 -0
  149. agentsociety2/custom/envs/__init__.py +23 -0
  150. agentsociety2/custom/envs/examples/advanced_env.py +164 -0
  151. agentsociety2/custom/envs/examples/simple_env.py +157 -0
  152. agentsociety2/designer/README_LITERATURE_SEARCH.md +139 -0
  153. agentsociety2/designer/__init__.py +46 -0
  154. agentsociety2/designer/agent_processing/__init__.py +28 -0
  155. agentsociety2/designer/agent_processing/agent_file_processor.py +429 -0
  156. agentsociety2/designer/agent_processing/agent_filter.py +876 -0
  157. agentsociety2/designer/agent_processing/agent_generator.py +420 -0
  158. agentsociety2/designer/agent_processing/agent_selector.py +439 -0
  159. agentsociety2/designer/agent_processing/agent_supplement_checker.py +141 -0
  160. agentsociety2/designer/agent_processing/field_metadata.py +87 -0
  161. agentsociety2/designer/agent_processing/utils.py +42 -0
  162. agentsociety2/designer/config_builder.py +678 -0
  163. agentsociety2/designer/exp_designer.py +1782 -0
  164. agentsociety2/designer/exp_executor.py +696 -0
  165. agentsociety2/designer/exp_pipeline.py +137 -0
  166. agentsociety2/designer/literature_search.py +739 -0
  167. agentsociety2/env/__init__.py +22 -0
  168. agentsociety2/env/base.py +460 -0
  169. agentsociety2/env/benchmark.py +11 -0
  170. agentsociety2/env/function_parser.py +339 -0
  171. agentsociety2/env/pydantic_collector.py +133 -0
  172. agentsociety2/env/router_base.py +1256 -0
  173. agentsociety2/env/router_codegen.py +1488 -0
  174. agentsociety2/env/router_plan_execute.py +602 -0
  175. agentsociety2/env/router_react.py +418 -0
  176. agentsociety2/env/router_search_tool.py +532 -0
  177. agentsociety2/env/router_two_tier_plan_execute.py +466 -0
  178. agentsociety2/env/router_two_tier_react.py +541 -0
  179. agentsociety2/logger/__init__.py +366 -0
  180. agentsociety2/mcp/README.md +513 -0
  181. agentsociety2/mcp/__init__.py +20 -0
  182. agentsociety2/mcp/models.py +82 -0
  183. agentsociety2/mcp/registry.py +75 -0
  184. agentsociety2/mcp/server.py +703 -0
  185. agentsociety2/society/__init__.py +27 -0
  186. agentsociety2/society/cli.py +554 -0
  187. agentsociety2/society/helper.py +852 -0
  188. agentsociety2/society/models.py +108 -0
  189. agentsociety2/society/society.py +253 -0
  190. agentsociety2/storage/__init__.py +28 -0
  191. agentsociety2/storage/models.py +46 -0
  192. agentsociety2/storage/replay_writer.py +285 -0
  193. agentsociety2/storage/table_schema.py +98 -0
  194. agentsociety2-2.0.0.dist-info/METADATA +427 -0
  195. agentsociety2-2.0.0.dist-info/RECORD +197 -0
  196. agentsociety2-2.0.0.dist-info/WHEEL +4 -0
  197. agentsociety2-2.0.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,40 @@
1
+ """
2
+ AgentSociety 2: A modern, LLM-native agent simulation platform.
3
+
4
+ This package provides tools for building and simulating LLM-driven agents
5
+ in various environments for social science research.
6
+ """
7
+
8
+ __version__ = "2.0.0"
9
+
10
+ # Import main components for easy access
11
+ from .agent import AgentBase, PersonAgent
12
+ from .env import (
13
+ EnvBase,
14
+ RouterBase,
15
+ ReActRouter,
16
+ PlanExecuteRouter,
17
+ CodeGenRouter,
18
+ TwoTierReActRouter,
19
+ TwoTierPlanExecuteRouter,
20
+ SearchToolRouter,
21
+ tool,
22
+ )
23
+ from .society import AgentSocietyHelper
24
+ from .storage import ReplayWriter
25
+
26
+ __all__ = [
27
+ "AgentBase",
28
+ "PersonAgent",
29
+ "EnvBase",
30
+ "RouterBase",
31
+ "ReActRouter",
32
+ "PlanExecuteRouter",
33
+ "CodeGenRouter",
34
+ "TwoTierReActRouter",
35
+ "TwoTierPlanExecuteRouter",
36
+ "SearchToolRouter",
37
+ "tool",
38
+ "AgentSocietyHelper",
39
+ "ReplayWriter",
40
+ ]
@@ -0,0 +1,4 @@
1
+ from .base import AgentBase, DIALOG_TYPE_REFLECTION
2
+ from .person import PersonAgent
3
+
4
+ __all__ = ["AgentBase", "DIALOG_TYPE_REFLECTION", "PersonAgent"]