import openai
import gradio as gr
class JobDescription():
def __init__(self):
# Set up your OpenAI API credentials
openai.api_key = os.getenv("OPENAI_API_KEY")
def generate_job_description(self, role, experience):
# Generate a response from the GPT-3 model
prompt = f"""Your task is generate Job description for this {role} with {experience} years of experience.
Job Description Must have
1. Job Title
2. Job Summary : [200 words]
3. Responsibilities : Five Responsibilities in five lines
4. Required Skills : Six Skills
5. Qualifications
These topics must have in that Generated Job Description.
"""
response = openai.Completion.create(
engine='text-davinci-003', # Choose the GPT-3 engine you want to use
prompt=prompt,
max_tokens=500, # Set the maximum number of tokens in the generated response
temperature=0.5, # Controls the randomness of the output. Higher values = more random, lower values = more focused
)
# Extract the generated text from the API response
generated_text = response.choices[0].text.strip()
return generated_text
def gradio_interface(self):
with gr.Blocks(css="style.css",theme=gr.themes.Soft()) as app:
gr.HTML("""
""")
with gr.Row(elem_id="col-container"):
with gr.Column():
gr.HTML("
")
gr.HTML(
"""