Pythonスクリプト import requests import json def post_request(api_key): url = "http://localhost/v1/chat-messages" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", } data = json.dumps({ "inputs": {}, "query": "What are the specs of the iPhone 13 Pro Max?", "response_mode": "streaming", "conversation_id": "", "user": "abc-123", }) response = requests.post(url, headers
![「WSL2上で動いてるDify」と「Windows上のPython」とをAPI連携してみる - パソコン関連もろもろ](https://cdn-ak-scissors.b.st-hatena.com/image/square/0967afa8bf6012e629be525bc8637a376da83ca7/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Ft%2Ftouch-sp%2F20240526%2F20240526205805.jpg)