|
from langchain_core.prompts import PromptTemplate |
|
from langchain_folder.llm_helper import llm |
|
|
|
def ReturnKeywordsfromPrompt(query): |
|
prompt = """You are a model and your job is the extract the keywords from the query which will be passed to you. |
|
For Eg: If the query is -> Provide me with a combined dataset for house price prediction. |
|
Your answer should be 'house price'. Do not return anything else, just the keywords, note that the queries can be for various datasets, |
|
not jsut for house price prediction, go it? |
|
Query: {query}""" |
|
|
|
pt = PromptTemplate.from_template(prompt) |
|
chain = pt | llm |
|
response = chain.invoke({'query': query}) |
|
return response.content |