CoolFace
Apppublic

PriyankaSG/PythonCodeReviewerGenAI

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
app.py20 linesDownload Raw Back to root
1import streamlit as st2import google.generativeai as ai3 4ai.configure(api_key="AIzaSyBbMEdqAlm4rs_1BQS8MHVBqBUtMTyZgV8")5 6sys_prompt = """You are an AI Code Reviewer specializing in Python programming. Your task is to analyze Python code, detect potential bugs, syntax errors, logical mistakes, inefficiencies, and best practice violations, and provide clear and actionable fixes with explanations."""7 8gemini_model = ai.GenerativeModel(model_name="models/gemini-1.5-pro", system_instruction=sys_prompt)9 10st.title("Python Code Reviewer")11 12user_input = st.text_area(label="Enter your query/issue", placeholder="Ask me about the datascience ")13 14btn_click = st.button("Click Me!")15 16if btn_click == True:17    response = gemini_model.generate_content(user_input)18    print("OUTPUT ON TERMINAL: ", len(response.text))19    st.write(response.text)20