🤖 AI聊天系统 v2.0

人设管理版 - 支持自定义人设配置

创建和管理多个人设,每个对话都可以选择不同的人设回复

👤 选择人设

📝 消息记录测试

📊 测试结果

👆 请先选择人设并输入消息进行测试

👥 人设管理

正在加载人设列表...

📚 API文档

带人设的聊天接口

POST /api/chat/with_persona
Content-Type: application/json

{
    "persona_id": "elisa",
    "message_history": [
        {"role": "assistant", "content": "Hello~?? Do you speak English?"},
        {"role": "assistant", "content": "Yes I can see you do"}
    ]
}

简单聊天接口(带人设参数)

POST /api/chat/simple
Content-Type: application/json

{
    "persona_id": "elisa",
    "message_history": [...],
    "persona_mode": "friend"  // 可选:friend, assistant, funny, romantic, professional
}

管理人设API

# 获取所有人设
GET /api/personas/all

# 获取特定人设
GET /api/persona/

# 创建/更新人设
POST /api/persona
Content-Type: application/json

{
    "persona_id": "elisa_001",
    "name": "Elisa",
    "age": 34,
    "location": "New York, USA",
    "languages": ["English", "Spanish", "French"],
    "occupation": "Marketing Manager",
    "personality": "Friendly, outgoing, creative",
    "interests": ["Traveling", "Photography", "Yoga"],
    "education": "MBA from Columbia University"
}

# 删除人设
DELETE /api/persona/

快速测试命令

# 使用Elisa人设测试
curl -X POST http://localhost:5000/api/chat/with_persona \
  -H "Content-Type: application/json" \
  -d '{
    "persona_id": "elisa",
    "message_history": [
        {"role": "assistant", "content": "Hello~?? Do you speak English?"},
        {"role": "assistant", "content": "Yes I can see you do"}
    ]
}'

📊 系统状态

Python版本 3.12.3
服务状态 ✅ 运行中
运行时长 41398 秒
API配置 ✅ 已配置

🗄️ 数据库状态

正在检查数据库状态...