mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
18 lines
407 B
Python
18 lines
407 B
Python
import os
|
|
|
|
import requests
|
|
|
|
url = f"{os.getenv('FLOW_SERVER_URL', '')}/v1/responses"
|
|
|
|
headers = {
|
|
"x-api-key": f"{os.getenv('FLOW_API_KEY', '')}",
|
|
"Content-Type": "application/json",
|
|
}
|
|
|
|
payload = {"model": "$FLOW_ID", "input": "Tell me a story about a robot", "stream": True}
|
|
|
|
response = requests.request("POST", url, headers=headers, json=payload)
|
|
response.raise_for_status()
|
|
|
|
print(response.text)
|