Agentic_GPT / app.py
AdamyaG's picture
Upload 3 files
1a1fd73 verified
raw
history blame
1.57 kB
import streamlit as st
from agent import multi_agent_framework
# Define the multi agent framework
model_id = "Qwen/Qwen2.5-Coder-32B-Instruct"
agent = multi_agent_framework(model_id)
# Function to log agent actions
def log_agent_action(prompt, result):
st.write(f"### Agent Activity")
st.write("**Prompt Sent to Agent:**")
st.code(prompt, language="text")
st.write("**Agent Output:**")
st.code(result, language="text")
# Streamlit app title
st.title("Multi Agent GPT")
# App description
st.write("Generate creative content, search the web and generate images enriched with the power of MultiAgent framework")
# Input blog topic or prompt
user_prompt = st.text_area("How may I help you?:", placeholder="E.g., Generate me a picture of cute puppy")
# Button to generate content
if st.button("Generate"):
if user_prompt:
with st.spinner("Generating content with our Multi agents"):
try:
# Run the agent with the given prompt
result = agent.run(user_prompt)
# Display the generated content
st.subheader("Generated Content:")
st.write(result)
# Log backend activity
log_agent_action(user_prompt, result)
except Exception as e:
st.error(f"An error occurred: {e}")
else:
st.warning("Please enter a prompt to proceed.")
# Footer
st.markdown("---")
st.caption("Powered by SmolAgents, DuckDuckGo, black-forest-labs and Streamlit")