Skip to content

module not found #134959

Closed as not planned
Closed as not planned
@sandhyasneha

Description

@sandhyasneha

Bug report

Bug description:

# Add a code block here, if required
```import os
import streamlit as st
import openai

# Load OpenAI API key from environment
openai.api_key = os.getenv("OPENAI_API_KEY")

# UI setup
st.set_page_config(page_title="IT Project Planner", page_icon="🛠️")
st.title("🛠️ IT Project Planner")

# Input area
user_input = st.text_area("Describe your project:")

# Generate plan
if st.button("Generate Plan") and user_input:
    with st.spinner("Generating plan..."):
        try:
            response = openai.ChatCompletion.create(
                model="gpt-3.5-turbo",
                messages=[
                    {"role": "system", "content": "You are an expert IT project manager."},
                    {"role": "user", "content": user_input}
                ],
                max_tokens=800
            )
            plan = response.choices[0].message.content
            st.markdown(plan)
        except Exception as e:
            st.error(f"Error: {e}")



### CPython versions tested on:

3.11

### Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions