KautilyaUtkarsh commited on
Commit
3007e3d
1 Parent(s): 7f98535

Upload 10 files

Browse files
Files changed (10) hide show
  1. .gitignore +160 -0
  2. Homepage.py +199 -0
  3. LICENSE +21 -0
  4. README.md +78 -2
  5. app_utils.py +23 -0
  6. azure-pipelines.yml +36 -0
  7. icon.png +0 -0
  8. initialization.py +96 -0
  9. packages.txt +2 -0
  10. requirements.txt +16 -0
.gitignore ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
Homepage.py ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from streamlit_option_menu import option_menu
3
+ from app_utils import switch_page
4
+ #import streamlit as st
5
+ from PIL import Image
6
+
7
+ im = Image.open("icon.png")
8
+ st.set_page_config(page_title = "AI Podcast Interviewer", layout = "centered",page_icon=im)
9
+
10
+ lan = st.selectbox("#### Language", ["English", "Comming Soon!"])
11
+
12
+ if lan == "English":
13
+ home_title = "AI Podcast Interviewer"
14
+ home_introduction = "Welcome to intelligent Podcast Interviewer, empowering your Podcaste with generative AI."
15
+ with st.sidebar:
16
+ st.markdown('AI Podcaste Interviewer - V0.1.2')
17
+ st.markdown("""
18
+ #### Let's contact:
19
+ [Kautilya Utkarsh](https://www.linkedin.com/in/kautilya-utkarsh-mishra-187818265/)
20
+
21
+ [At C# Corner ](https://www.c-sharpcorner.com/members/kautilya-utkarsh)
22
+
23
+
24
+ #### Product of
25
+
26
+ [CSharp Corner](https://www.c-sharpcorner.com/)
27
+
28
+
29
+ #### Powered by
30
+
31
+ [OpenAI](https://openai.com/)
32
+
33
+ [Langchain](https://github.com/hwchase17/langchain)
34
+
35
+ """)
36
+ st.markdown(
37
+ "<style>#MainMenu{visibility:hidden;}</style>",
38
+ unsafe_allow_html=True
39
+ )
40
+ st.image(im, width=100)
41
+ st.markdown(f"""# {home_title} <span style=color:#2E9BF5><font size=5>Beta</font></span>""",unsafe_allow_html=True)
42
+ st.markdown("""\n""")
43
+ #st.markdown("#### Greetings")
44
+ st.markdown("Welcome to AI Podcast Interviewer! 👏 AI Podcast Interviewer is your personal podcaste interviewer powered by generative AI that conducts Podcaste."
45
+ "You can upload your resume and enter job descriptions, and AI Podcaste Interviewer will ask you customized questions. Additionally, you can configure your own Podcast Interviewer!")
46
+ st.markdown("""\n""")
47
+ with st.expander("Updates"):
48
+ st.write("""
49
+ 07/10/2024
50
+ - Fix the error that was occuring on the home page """)
51
+ with st.expander("What's coming next?"):
52
+ st.write("""
53
+ Improved voice interaction for a seamless experience. """)
54
+ st.markdown("""\n""")
55
+ st.markdown("#### Get started!")
56
+ st.markdown("Select one of the following screens to start your interview!")
57
+ selected = option_menu(
58
+ menu_title= None,
59
+ options=["Professional", "Resume", "Behavioral","Customize!"],
60
+ icons = ["cast", "cloud-upload", "cast"],
61
+ default_index=0,
62
+ orientation="horizontal",
63
+ )
64
+ if selected == 'Professional':
65
+ st.info("""
66
+ 📚In this session, the AI Podcaste Interviewer will assess your technical skills as they relate to the proived description.
67
+ Note: The maximum length of your answer is 4097 tokens!
68
+ - Each Interview will take 10 to 15 mins.
69
+ - To start a new session, just refresh the page.
70
+ - Choose your favorite interaction style (chat/voice)
71
+ - Start introduce yourself and enjoy! """)
72
+ if st.button("Start Interview!"):
73
+ switch_page("Professional Screen")
74
+ if selected == 'Resume':
75
+ st.info("""
76
+ 📚In this session, the AI Podcaste Interviewer will review your resume and discuss your past experiences.
77
+ Note: The maximum length of your answer is 4097 tokens!
78
+ - Each Interview will take 10 to 15 mins.
79
+ - To start a new session, just refresh the page.
80
+ - Choose your favorite interaction style (chat/voice)
81
+ - Start introduce yourself and enjoy! """
82
+ )
83
+ if st.button("Start Interview!"):
84
+ switch_page("Resume Screen")
85
+ if selected == 'Behavioral':
86
+ st.info("""
87
+ 📚In this session, the AI Podcaste Interviewer will assess your soft skills as they relate to the job description.
88
+ Note: The maximum length of your answer is 4097 tokens!
89
+ - Each Interview will take 10 to 15 mins.
90
+ - To start a new session, just refresh the page.
91
+ - Choose your favorite interaction style (chat/voice)
92
+ - Start introduce yourself and enjoy!
93
+ """)
94
+ if st.button("Start Interview!"):
95
+ switch_page("Behavioral Screen")
96
+ if selected == 'Customize!':
97
+ st.info("""
98
+ 📚In this session, you can customize your own AI Podcaste Interviewer and practice with it!
99
+ - Configure AI Interviewer in different specialties.
100
+ - Configure AI Interviewer in different personalities.
101
+ - Different tones of voice.
102
+
103
+ Coming at the end of July""")
104
+ st.markdown("""\n""")
105
+ st.markdown("#### Kautilya Utkarsh")
106
+ # st.write('[Click here to view common FAQs, future updates and more!](https://jiatastic.notion.site/wiki-8d962051e57a48ccb304e920afa0c6a8?pvs=4)')
107
+ #st.write(
108
+ # f'<iframe src="https://17nxkr0j95z3vy.embednotionpage.com/AI-Interviewer-Wiki-8d962051e57a48ccb304e920afa0c6a8" style="width:100%; height:100%; min-height:500px; border:0; padding:0;"/>',
109
+ # unsafe_allow_html=True,
110
+ # )
111
+
112
+
113
+ if lan == '中文':
114
+ home_title = "AI面试官"
115
+ home_introduction = "欢迎使用 AI 面试官,它能够通过生成式AI帮助您准备面试。"
116
+ with st.sidebar:
117
+ st.markdown('AI面试管 - V0.1.2')
118
+ st.markdown("""
119
+ #### 领英:
120
+ [贾皓翔](https://www.linkedin.com/in/haoxiang-jia/)
121
+
122
+ [王梓丞](https://www.linkedin.com/in/todd-wang-5001aa264/)
123
+ #### 请填写表格,我们非常希望听到您的反馈:
124
+ [Feedback Form](https://docs.google.com/forms/d/13f4q03bk4lD7sKR7qZ8UM1lQDo6NhRaAKv7uIeXHEaQ/edit)
125
+
126
+ #### 使用的技术:
127
+
128
+ [OpenAI](https://openai.com/)
129
+
130
+ [FAISS](https://github.com/facebookresearch/faiss)
131
+
132
+ [Langchain](https://github.com/hwchase17/langchain)
133
+
134
+ """)
135
+ st.markdown(
136
+ "<style>#MainMenu{visibility:hidden;}</style>",
137
+ unsafe_allow_html=True
138
+ )
139
+ st.image(im, width=100)
140
+ st.markdown(f"""# {home_title} <span style=color:#2E9BF5><font size=5>Beta</font></span>""", unsafe_allow_html=True)
141
+
142
+ st.markdown("""\n""")
143
+ # st.markdown("#### Greetings")
144
+ st.markdown(
145
+ "欢迎使用AI面试官!👏AI面试官是一款由生成式人工智能驱动的个人面试官,可以进行模拟面试。您可以上传您的简历或者复制粘贴工作描述,AI面试官会根据您的情况提出定制化的问题。"
146
+ )
147
+ st.markdown("""\n""")
148
+ with st.expander("更新日志"):
149
+ st.write("""
150
+ 08/13/2023
151
+ - 修复了当用户输入失败时的报错问题 """)
152
+ with st.expander("未来计划"):
153
+ st.write("""
154
+ - 提供更加稳定和快速的语音交互
155
+ - 支持全中文的模拟面试 """)
156
+ st.markdown("""\n""")
157
+ st.markdown("#### 让我们开始吧!")
158
+ st.markdown("请选择以下其中一个开始您的面试!")
159
+ selected = option_menu(
160
+ menu_title=None,
161
+ options=["专业评估", "简历评估", "行为评估"],
162
+ icons=["cast", "cloud-upload", "cast"],
163
+ default_index=0,
164
+ orientation="horizontal",
165
+ )
166
+ if selected == '专业评估':
167
+ st.info("""
168
+ 📚在本次面试中,AI面试官将会根据职位描述评估您的技术能力。
169
+ 注意: 您回答的最大长度为4097个tokens!
170
+ - 每次面试将会持续10到15分钟。
171
+ - 您可以通过刷新页面来开始新的面试。
172
+ - 您可以选择您喜欢的交互方式(文字/语音)
173
+ - 开始介绍您自己吧! """)
174
+ if st.button("开始面试!"):
175
+ switch_page("Professional Screen")
176
+ if selected == '简历评估':
177
+ st.info("""
178
+ 📚在本次面试中,AI面试官将会根据您的简历评估您的过往经历。
179
+ 注意: 您回答的最大长度为4097个tokens!
180
+ - 每次面试将会持续10到15分钟。
181
+ - 您可以通过刷新页面来开始新的面试。
182
+ - 您可以选择您喜欢的交互方式(文字/语音)
183
+ - 开始介绍您自己吧! """)
184
+ if st.button("开始面试!"):
185
+ switch_page("Resume Screen")
186
+ if selected == '行为评估':
187
+ st.info("""
188
+ 📚在本次面试中,AI面试官将会根据您的简历评估您的技术能力。
189
+ 注意: 您回答的最大长度为4097个tokens!
190
+ - 每次面试将会持续10到15分钟。
191
+ - 您可以通过刷新页面来开始新的面试。
192
+ - 您可以选择您喜欢的交互方式(文字/语音)
193
+ - 开始介绍您自己吧! """)
194
+ if st.button("开始面试!"):
195
+ switch_page("Behavioral Screen")
196
+ st.markdown("""\n""")
197
+ st.markdown("#### 维基")
198
+ st.write(
199
+ '[点击查看常见问题,更新和计划!](https://jiatastic.notion.site/wiki-8d962051e57a48ccb304e920afa0c6a8?pvs=4)')
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Haoxiang Jia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,3 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- license: mit
3
- ---
 
1
+
2
+
3
+ # AI Interviewer - Version 0.1.2
4
+
5
+ Welcome to AI Interviewer! 👏 AI Interviewer is a cutting-edge application powered by generative AI designed to conduct mock interviews. With the ability to analyze your uploaded resume and job descriptions, AI Interviewer generates tailored questions to enhance your interview preparation. You even have the flexibility to customize your own interviewing experience!
6
+
7
+ ## Table of Contents
8
+
9
+ - [Overview](#overview)
10
+ - [Getting Started](#getting-started)
11
+ - [Features](#features)
12
+ - [Upcoming Updates](#upcoming-updates)
13
+ - [Feedback](#feedback)
14
+ - [Contact](#contact)
15
+ <!-- - [Acknowledgments](#acknowledgments) -->
16
+
17
+ ## Overview
18
+
19
+ AI Interviewer aims to revolutionize your interview preparation process. Whether you're seeking to improve your technical skills, communication abilities, or adaptability, this application can assist you. Powered by cutting-edge technology from OpenAI, FAISS, and Langchain, AI Interviewer provides a seamless experience that simulates real interview scenarios.
20
+
21
+ ## Getting Started
22
+
23
+ To begin your AI Interviewer experience, follow these simple steps:
24
+
25
+ 1. **Select Interview Type:** Choose from the following interview screens:
26
+ - **Homepage:** Overview of AI Interviewer.
27
+ - **Behavioral Screen:** Assess your behavioral skills.
28
+ - **Professional Screen:** Evaluate your technical skills.
29
+ - **Resume Screen:** Review your uploaded resume.
30
+
31
+ 2. **Customize Your Experience:** Tailor your interview by uploading your resume and providing job descriptions.
32
+
33
+ 3. **Choose Interaction Style:** Opt for your preferred interaction style, whether it's through chat or voice.
34
+
35
+ 4. **Start Interviewing:** Begin the interview by introducing yourself and responding to AI-generated questions.
36
+
37
+ ## Features
38
+
39
+ - **Personalized Questions:** AI Interviewer generates interview questions customized to your uploaded resume and job descriptions.
40
+
41
+ - **Multiple Screens:** Access different screens for behavioral, professional, and resume-related interview aspects.
42
+
43
+ - **Interactive Experience:** Engage in a conversation with the AI interviewer, enhancing the realism of the interview process.
44
+
45
+ - **Easy Refresh:** Initiate a new interview session simply by refreshing the page.
46
+
47
+ - **Choice of Interaction:** Select between chat-based or voice-based interaction styles for your interviews.
48
+
49
+ ## Upcoming Updates
50
+
51
+ We are constantly working to improve AI Interviewer and bring you new features. In the pipeline:
52
+
53
+ - Enhanced AI capabilities for even more realistic interviews.
54
+ - Expanded question database for a wider range of industries and roles.
55
+ - Improved voice interaction for a seamless experience.
56
+
57
+ ## Feedback
58
+
59
+ We highly value your feedback! Your insights can help us enhance AI Interviewer. Please take a moment to fill out our [Feedback Form](https://docs.google.com/forms/d/13f4q03bk4lD7sKR7qZ8UM1lQDo6NhRaAKv7uIeXHEaQ/viewform?edit_requested=true).
60
+
61
+ ## Contact
62
+
63
+ ## Contact
64
+
65
+ - GitHub: [jiatastic](https://github.com/jiatastic)
66
+
67
+ <!-- ## Acknowledgments
68
+
69
+ AI Interviewer is powered by a blend of advanced technologies:
70
+
71
+ - OpenAI: Providing the generative AI capabilities.
72
+ - FAISS: Enhancing search and retrieval capabilities.
73
+ - Langchain: Facilitating natural language interactions.
74
+
75
+ The application is proudly built with [Streamlit](https://streamlit.io/).
76
+
77
  ---
78
+
79
+ Remember, AI Interviewer is your partner in preparing for your future interviews. Sharpen your skills, boost your confidence, and seize those career opportunities with confidence! 🚀 -->
app_utils.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def switch_page(page_name: str):
2
+ from streamlit.runtime.scriptrunner import RerunData, RerunException
3
+ from streamlit.source_util import get_pages
4
+
5
+ def standardize_name(name: str) -> str:
6
+ return name.lower().replace("_", " ")
7
+
8
+ page_name = standardize_name(page_name)
9
+
10
+ pages = get_pages("home.py") # OR whatever your main page is called
11
+
12
+ for page_hash, config in pages.items():
13
+ if standardize_name(config["page_name"]) == page_name:
14
+ raise RerunException(
15
+ RerunData(
16
+ page_script_hash=page_hash,
17
+ page_name=page_name,
18
+ )
19
+ )
20
+
21
+ page_names = [standardize_name(config["page_name"]) for config in pages.values()]
22
+
23
+ raise ValueError(f"Could not find page {page_name}. Must be one of {page_names}")
azure-pipelines.yml ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python package
2
+ # Create and test a Python package on multiple Python versions.
3
+ # Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4
+ # https://docs.microsoft.com/azure/devops/pipelines/languages/python
5
+
6
+ trigger:
7
+ - main
8
+
9
+ pool:
10
+ vmImage: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ Python27:
14
+ python.version: '2.7'
15
+ Python35:
16
+ python.version: '3.5'
17
+ Python36:
18
+ python.version: '3.6'
19
+ Python37:
20
+ python.version: '3.7'
21
+
22
+ steps:
23
+ - task: UsePythonVersion@0
24
+ inputs:
25
+ versionSpec: '$(python.version)'
26
+ displayName: 'Use Python $(python.version)'
27
+
28
+ - script: |
29
+ python -m pip install --upgrade pip
30
+ pip install -r requirements.txt
31
+ displayName: 'Install dependencies'
32
+
33
+ - script: |
34
+ pip install pytest pytest-azurepipelines
35
+ pytest
36
+ displayName: 'pytest'
icon.png ADDED
initialization.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from langchain.embeddings import OpenAIEmbeddings
3
+ from langchain.vectorstores import FAISS
4
+ from langchain.text_splitter import NLTKTextSplitter
5
+ from langchain.memory import ConversationBufferMemory
6
+ from langchain.chains import RetrievalQA, ConversationChain
7
+ from prompts.prompts import templates
8
+ from langchain.prompts.prompt import PromptTemplate
9
+ from langchain.chat_models import ChatOpenAI
10
+ from PyPDF2 import PdfReader
11
+ from prompts.prompt_selector import prompt_sector
12
+ def embedding(text):
13
+ """embeddings"""
14
+ text_splitter = NLTKTextSplitter()
15
+ texts = text_splitter.split_text(text)
16
+ # Create emebeddings
17
+ embeddings = OpenAIEmbeddings()
18
+ docsearch = FAISS.from_texts(texts, embeddings)
19
+ return docsearch
20
+
21
+ def resume_reader(resume):
22
+ pdf_reader = PdfReader(resume)
23
+ text = ""
24
+ for page in pdf_reader.pages:
25
+ text += page.extract_text()
26
+ return text
27
+
28
+ def initialize_session_state(template=None, position=None):
29
+ """ initialize session states """
30
+ if 'jd' in st.session_state:
31
+ st.session_state.docsearch = embedding(st.session_state.jd)
32
+ else:
33
+ st.session_state.docsearch = embedding(resume_reader(st.session_state.resume))
34
+
35
+ #if 'retriever' not in st.session_state:
36
+ st.session_state.retriever = st.session_state.docsearch.as_retriever(search_type="similarity")
37
+ #if 'chain_type_kwargs' not in st.session_state:
38
+ if 'jd' in st.session_state:
39
+ Interview_Prompt = PromptTemplate(input_variables=["context", "question"],
40
+ template=template)
41
+ st.session_state.chain_type_kwargs = {"prompt": Interview_Prompt}
42
+ else:
43
+ st.session_state.chain_type_kwargs = prompt_sector(position, templates)
44
+ #if 'memory' not in st.session_state:
45
+ st.session_state.memory = ConversationBufferMemory()
46
+ # interview history
47
+ #if "history" not in st.session_state:
48
+ st.session_state.history = []
49
+ # token count
50
+ #if "token_count" not in st.session_state:
51
+ st.session_state.token_count = 0
52
+ #if "guideline" not in st.session_state:
53
+ llm = ChatOpenAI(
54
+ model_name="gpt-3.5-turbo",
55
+ temperature=0.6, )
56
+ st.session_state.guideline = RetrievalQA.from_chain_type(
57
+ llm=llm,
58
+ chain_type_kwargs=st.session_state.chain_type_kwargs, chain_type='stuff',
59
+ retriever=st.session_state.retriever, memory=st.session_state.memory).run(
60
+ "Create an interview guideline and prepare only one questions for each topic. Make sure the questions tests the technical knowledge")
61
+ # llm chain and memory
62
+ #if "screen" not in st.session_state:
63
+ llm = ChatOpenAI(
64
+ model_name="gpt-3.5-turbo",
65
+ temperature=0.8, )
66
+ PROMPT = PromptTemplate(
67
+ input_variables=["history", "input"],
68
+ template="""I want you to act as an interviewer strictly following the guideline in the current conversation.
69
+
70
+ Ask me questions and wait for my answers like a real person.
71
+ Do not write explanations.
72
+ Ask question like a real person, only one question at a time.
73
+ Do not ask the same question.
74
+ Do not repeat the question.
75
+ Do ask follow-up questions if necessary.
76
+ You name is GPTInterviewer.
77
+ I want you to only reply as an interviewer.
78
+ Do not write all the conversation at once.
79
+ If there is an error, point it out.
80
+
81
+ Current Conversation:
82
+ {history}
83
+
84
+ Candidate: {input}
85
+ AI: """)
86
+ st.session_state.screen = ConversationChain(prompt=PROMPT, llm=llm,
87
+ memory=st.session_state.memory)
88
+ #if "feedback" not in st.session_state:
89
+ llm = ChatOpenAI(
90
+ model_name = "gpt-3.5-turbo",
91
+ temperature = 0.5,)
92
+ st.session_state.feedback = ConversationChain(
93
+ prompt=PromptTemplate(input_variables = ["history", "input"], template = templates.feedback_template),
94
+ llm=llm,
95
+ memory = st.session_state.memory,
96
+ )
packages.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ xdg-utils
2
+ w3m
requirements.txt ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ langchain-community
2
+ langchain
3
+ langchain_core
4
+ PyPDF2
5
+ openai
6
+ wave
7
+ streamlit==1.25.0
8
+ tiktoken
9
+ nltk
10
+ #azure-cognitiveservices-speech
11
+ audio_recorder_streamlit
12
+ streamlit-option-menu
13
+ streamlit-lottie
14
+ faiss-cpu
15
+ boto3
16
+ Ipython