/
medmikhr
/
LangFlow_API_bot
Обзор
Документация
Войти
/
medmikhr
/
LangFlow_API_bot
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
langflow/LLM_api.py
28 строк
726 B
DAnaKhristenko
Initial project import
29 ноя 2025, 15:11
29 ноя 2025, 15:11
d536271
Код
Авторство
О чём код?
import requests import os import uuid url = "http://localhost:7860/api/v1/run/636ace02-9e8c-457e-a992-765277bdf9d2" # The complete API endpoint URL for this flow # Request payload configuration payload = { "output_type": "chat", "input_type": "chat", "input_value": "hello world!" } payload["session_id"] = str(uuid.uuid4()) try: # Send API request response = requests.request("POST", url, json=payload, headers=headers) response.raise_for_status() # Raise exception for bad status codes # Print response print(response.text) except requests.exceptions.RequestException as e: print(f"Error making API request: {e}") except ValueError as e: print(f"Error parsing response: {e}")