Pythia-6.9B
开发环境
开发环境
POST
https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/completions/{申请发布时填写的API地址}
创建completion
请求示例(流式)
响应示例(流式)
data: {"id":"as-9092ws9jgh","object":"completion","created":1693811126,"sentence_id":0,"is_end":false,"result":", China.\nBeijing is the capital city of China and is located in the northern part of the country. It is the largest city in China and is known for its modern architecture, cultural heritage, and historical significance. The city is home to many famous landmarks, such as the Forbidden City, Tiananmen Square","is_safe":1,"usage":{"prompt_tokens":5,"completion_tokens":67,"total_tokens":72}}
data: {"id":"as-9092ws9jgh","object":"completion","created":1693811128,"sentence_id":1,"is_end":true,"result":", and the Great Wall of China. It is also known for its vibrant nightlife, delicious food, and stunning scenery.","is_safe":1,"usage":{"prompt_tokens":5,"completion_tokens":24,"total_tokens":96}}
错误码
名称 | 描述 |
---|---|
error_code | 错误码 |
error_msg | 错误描述信息,帮助理解和解决发生的错误 |
{
"error_code": 110,
"error_msg": "Access token invalid or no longer valid"
}
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/completions/?members&reference&Type&_postman_listIndexKey=key&_postman_listAllowsMultipleValues' \
--data-raw ''
响应示例响应示例
{
"id": "as-rq3wwusja8",
"object": "completion",
"created": 1693811110,
"result": " China.\nBeijing is the capital city of China and is located in the northern part of the country. It is the largest city in China and is known for its modern architecture, cultural heritage, and historical significance. The city is home to many famous landmarks, such as the Forbidden City, Tiananmen Square, and the Great Wall of China. It is also known for its vibrant nightlife, delicious food, and stunning scenery.",
"is_safe": 1,
"usage": {
"prompt_tokens": 5,
"completion_tokens": 92,
"total_tokens": 97
}
}
请求参数
Path 参数
申请发布时填写的API地址
string
必需
Query 参数
access_token
string
必需
Body 参数application/json
返回响应
修改于 2023-11-16 02:27:57