- 在线调用-使用说明
- 基础模型
- 大语言模型 LLM
- 语音识别 ASR
- 语音合成 TTS
- 图片生成 Images Generations
- 视频合成 Video Generations
- RAG模型
- 音色处理 voice processing
- 图生图 Image to Image
- 智能体
- 对话数据
ChatBot 智能体V3(socket)
开发中
POST
流程图示意#
链接socket + 认证#
建立websocket链接
ApiKey认证
DeviceToken认证
智能体 chat_bot_v3#
初始创建
停止语音上传
终止流体返回数据
socket 返回示例说明#
情感输出示例
{
"socket_type": "agent_event",
"socket_message": "request_completed",
"socket_status": 1003,
"event_name": "agent_action",
"agent_output": {
"output_type": "emotion",
"emotion_output": "happy"
},
"agent_name": "chat_bot_v3"
}
chat_bot_v3
完成了一次请求,事件为agent_action
,输出类型为情感,识别到的情感为“happy”。LLM输出示例
TTS输出示例
智能体停止示例
请求参数
Header 参数
Authorization
string
必需
示例值:
Bearer {{api_key}}
Body 参数application/json
agent_name
enum<string>
调用智能体名称
枚举值:
chat_bot_v3
默认值:
chat_bot_v3
示例值:
chat_bot_v3
mode
enum<string>
必需
1.
2.
3.
4.
5.
枚举值:
prostandardcustomize
默认值:
pro
character_uuid
string
可选
示例值:
mc20250326a54kf
profile_uuid
string
可选
示例值:
mc20250327a58srl
emotion_output
boolean
是否启动识别情绪
upload_format
enum<string>
语音识别格式
枚举值:
pcmwavopusspeexaacamr
默认值:
pcm
示例值:
pcm
upload_sample_rate
enum<integer>
语音识别采样率
枚举值:
800016000
默认值:
16000
voice_id
string
必需
若是调用character_uuid则此字段无效,自动选择character_uuid中的音色
机器人的语音音色。对应的音色请参考TTS 音色列表 示例值:female-tianmei 默认值:female-tianmei
示例值:
cute_boy
speed
number
可选
默认值:
0
示例值:
0
user_name
string
可选
默认值:
user_name
示例值:
小明
user_age
integer
用户年龄设置
默认值:
5
示例值:
5
bot_name
string
可选
默认值:
智酱
示例值:
智酱
bot_character_description
string
可选
示例值:
智酱是一个彩色史莱姆生物。这是一个搞笑的魔法生物,充满活力,喜欢探索新事物,喜欢帮助小朋友学习。
bot_personality
string
可选
默认值:
活泼,好奇,乐观,善良
示例值:
活泼,好奇,乐观,善良
bot_tone
string
可选
示例值:
用拟人和口语化的方式回答用户,说话习惯附带emoji表情。
llm_model
enum<string>
LLM 大语言模型
枚举值:
GLM-4-AirDoubao-1.5-lite-32kabab6.5s-chat
默认值:
abab6.5s-chat
示例值:
abab6.5s-chat
max_tokens
integer
可选
>= 20<= 8000
默认值:
100
示例值:
100
tts_model
enum<string>
可选
枚举值:
TX_TTSP_realtimeTX_TTSL_realtimeMM_TTSL_realtime_speech-01-turboZJ_TTSL_realtimeALI_TTSL_realtime_cosyvoice-v1XF_TTS_realtimeBD_TTS_realtime_zh
默认值:
TX_TTSP_realtime
示例值:
MM_TTSL_realtime_speech-01-turbo
session_token
string
可选
session 获取对话列表
session 创建新对话
示例值:
0886a1f1-cd25-445a-9f3a-767032da9b84
language
enum<string>
可选
枚举值:
autozhenjayueko
默认值:
auto
示例值:
auto
示例
{
"agent_name": "chat_bot_v3",
"mode": "customize",
"profile_uuid": "mc20250327a58srl",
"character_uuid": "mc20250326a54kf",
"tts_model": "MM_TTSL_realtime_speech-01-turbo",
"speed": 0,
"max_tokens": 100,
"emotion_output": true,
"session_token": "0886a1f1-cd25-445a-9f3a-767032da9b84",
"upload_format": "pcm",
"upload_sample_rate": 16000,
"language": "auto"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mindcraft.com.cn' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"agent_name": "chat_bot_v3",
"mode": "customize",
"profile_uuid": "mc20250327a58srl",
"character_uuid": "mc20250326a54kf",
"tts_model": "MM_TTSL_realtime_speech-01-turbo",
"speed": 0,
"max_tokens": 100,
"emotion_output": true,
"session_token": "0886a1f1-cd25-445a-9f3a-767032da9b84",
"upload_format": "pcm",
"upload_sample_rate": 16000,
"language": "auto"
}'
返回响应
🟢200对话聊天数据
text/plain
Body
object {0}
示例
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "emotion", "emotion_output": "happy"}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "llm", "asr_content": "你好啊", "llm_response": "林小宅你好呀!", "z_index": 0}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "llm", "asr_content": "你好啊", "llm_response": "(*^▽^*) 今天过得怎么样呢?", "z_index": 1}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "llm", "asr_content": "你好啊", "llm_response": "我刚刚发现了一部超好看的热血动漫,想不想知道是哪一部?", "z_index": 2}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "tts", "audio_seconds": 1.26, "tts_audio": "https://api.mindcraft.com.cn/v1/data/get_stream_tts/4a312ef1f4b7422bb6e88ba034132c0c.mp3", "z_index": 0}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "tts", "audio_seconds": 2.13, "tts_audio": "https://api.mindcraft.com.cn/static/agent/4a312ef1f4b7422bb6e88ba034132c0c/2.mp3", "z_index": 1}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "request_completed", "socket_status": 1003, "event_name": "agent_action", "agent_output": {"output_type": "tts", "audio_seconds": 4.47, "tts_audio": "https://api.mindcraft.com.cn/static/agent/4a312ef1f4b7422bb6e88ba034132c0c/3.mp3", "z_index": 2}, "agent_name": "chat_bot_v3"}
{"socket_type": "agent_event", "socket_message": "agent_stop", "socket_status": 1006, "event_name": "agent_action", "agent_name": "chat_bot_v3"}
修改于 2025-04-25 02:22:02