| |
| from fastapi import FastAPI, Query |
| from fastapi.responses import HTMLResponse |
| from agenticcore.chatbot.services import ChatBot |
|
|
| app = FastAPI(title="AgenticCore Web UI") |
|
|
| |
| @app.get("/", response_class=HTMLResponse) |
| def index(): |
| return """ |
| <form action="/agentic" method="get"> |
| <input type="text" name="msg" placeholder="Type a message" style="width:300px"> |
| <input type="submit" value="Send"> |
| </form> |
| """ |
|
|
| |
| @app.get("/agentic") |
| def run_agentic(msg: str = Query(..., description="Message to send to ChatBot")): |
| bot = ChatBot() |
| return bot.reply(msg) |
|
|