API - 语义客户端

../_images/client.ico

Chat client. 聊天客户端。

Available functions: - question_pack: Package the question as the JSON format specified by the server. 将问题打包为服务器指定的json格式。 - config_pack: Package the config info as the JSON format specified by the server. 将配置信息打包为服务器指定的json格式。 - match:Match the answers from the semantic knowledge database. 从语义知识数据库搜索答案。 - config:Configure the semantic knowledge database. 配置语义知识数据库。

question_pack([info, userid]) Package the question as the JSON format specified by the server.
config_pack([info, userid]) Package the config info as the JSON format specified by the server.
match([question, userid]) Match the answers from the semantic knowledge database.
config([info, userid]) Configure the semantic knowledge database.

封装问题

chat.client.question_pack(info='', userid='userid')[source]

Package the question as the JSON format specified by the server. 将问题打包为服务器指定的json格式。

Args:
info: User question. 用户的聊天或提问。
Defaults to “”.
userid: User id. 用户唯一标识。
Defaults to “userid”.
Returns:
Packaged JSON format data. 打包好的json格式数据。

封装配置

chat.client.config_pack(info='', userid='userid')[source]

Package the config info as the JSON format specified by the server. 将配置信息打包为服务器指定的json格式。

Args:
info: User config info. 用户配置信息。
Defaults to “”.
userid: User id. 用户唯一标识。
Defaults to “userid”.
Returns:
Packaged JSON format data. 打包好的json格式数据。

搜索答案

chat.client.match(question='question', userid='userid')[source]

Match the answers from the semantic knowledge database. 从语义知识数据库搜索答案。

Args:
question: User question. 用户问题。
Defaults to “question”.
userid: User id. 用户唯一标识。
Defaults to “userid”.
Returns:
Packaged JSON format data of answer. 打包好的答案json格式数据。

配置语义知识库

chat.client.config(info='', userid='userid')[source]

Configure the semantic knowledge database. 配置语义知识数据库。

Args:
info: User config info. 用户配置信息,以空格分隔的知识库名称字符串。
Defaults to “”. 返回可配置选项信息。
userid: User id. 用户唯一标识。
Defaults to “userid”.
Returns:
Packaged JSON format data of config result. 打包好的配置结果json格式数据。