# app.py — Streamlit UI for AutoReview AI import streamlit as st from main import review_pr_simple # ── PAGE CONFIG ─────────────────────────── st.set_page_config( page_title="AutoReview AI", page_icon="🤖", layout="centered" ) # ── TITLE ───────────────────────────────── st.title("🤖 AutoReview AI") st.markdown("*Autonomous GitHub PR Reviewer powered by LLaMA + Groq*") st.divider() # ── INPUT ───────────────────────────────── pr_url = st.text_input( "Enter GitHub PR URL", placeholder="https://github.com/owner/repo/pull/123" ) # ── BUTTON ──────────────────────────────── if st.button("🔍 Review PR", type="primary"): # check if URL is empty if not pr_url: st.warning("Please enter a PR URL first!") else: # show spinner while reviewing with st.spinner("🤖 Reviewing PR... this may take 30 seconds"): result = review_pr_simple(pr_url) # if success if result["success"]: st.success("✅ Review Complete!") st.divider() # show PR data st.subheader("📋 PR Summary") st.code(result["pr_data"][:500]) # show analysis st.subheader("🔍 Code Analysis") st.write(result["analysis"]) # show verdict st.subheader("✅ Final Verdict") st.write(result["verdict"]) # if failed else: st.error(f"❌ Failed: {result['error']}") # ── FOOTER ──────────────────────────────── st.divider() st.caption("Built with LangChain + Groq + Streamlit")