Access and use of AI Baidu Wenxin Yiyan Big Language Model (Chinese version of ChatGPT)

1. Baidu Wenxin Yiyan API

The intelligent text dialogue AI robot API based on Baidu Wenxin Yiyan language model supports functions such as chat dialogue, industry consultation, language learning, and code writing.

2. Usage steps

1. Interface

Important note: It is recommended to use https protocol. When https protocol cannot be used, try to use http protocol.

Request method: POST

https://luckycola.com.cn/ai/openwxyy

2. Request parameters

serial number parameter Is it necessary illustrate
1 ques yes your problem
2 appKey yes The unique verification AppKey can be obtained by going to the "Personal Center" of the official website ( http(s): //luckycola.com.cn ). The following is a detailed description of how to obtain it.
3 uid yes Unique identifiers such as account numbers can be obtained by going to the "Personal Center" of the official website ( http(s): //luckycola.com.cn ). The following details how to obtain them.
4 isLongChat no Whether to support context (value is 1 or 0), 1 indicates that context is supported, and the default value of 0 is not supported.

Note!!!: If you don’t have appKey and uid yet, please go to the official website to get them first.
Official website address: http(s): //luckycola.com.cn/

3. Example of request parameters

{
    
    
   "ques": "hello",
   // 官网-个人中心-Appkey获取
   "appKey": "643************c3",
   // 官网-个人中心-用户ID
   "uid": "y*************6",
   // 是否支持上下文 值1表示支持,0表示不支持
   "isLongChat": 0
}

4. Interface return example

{
    
    
	// 	成功状态码
	"code": 0,
	// 	成功提示
	"msg": "AI接口返回成功",
	"data": {
    
    
		// 	AI回答结果
		"result": "您好,您似乎输入了一个文本字符串。如果您需要帮助或有任何问题,请随时告诉我,我将竭诚为您服务。",
		"countMsg": "无穷",
		// 当前是否是上下文对话模式,1表示是上下文模式,0为非上下文模式
		"longChat": 0
	}
}

3. How to obtain appKey and uid

1. Apply for appKey:

Log in to Luckycola's official website ( http(s): //luckycola.com.cn ) and enter "[ Personal Center ]" to apply.
Insert image description here

2. Get appKey and uid

After the AppKey application is approved, log in to the Luckycola official website ( http(s): //luckycola.com.cn ) and enter "[ Personal Center ]" to obtain it.
Insert image description here

4. Important instructions

Important note: Your AppKey and uid are important information, please be sure to keep them properly to avoid leakage!

Important note: Your AppKey and uid are important information, please be sure to keep them properly to avoid leakage!

Important note: Your AppKey and uid are important information, please be sure to keep them properly to avoid leakage!

Guess you like

Origin blog.csdn.net/qq_48896417/article/details/132309676