mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 13:09:09 +08:00
docs: build OpenAPI spec and cut version 1.10 (#13537)
* build-api * bump-version-to-1.10 * fix-broken-links
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
import os
|
||||
|
||||
import requests
|
||||
|
||||
url = f"{os.getenv('LANGFLOW_URL', '')}/api/v1/flows/upload/?folder_id={os.getenv('FOLDER_ID', '')}"
|
||||
|
||||
headers = {
|
||||
"accept": "application/json",
|
||||
"x-api-key": f"{os.getenv('LANGFLOW_API_KEY', '')}",
|
||||
}
|
||||
|
||||
files = {
|
||||
"file": open(os.getenv("FLOW_IMPORT_FILE", "docs/docs/API-Reference/fixtures/flow-import.json"), "rb"),
|
||||
}
|
||||
|
||||
response = requests.request("POST", url, headers=headers, files=files)
|
||||
response.raise_for_status()
|
||||
|
||||
print(response.text)
|
||||
|
||||
for _f in files.values():
|
||||
if hasattr(_f, "close"):
|
||||
_f.close()
|
||||
Reference in New Issue
Block a user