careerv3 / prompts /prompt_selector.py
ombhojane's picture
Upload 88 files
8d404bc verified
raw
history blame
1.21 kB
from langchain.prompts import PromptTemplate
def prompt_sector(position: str, prompts: classmethod) -> dict:
""" Select the prompt template based on the position """
if position == 'Data Analyst':
PROMPT = PromptTemplate(
template= prompts.da_template, input_variables=["context", "question"]
)
chain_type_kwargs = {"prompt": PROMPT}
if position == 'Software Engineer':
PROMPT = PromptTemplate(
template= prompts.swe_template, input_variables=["context", "question"]
)
chain_type_kwargs = {"prompt": PROMPT}
if position == 'Marketing':
PROMPT = PromptTemplate(
template= prompts.marketing_template, input_variables=["context", "question"]
)
chain_type_kwargs = {"prompt": PROMPT}
else:
# You can define a generic template for positions not explicitly handled above
# or provide specific instructions for handling such cases.
PROMPT = PromptTemplate(
template=prompts.generic_template, input_variables=["context", "question"]
)
chain_type_kwargs = {"prompt": PROMPT}
return chain_type_kwargs
return chain_type_kwargs