eroha-agentapi / app.py
Yermek68's picture
Update app.py
8f26786 verified
raw
history blame
829 Bytes
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"
)
@app.get("/health")
def health():
return {"status": "ok"}
@app.get("/")
def index():
return {"message": "Eroha AgentAPI v3.1 — running!"}
@app.get("/generate")
def generate(q: str):
return {"result": generate_response(q)}
if __name__ == "__main__":
iface.launch(server_name="0.0.0.0", server_port=7860)