import requests import json url = 'http://127.0.0.1:8000' headers = { 'Content-Type': 'application/json' } data = { 'prompt': '你好', 'history': [] } response = requests.post(url=url, headers=headers, data=json.dumps(data)) print(response.json())