阿里云百炼有http调用的示例吗?java或者python或者 js都可以。
import requests
url = 'https://dashscope.aliyuncs.com/compatible-mode/v1/files'api_key = ''file_path = './test.txt'
headers = {'Authorization': f'Bearer {api_key}',}
with open(file_path, 'rb') as file:files = {'file': ('test.txt', file),'purpose': ('', 'file-extract'),}
response = requests.post(url, headers=headers, files=files)
赞0
踩0