File size: 1,346 Bytes
df97380 |
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
import os
from langchain import LLMChain
from langchain.chains import SequentialChain
from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
def preprocess_resume(llm, resume) -> SequentialChain:
template_get_skills_intersection = """
```
{resume}
```
Can you summarize the above resume in the template below and fill in eveything that is delimited by '<' '>'?
Return only the filled in template nothing else.
position: < the job name or role >
location: < where does the person live >
description: < the description or the person's job or role and description of it's experience. >
profile: < can you describe the sector the person is working in >
competences: < can you describe some hard skills of the person>
"""
prompt_get_skills_intersection = ChatPromptTemplate.from_template(
template=template_get_skills_intersection
)
skills_match_chain = LLMChain(
llm=llm,
prompt=prompt_get_skills_intersection,
output_key="resume_preprocess",
)
chain = SequentialChain(
chains=[skills_match_chain],
input_variables=["resume"],
output_variables=[
skills_match_chain.output_key,
],
verbose=False,
)
return chain({"resume": resume})
|