Vincent Claes commited on
Commit
61deb82
1 Parent(s): 48b7712

add intro email for job issuer

Browse files
Files changed (2) hide show
  1. app.py +23 -3
  2. prompts/intro.py +82 -30
app.py CHANGED
@@ -96,10 +96,30 @@ def search(resume):
96
  vacancies_formatted = postprocess_vancy(vacancies, original_resume)
97
  return vacancies_formatted
98
 
99
- def create_intro(vacancy, resume):
100
- intro_ = intro.get_intro(llm, vacancy, resume)
101
  return intro_["intro"]
102
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
  examples = [
105
  """
@@ -282,7 +302,7 @@ with demo:
282
  )
283
  text_intro = gr.Textbox(label="3. Introductie E-mail")
284
  b2.click(
285
- create_intro,
286
  inputs=[text_vacature, text_cv],
287
  outputs=[text_intro],
288
  )
 
96
  vacancies_formatted = postprocess_vancy(vacancies, original_resume)
97
  return vacancies_formatted
98
 
99
+ def get_intro_jobseeker(vacancy, resume):
100
+ intro_ = intro.get_intro_jobseeker(llm, vacancy, resume)
101
  return intro_["intro"]
102
 
103
+ def get_intro_jobissuer(vacancy, resume):
104
+ intro_ = intro.get_intro_jobissuer(llm, vacancy, resume)
105
+ return intro_["intro"]
106
+
107
+ def get_intro(vacancy, resume):
108
+ jobseeker = get_intro_jobseeker(vacancy, resume)
109
+ jobissuer = get_intro_jobissuer(vacancy, resume)
110
+ return f"""
111
+ EMAIL KANDIDAAT:
112
+ =================
113
+
114
+ {jobseeker}
115
+
116
+ EMAIL BEDRIJF:
117
+ ===============
118
+
119
+ {jobissuer}
120
+
121
+ """
122
+
123
 
124
  examples = [
125
  """
 
302
  )
303
  text_intro = gr.Textbox(label="3. Introductie E-mail")
304
  b2.click(
305
+ get_intro,
306
  inputs=[text_vacature, text_cv],
307
  outputs=[text_intro],
308
  )
prompts/intro.py CHANGED
@@ -3,38 +3,90 @@ from langchain.chains import SequentialChain
3
  from langchain.prompts import ChatPromptTemplate
4
 
5
 
6
- def get_intro(llm, vacancy, resume) -> SequentialChain:
7
- template_get_skills_intersection = """
8
-
9
- ```
10
- VACANCY:
11
-
12
- {vacancy}
13
- ```
14
-
15
-
16
- ```
17
- RESUME:
18
- {resume}
19
- ```
20
-
21
- Both the vacancy and resume are delimited by three backticks.
22
- Can you generate a short introduction of the vacancy to the person in the resume?
23
- Fill in the below template and return only the filled in template nothing else.
24
-
25
- Hallo < name of the person in the resume > ,
26
-
27
- Volgende vacature is misschien iets voor jou:
28
-
29
- Functie: < description of the vacancy in 1 sentence with some context. >
30
- Locatie: < the location in the vacancy where the person will be working. >
31
- Aanbod: < short comma seperated list with the vacancy offer. >
32
-
33
- meer info: https://some-example-vacancy.be/some-vacancy-id
34
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  prompt_get_skills_intersection = ChatPromptTemplate.from_template(
37
- template=template_get_skills_intersection
38
  )
39
  skills_match_chain = LLMChain(
40
  llm=llm,
 
3
  from langchain.prompts import ChatPromptTemplate
4
 
5
 
6
+ def get_intro_jobseeker(llm, vacancy, resume) -> SequentialChain:
7
+ template = """
8
+
9
+ ```
10
+ VACANCY:
11
+
12
+ {vacancy}
13
+ ```
14
+
15
+
16
+ ```
17
+ RESUME:
18
+ {resume}
19
+ ```
20
+
21
+ Both the vacancy and resume are delimited by three backticks.
22
+ Can you generate a short introduction of the vacancy to the person in the resume?
23
+ Fill in the below template and return only the filled in template nothing else.
24
+
25
+ Hallo < name of the person in the resume > ,
26
+
27
+ Volgende vacature is misschien iets voor jou:
28
+
29
+ Functie: < description of the vacancy in 1 sentence with some context. >
30
+ Locatie: < the location in the vacancy where the person will be working. >
31
+ Aanbod: < short comma seperated list with the vacancy offer. >
32
+
33
+ meer info: https://some-example-vacancy.be/some-vacancy-id
34
+ """
35
+
36
+ prompt_get_skills_intersection = ChatPromptTemplate.from_template(
37
+ template=template
38
+ )
39
+ skills_match_chain = LLMChain(
40
+ llm=llm,
41
+ prompt=prompt_get_skills_intersection,
42
+ output_key="intro",
43
+ )
44
+
45
+ chain = SequentialChain(
46
+ chains=[skills_match_chain],
47
+ input_variables=["vacancy", "resume"],
48
+ output_variables=[
49
+ skills_match_chain.output_key,
50
+ ],
51
+ verbose=False,
52
+ )
53
+ return chain({"vacancy": vacancy, "resume": resume})
54
+
55
+
56
+ def get_intro_jobissuer(llm, vacancy, resume) -> SequentialChain:
57
+ template = """
58
+
59
+ ```
60
+ VACANCY:
61
+
62
+ {vacancy}
63
+ ```
64
+
65
+
66
+ ```
67
+ RESUME:
68
+ {resume}
69
+ ```
70
+
71
+ Both the vacancy and resume are delimited by three backticks.
72
+ You are a recruitment specialist that tries to place the right profiles for the right job.
73
+ Fill in the below template and return only the filled in template nothing else.
74
+
75
+ Beste klant,
76
+
77
+ We hebben een kandidaat gevonden die misschien wel iets voor jou is.
78
+
79
+ - Vacature: < title of the vacancy >
80
+ - Kandidaat: < name of the candidate >
81
+ - Rol: < the role of the candidate >
82
+ - Ervaring: < name max the 2 most relevant experiences from the candidate for this vacancy. If there us no relevant experience, leave this empty. Do not make up an answer or get them from the irrelevant experiences. >
83
+
84
+ Volledige CV vind je annex.
85
+
86
+ """
87
 
88
  prompt_get_skills_intersection = ChatPromptTemplate.from_template(
89
+ template=template
90
  )
91
  skills_match_chain = LLMChain(
92
  llm=llm,