Model Overview
| Model | Model ID | Context | Pricing |
|---|---|---|---|
| CharGLM-4 | charglm-4 |
8K | 1 yuan/million tokens |
| Emohaa | emohaa |
8K | 15 yuan/million tokens |
Selection Recommendations
- Role-playing/Virtual Human:
charglm-4— Character consistency, multi-turn memory - Psychological Counseling/Emotional Companionship:
emohaa— Professional listening, empathy
API Key Configuration
Load ~/.glm/.env from ZHIPU_API_KEY. Key acquisition:https://open.bigmodel.cn/usercenter/apikeys
CharGLM-4 Features
- Character consistency maintenance
- Multi-turn dialogue memory
- Diverse personality creation
- Emotional expression
- Streaming output
CharGLM-4 Invocation Example
from zai import ZhipuAI
client = ZhipuAI(api_key="your-key")
response = client.chat.completions.create(
model="charglm-4",
messages=[
{"role": "system", "content": "你是小雪,一个温柔体贴的邻家女孩"},
{"role": "user", "content": "今天心情不太好"}
],
stream=True
)
Emohaa Features
- Professional listening ability
- Emotional state recognition
- Empathetic responses
- Hill helping theory guidance
Emohaa Invocation Example
response = client.chat.completions.create(
model="emohaa",
messages=[{"role": "user", "content": "最近压力很大"}],
meta={
"user_info": "用户信息",
"bot_info": "助手信息",
"bot_name": "小助手",
"user_name": "用户"
}
)
API Endpoints
POST https://open.bigmodel.cn/api/paas/v4/chat/completions
Recommended Scenarios
- CharGLM-4: Emotional companionship, game NPCs, digital human livestreaming, virtual idols
- Emohaa: Emotional support, psychological counseling, stress management, relationship improvement