Spaces:
Running
Running
| from fastapi import FastAPI | |
| import gradio as gr | |
| from core.agent import generate_response | |
| app = FastAPI(title="Eroha AgentAPI v3.1 (Guru Edition)") | |
| def chat_interface(user_input): | |
| return generate_response(user_input) | |
| iface = gr.Interface( | |
| fn=chat_interface, | |
| inputs=gr.Textbox(lines=3, placeholder="Введите запрос..."), | |
| outputs="text", | |
| title="🤖 Eroha AgentAPI v3.1 — Guru Edition", | |
| description="Умный агент на базе Hugging Face Inference API" | |
| ) | |
| def health(): | |
| return {"status": "ok"} | |
| def index(): | |
| return {"message": "Eroha AgentAPI v3.1 — running!"} | |
| def generate(q: str): | |
| return {"result": generate_response(q)} | |
| if __name__ == "__main__": | |
| iface.launch(server_name="0.0.0.0", server_port=7860) | |