DyadSim 是一个基于自然语言处理技术的虚拟人物对话平台,旨在模拟具有不同性格特质和依恋类型的虚拟角色在各种冲突场景下的对话互动。平台包含两种主要模式:模拟对话模式和干预实验模式。
DyadSim is a virtual character dialogue platform based on natural language processing technology. It aims to simulate dialogue interactions between virtual characters with different personality traits and attachment styles in various conflict scenarios. The platform includes two main modes: Dialogue Simulation Mode and Intervention Experiment Mode.
- 与虚拟角色进行一对一对话 | Engage in one-on-one conversations with virtual characters
- 观察角色在冲突情境中的情绪变化 | Observe emotional changes of characters in conflict situations
- 了解不同性格特质和依恋类型的反应模式 | Learn about reaction patterns of different personality traits and attachment styles
- 查看角色详细信息,帮助理解其行为动机 | View detailed character information to help understand their behavioral motivations
- 设计和执行干预实验 | Design and implement intervention experiments
- 观察不同干预方式对角色情绪和对话内容的影响 | Observe the effects of different intervention methods on character emotions and dialogue content
- 记录和分析实验结果 | Record and analyze experimental results
- 比较不同干预策略的效果 | Compare the effectiveness of different intervention strategies
DyadSim 为以下领域提供了有价值的工具和资源:
DyadSim provides valuable tools and resources for the following fields:
- 为心理学研究提供可控的实验环境 | Provide controlled experimental environments for psychological research
- 研究不同性格特质和依恋类型在冲突场景中的表现 | Study the performance of different personality traits and attachment styles in conflict scenarios
- 探索有效的沟通和干预策略 | Explore effective communication and intervention strategies
- 收集大量结构化数据用于分析 | Collect large amounts of structured data for analysis
- 培训心理咨询师和治疗师的沟通技巧 | Train communication skills for psychologists and therapists
- 为社会工作者提供模拟练习环境 | Provide simulation practice environments for social workers
- 帮助学生理解人际冲突动态 | Help students understand interpersonal conflict dynamics
- 提供安全的环境练习困难对话 | Offer safe environments to practice difficult conversations
- 改进人工智能对话系统的情感智能 | Improve emotional intelligence in AI dialogue systems
- 支持开发更自然的虚拟助手和数字人类 | Support the development of more natural virtual assistants and digital humans
- 为关系咨询提供工具和见解 | Provide tools and insights for relationship counseling
- 帮助个人提高沟通和冲突解决能力 | Help individuals improve communication and conflict resolution skills
- Python 3.8 或更高版本 | Python 3.8 or higher
- Node.js 14 或更高版本 | Node.js 14 or higher
- 网络连接(用于下载依赖)| Internet connection (for downloading dependencies)
# 打开命令行终端 | Open command line terminal
# 克隆代码仓库 | Clone the repository
git clone https://github.com/
# 进入项目文件夹 | Enter the project folder
cd DyadSim# 创建并激活虚拟环境(推荐但非必须)| Create and activate virtual environment (recommended but optional)
python -m venv venv
# Windows激活 | Windows activation
venv\Scripts\activate
# Linux/Mac激活 | Linux/Mac activation
source venv/bin/activate
# 安装Python依赖 | Install Python dependencies
pip install -r requirements.txt
# 配置API密钥(如果需要)| Configure API keys (if needed)
# 复制示例配置文件 | Copy example config file
cp config.example.py config.py
# 用文本编辑器打开config.py并添加你的API密钥 | Open config.py with a text editor and add your API keys# 进入前端目录 | Enter frontend directory
cd dashboard
# 安装Node.js依赖 | Install Node.js dependencies
npm install# 分别在两个终端窗口中运行后端和前端 | Run backend and frontend in two separate terminal windows
# 终端1:启动后端 | Terminal 1: Start backend
# 确保你在项目根目录 | Make sure you are in the project root directory
python run_api_server.py
# 终端2:启动前端 | Terminal 2: Start frontend
# 进入前端目录 | Enter frontend directory
cd dashboard
npm run dev- 打开浏览器访问 http://localhost:5000
- Open your browser and visit http://localhost:5000
# 确保安装了所有依赖 | Make sure all dependencies are installed
pip install -r requirements.txt
cd dashboard && npm install# 找到并关闭占用端口的进程,或者修改配置文件中的端口 | Find and close the process using the port, or modify the port in the config file
# Windows
netstat -ano | findstr :5000
taskkill /PID <进程ID> /F
# Linux/Mac
lsof -i :5000
kill -9 <进程ID>- 检查后端服务是否正在运行 | Check if the backend service is running
- 确认API密钥是否正确配置 | Verify if API keys are properly configured
- 检查网络连接是否正常 | Check if network connection is working properly
DyadSim/
├── api/ # 后端API服务 | Backend API services
│ ├── data/ # 数据模型和存储 | Data models and storage
│ ├── llm/ # 语言模型集成 | Language model integration
│ └── utils/ # 工具函数 | Utility functions
├── dashboard/ # 前端应用 | Frontend application
│ ├── public/ # 静态资源 | Static assets
│ └── src/ # 源代码 | Source code
│ ├── components/ # React组件 | React components
│ ├── pages/ # 页面组件 | Page components
│ ├── styles/ # CSS样式 | CSS styles
│ └── utils/ # 工具函数 | Utility functions
├── docs/ # 文档 | Documentation
├── requirements.txt # Python依赖 | Python dependencies
└── run_api_server.py # 后端服务启动脚本 | Backend server startup script
欢迎对DyadSim项目进行贡献!如果你有任何建议、问题或想法,请随时提出。
Contributions to the DyadSim project are welcome! If you have any suggestions, issues, or ideas, please feel free to share them.
本项目采用MIT许可证。详情请参阅LICENSE文件。
This project is licensed under the MIT License. See the LICENSE file for details.





