Install
openclaw skills install hiagent-bot-chat一个基于 hiagent 的智能助手技能,用于与 hiagent 进行对话。
openclaw skills install hiagent-bot-chat此技能旨在通过 hiagent-bot-chat 与 hiagent 进行对话,回答用户的问题。
hiagent-bot-chat 解决问题或进行对话时。hiagent-bot 主要通过调用 hiagent 的两个核心接口来实现:
create_conversion 接口:负责创建会话,通常用于在对话开始前初始化并获取会话的上下文 ID (Session ID)。chat_query_v2 接口:负责具体的对话交互,用于在已创建的会话中发送用户的输入并获取 hiagent 的回复。调用流程示例:
create_conversion 创建一个新的会话。chat_query_v2 接口并携带该会话标识进行对话。use get_conversation_list api to get conversation history list
curl --location '$HIAGENT_API_URL/get_conversation_list'
--header 'Apikey: $HIAGENT_API_KEY'
--header 'Content-Type: application/json'
--data '{
"UserID": "$HIAGENT_USER_ID"
}'
if you want to create a new conversation, you can use the create_conversation api
curl --location '$HIAGENT_API_URL/create_conversation'
--header 'Apikey: $HIAGENT_API_KEY'
--header 'Content-Type: application/json'
--data '{
"UserID": "$HIAGENT_USER_ID"
}'
use the AppConversationID returned from get_conversation_list or create_conversation
curl --location '$HIAGENT_API_URL/get_conversation_messages'
--header 'Apikey: $HIAGENT_API_KEY'
--header 'Content-Type: application/json'
--data '{
"AppConversationID": "$AppConversationID",
"UserID": "$HIAGENT_USER_ID"
}'
use the AppConversationID returned from get_conversation_list or create_conversation
curl --location '$HIAGENT_API_URL/chat_query_v2'
--header 'Apikey: $HIAGENT_API_KEY'
--header 'Content-Type: application/json'
--data '{
"ResponseMode": "blocking",
"AppConversationID": "$AppConversationID",
"UserID": "$HIAGENT_USER_ID",
"Query": "your query"
}'