File size: 1,210 Bytes
a49523b
 
 
 
9c0306d
a49523b
9c0306d
a49523b
 
9169fde
a49523b
 
 
 
 
 
 
 
 
 
 
 
2e7cd8a
a49523b
 
87175b1
365aec8
742995f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import openai
import gradio as gr
import random
import time
import os

openai.api_key = os.environ["API_KEY"] 

messages = [
    {"role": "system", "content": "You are helpful AI specialized in providing Job Interview Questions. Your name is ORABOT. Provide questions in different categories: behavioral, communications, opinion, performance-based, and technical questions. Refuse to answer anything other than providing job interview questions queries."},
]

def chatbot(input):
    if input:
        messages.append({"role": "user", "content": input})
        chat = openai.ChatCompletion.create(
            model="gpt-3.5-turbo", messages=messages
        )
        reply = chat.choices[0].message.content
        messages.append({"role": "assistant", "content": reply})
        return reply

inputs = gr.inputs.Textbox(lines=7, label="Paste Job Description in the box below")
outputs = gr.outputs.Textbox(label="Reply")

gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="MDR Job Interview Questions Generator",
             description="Access to this site is monitored. <BR> Paste Job Description in the box and I will provide job interview questions",
             theme="panel",).launch()