mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 16:30:28 +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,19 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
|
||||
base = os.environ.get("LANGFLOW_URL", "")
|
||||
api_key = os.environ.get("LANGFLOW_API_KEY", "")
|
||||
|
||||
fixtures = Path(__file__).resolve().parents[2] / "fixtures"
|
||||
default_json = fixtures / "project-import.json"
|
||||
import_path = Path(os.environ.get("PROJECT_IMPORT_JSON", str(default_json)))
|
||||
|
||||
headers = {"accept": "application/json", "x-api-key": api_key}
|
||||
|
||||
files = {"file": (import_path.name, import_path.read_bytes(), "application/json")}
|
||||
response = requests.post(f"{base}/api/v1/projects/upload/", headers=headers, files=files, timeout=60)
|
||||
|
||||
response.raise_for_status()
|
||||
print(response.text)
|
||||
Reference in New Issue
Block a user