from langchain import LLMChain from langchain.chains import SequentialChain from langchain.prompts import ChatPromptTemplate def get_intro_jobseeker(llm, vacancy, resume) -> SequentialChain: template = """ ``` VACANCY: {vacancy} ``` ``` RESUME: {resume} ``` Both the vacancy and resume are delimited by three backticks. Can you generate a short introduction of the vacancy to the person in the resume? Fill in the below template and return only the filled in template nothing else. Hallo < name of the person in the resume > , Volgende vacature is misschien iets voor jou: Functie: < description of the vacancy in 1 sentence with some context. > Locatie: < the location in the vacancy where the person will be working. > Aanbod: < short comma seperated list with the vacancy offer. > meer info: https://some-example-vacancy.be/some-vacancy-id """ prompt_get_skills_intersection = ChatPromptTemplate.from_template( template=template ) skills_match_chain = LLMChain( llm=llm, prompt=prompt_get_skills_intersection, output_key="intro", ) chain = SequentialChain( chains=[skills_match_chain], input_variables=["vacancy", "resume"], output_variables=[ skills_match_chain.output_key, ], verbose=False, ) return chain({"vacancy": vacancy, "resume": resume}) def get_intro_jobissuer(llm, vacancy, resume) -> SequentialChain: template = """ ``` VACANCY: {vacancy} ``` ``` RESUME: {resume} ``` Both the vacancy and resume are delimited by three backticks. You are a recruitment specialist that tries to place the right profiles for the right job. Fill in the below template and return only the filled in template nothing else. Beste klant, We hebben een kandidaat gevonden die misschien wel iets voor jou is. - Vacature: < title of the vacancy > - Kandidaat: < name of the candidate > - Rol: < the role of the candidate > - 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. > Volledige CV vind je annex. """ prompt_get_skills_intersection = ChatPromptTemplate.from_template( template=template ) skills_match_chain = LLMChain( llm=llm, prompt=prompt_get_skills_intersection, output_key="intro", ) chain = SequentialChain( chains=[skills_match_chain], input_variables=["vacancy", "resume"], output_variables=[ skills_match_chain.output_key, ], verbose=False, ) return chain({"vacancy": vacancy, "resume": resume})