import streamlit as st #from langchain.llms import OpenAI from langchain_community.llms import OpenAI st.title("🔗 Test Creator") def test_creator(topic): # Enhanced prompt with additional context for better post generation prompt = ( f" Develop a test to identify the modules you need to learn to become a {topic} developer." "The test should assess your understanding and proficiency in these areas to provide guidance on which modules to focus on for further learning in {topic} development." ) llm = OpenAI(temperature=0.7, openai_api_key=st.secrets["OPENAI_API_KEY"]) response = llm(prompt) return response with st.form("my_form"): topic = st.text_area("Enter the Technology you want to test.") submitted = st.form_submit_button("Generate Test") if submitted and topic: post = test_creator(topic) st.info(post) elif submitted and not topic: st.error("Please enter a technology to generate test.")