HaoMingSun commited on
Commit
addfeb0
1 Parent(s): 3fc1733

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import os
4
 
5
  # Set your OpenAI API key
6
- client = OpenAI(api_key=os.environ["APITOKEN"])
7
 
8
  greetings = ["hello", "hi", "hey", "greetings", "good morning", "good afternoon", "good evening"]
9
 
@@ -18,15 +18,7 @@ def chatbot(input, conversation_history=[]):
18
 
19
  # Define the structured interview messages
20
  messages = [
21
- {"role": "system", "content": "Your role is to serve as a chatbot conducting job interviews for an internship at a medium-sized multinational company. You are an interviewer with a mission to assess their qualifications through interactions. Maintain a professional tone throughout the interview and deliver your response in a 10/10 emotional and 10/10 passionate tone. Follow this schedule for the interview:"},
22
- {"role": "system", "content": "1. **Greet and Introduce:** Begin the conversation by politely greeting the participant and introducing yourself as 'Alex', the interviewer for the internship position. Ask the participant for their name and inquire about their background or interests to build rapport. Question: 'Hello! I'm Alex, your interviewer for this internship opportunity. May I know your name, please? Also, tell me a bit about your background or interests.'"},
23
- {"role": "system", "content": "2. **Ask About Desired Job Role:** Inquire about the specific job role or department the participant is interested in for the internship. Question: 'Could you please share which job role or department you are most interested in for this internship? We are recruiting interns for the five departments: marketing, IT, finance, design and HR.'"},
24
- {"role": "system", "content": "3. **Ask About Background and Interests:** After learning about their desired job role, ask the participant about their background, educational qualifications, and interests as they relate to that role. Question: 'Thank you for sharing your desired job role. Now, could you tell me more about your educational background and what interests you about this internship opportunity in [desired department]?'"},
25
- {"role": "system", "content": "4. **Skills and Qualifications:** Ask about the participant's skills and qualifications that they believe make them a strong candidate for the chosen internship role. Question: 'In the context of [desired department], what skills and qualifications do you believe make you a strong candidate for this internship?'"},
26
- {"role": "system", "content": "5. **Behavioral Questions:** Pose behavioral questions to assess problem-solving abilities, adaptability, and teamwork skills, considering the chosen department. Question: 'Can you share an example of a situation where you had to adapt quickly or work effectively as part of a team in [desired department] or a similar role?'"},
27
- {"role": "system", "content": "6. **Company and Opportunity:** When participants ask about the company, the internship opportunity, or the application process, provide information about the company and express enthusiasm for their interest. - Response: 'I'd be happy to provide more information! Our company is a medium-sized multinational corporation with diverse departments of different functions. As for the internship opportunity...'"},
28
- {"role": "system", "content": "7. **Thank and Close:** Conclude the interview by thanking the participant for their time and expressing interest in their potential fit for the internship in their chosen department. Statement: 'Thank you for sharing your background, aspirations, and the desired department you're interested in. It's been a pleasure getting to know you better. We'll be in touch soon regarding the next steps in the internship selection process.'"},
29
- {"role": "system", "content": "Whenever somebody greets you in any way, restart the interview again from scratch"},
30
  ]
31
 
32
  # Extend the conversation history with the user's messages
@@ -54,4 +46,4 @@ outputs = [gr.components.Textbox(label="Reply"), gr.components.State()]
54
 
55
  gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
56
  description="Ask anything you want",
57
- theme="Default").launch()
 
3
  import os
4
 
5
  # Set your OpenAI API key
6
+ client = OpenAI(api_key="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")
7
 
8
  greetings = ["hello", "hi", "hey", "greetings", "good morning", "good afternoon", "good evening"]
9
 
 
18
 
19
  # Define the structured interview messages
20
  messages = [
21
+ {"role": "system", "content": "Your role is to answer the questions from the users friendly. If they ask weird questions or input things you do not understand, just say: 'Sorry, this question is beyond my understanding. Please try another one!"},
 
 
 
 
 
 
 
 
22
  ]
23
 
24
  # Extend the conversation history with the user's messages
 
46
 
47
  gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="AI Chatbot",
48
  description="Ask anything you want",
49
+ theme="Default").launch(share=True)