Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
Easy Quest - Smart Recruitment Tool with AI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23 - J 36
Easy Quest - Smart Recruitment Tool with AI
Commits
2ca478e8
Commit
2ca478e8
authored
May 11, 2023
by
Birahavi Kugathasan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate interview questions from openAI
parent
e9e446b1
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
538 additions
and
422 deletions
+538
-422
package.json
package.json
+1
-0
src/common/config.ts
src/common/config.ts
+2
-0
src/common/lib/openApi.ts
src/common/lib/openApi.ts
+19
-0
src/components.scss
src/components.scss
+6
-0
src/components/Application/Analyse.tsx
src/components/Application/Analyse.tsx
+422
-0
src/components/Application/Interview.tsx
src/components/Application/Interview.tsx
+52
-405
src/views/Application.tsx
src/views/Application.tsx
+19
-15
tsconfig.json
tsconfig.json
+1
-1
yarn.lock
yarn.lock
+16
-1
No files found.
package.json
View file @
2ca478e8
...
...
@@ -13,6 +13,7 @@
"
axios
"
:
"
^1.3.4
"
,
"
firebase
"
:
"
^9.17.2
"
,
"
moment
"
:
"
^2.29.4
"
,
"
openai
"
:
"
^3.2.1
"
,
"
react
"
:
"
^18.2.0
"
,
"
react-dom
"
:
"
^18.2.0
"
,
"
react-easy-crop
"
:
"
^4.7.4
"
,
...
...
src/common/config.ts
View file @
2ca478e8
...
...
@@ -54,3 +54,5 @@ export const emotionsData = [
neutral
:
0.5
,
},
];
export
const
OPEN_API_KEY
=
'
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
'
\ No newline at end of file
src/common/lib/openApi.ts
0 → 100644
View file @
2ca478e8
import
{
Configuration
,
OpenAIApi
}
from
"
openai
"
;
import
{
OPEN_API_KEY
}
from
"
../config
"
;
const
configuration
=
new
Configuration
({
organization
:
"
org-AoUQNrvNFgE7OsNnQWErMvxy
"
,
apiKey
:
OPEN_API_KEY
,
});
const
openai
=
new
OpenAIApi
(
configuration
);
export
default
class
OpenAPI
{
static
getInterViewQuestions
=
(
subject
:
string
,
level
:
string
)
=>
openai
.
createCompletion
({
model
:
'
text-davinci-003
'
,
prompt
:
`Create a list of
${
level
}
questions with answers for my interview regarding
${
subject
}
`
,
temperature
:
0.5
,
max_tokens
:
150
,
top_p
:
1.0
,
frequency_penalty
:
0.0
,
presence_penalty
:
0.0
})
}
\ No newline at end of file
src/components.scss
View file @
2ca478e8
...
...
@@ -228,3 +228,9 @@
display
:
none
;
}
}
.questions-container
{
background-color
:
#ffefab
80
;
min-height
:
400px
;
padding
:
0
20px
;
}
\ No newline at end of file
src/components/Application/Analyse.tsx
0 → 100644
View file @
2ca478e8
This diff is collapsed.
Click to expand it.
src/components/Application/Interview.tsx
View file @
2ca478e8
This diff is collapsed.
Click to expand it.
src/views/Application.tsx
View file @
2ca478e8
...
...
@@ -6,9 +6,22 @@ import TabNavBar from "../components/TabNavBar";
import
{
useDispatch
}
from
"
react-redux
"
;
import
{
updateApplication
}
from
"
../common/actions/common
"
;
import
Applicant
from
"
../components/Application/Applicant
"
;
import
Analyse
from
"
../components/Application/Analyse
"
;
import
Interview
from
"
../components/Application/Interview
"
;
const
tabs
=
[
"
Candidate
"
,
"
Interview
"
];
const
tabs
=
[
"
Candidate
"
,
"
Interview
"
,
"
Analyse
"
];
const
getStatusValues
=
(
status
?:
string
)
=>
{
if
(
status
===
"
Pending
"
)
{
return
[
"
Schedule
"
,
"
Reject
"
];
}
else
if
(
status
===
"
In progress
"
)
{
return
[
"
Accept
"
,
"
Reject
"
];
}
else
if
(
status
===
"
Rejected
"
)
{
return
[
"
Pending
"
,
"
Schedule
"
];
}
else
{
return
[];
}
}
const
Application
=
()
=>
{
const
dispatch
=
useDispatch
();
...
...
@@ -21,17 +34,7 @@ const Application = () => {
);
const
[
status
,
setStatus
]
=
useState
(
application
?.
status
);
const
statusValues
=
useMemo
(()
=>
{
if
(
status
===
"
Pending
"
)
{
return
[
"
Schedule
"
,
"
Reject
"
];
}
else
if
(
status
===
"
In progress
"
)
{
return
[
"
Accept
"
,
"
Reject
"
];
}
else
if
(
status
===
"
Rejected
"
)
{
return
[
"
Pending
"
,
"
Schedule
"
];
}
else
{
return
[];
}
},
[]);
const
statusValues
=
getStatusValues
(
application
?.
status
)
useEffect
(()
=>
{
if
(
application
)
{
...
...
@@ -80,10 +83,11 @@ const Application = () => {
<
div
className=
"card p-4"
>
<
TabNavBar
tabs=
{
tabs
}
selected=
{
selectedTab
}
onSelect=
{
setSelectedTab
}
/>
{
selectedTab
===
"
Candidate
"
&&
<
Applicant
application=
{
application
}
/>
}
{
selectedTab
===
"
Interview
"
&&
<
Interview
application=
{
application
}
/>
}
{
selectedTab
===
"
Interview
"
&&
<
Interview
application=
{
application
}
/>
}
{
selectedTab
===
"
Analyse
"
&&
<
Analyse
application=
{
application
}
/>
}
<
hr
/>
{
statusValues
.
length
>
0
&&
(
<
div
className=
"row "
>
<
label
className=
"col-sm-2 col-form-label"
>
Status
</
label
>
<
div
className=
"col-sm-6 "
>
...
...
@@ -108,7 +112,7 @@ const Application = () => {
</
div
>
</
div
>
</
div
>
)
}
</
div
>
);
};
...
...
tsconfig.json
View file @
2ca478e8
{
"compilerOptions"
:
{
"target"
:
"es
5
"
,
"target"
:
"es
2017
"
,
"lib"
:
[
"dom"
,
"dom.iterable"
,
"esnext"
],
"allowJs"
:
true
,
"skipLibCheck"
:
true
,
...
...
yarn.lock
View file @
2ca478e8
...
...
@@ -3239,6 +3239,13 @@ axe-core@^4.4.3:
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.6.0.tgz#1d07514866fa51262734b3357932fcf86961383a"
integrity sha512-L3ZNbXPTxMrl0+qTXAzn9FBRvk5XdO56K8CvcCKtlxv44Aw2w2NCclGuvCWxHPw1Riiq3ncP/sxFYj2nUqdoTw==
axios@^0.26.0:
version "0.26.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9"
integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==
dependencies:
follow-redirects "^1.14.8"
axios@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.4.tgz#f5760cefd9cfb51fd2481acf88c05f67c4523024"
...
...
@@ -5164,7 +5171,7 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==
follow-redirects@^1.0.0, follow-redirects@^1.15.0:
follow-redirects@^1.0.0, follow-redirects@^1.1
4.8, follow-redirects@^1.1
5.0:
version "1.15.2"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13"
integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==
...
...
@@ -7261,6 +7268,14 @@ open@^8.0.9, open@^8.4.0:
is-docker "^2.1.1"
is-wsl "^2.2.0"
openai@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/openai/-/openai-3.2.1.tgz#1fa35bdf979cbde8453b43f2dd3a7d401ee40866"
integrity sha512-762C9BNlJPbjjlWZi4WYK9iM2tAVAv0uUp1UmI34vb0CN5T2mjB/qM6RYBmNKMh/dN9fC+bxqPwWJZUTWW052A==
dependencies:
axios "^0.26.0"
form-data "^4.0.0"
optionator@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment