角色描述自动生成
更新时间:
HTTP接口
shell
curl --location 'https://nlp.aliyuncs.com/v2/api/character/auto/desc' \
--header 'Expect;' \
--header 'accept: */*' \
--header 'Content-Type: application/json' \
--header 'x-fag-servicename: aca-char-auto-desc' \
--header 'x-fag-appcode: aca' \
--header 'Authorization: Bearer your-api-key' \
--data '{
"type": "file",
"fileUrl":"https://lang.alicdn.com/xingchen/guanyu.txt",
"fileName":"test.txt"
}'
python
import json
import requests
api_key = "your-api-key"
service_name = "aca-chat-reminder"
url = "https://nlp.aliyuncs.com/v2/api/character/auto/desc"
headers = {
"Content-Type": "application/json",
"x-fag-servicename": "aca-char-auto-desc",
"x-fag-appcode": "aca",
"Authorization": f"Bearer {api_key}"
}
payload = {
"type": "file",
"fileUrl":"https://lang.alicdn.com/xingchen/guanyu.txt",
"fileName":"test.txt"
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(json.loads(response.text))
文档内容是否对您有帮助?