I am following Langchain example to perform a Google search and use the results for a Q and A bot. The original example is here: https://python.langchain.com/docs/use_cases/apis but I have made few changes to be like so
template = """You are a helpful Gas Boiler Consultant. Between >>> and <<< are the raw search result text from google.
Extract the answer to the question '{query}' or say "not found" if the information is not contained but not both answer and "not found". Use the format Extracted:<answer or "not found">. Ensure you provide a very detailed and helpful answer and cite potential sources of information."""
PROMPT = PromptTemplate(
input_variables=["query", "requests_result"],
template=template,
)
chain = LLMRequestsChain(llm_chain=LLMChain(llm=OpenAI(temperature=0, openai_api_key=openai_api_key), prompt=PROMPT))
question = f"I am going to replace my Gas boiler soon." \
f"What are the available Government funded financial support? Limit search within following websites:{websites} only"
inputs = {
"query": question,
"url": "https://www.google.com/search?q=" + question.replace(" ", "+"),
}
res = chain(inputs)
print(f"Response {res}")
where {websites} is an array/list of websites for the search bit. Currently I am passing these websites as part of the query. Is there a way for me to pass these websites in the prompt template for just the Google search and not in the question itself? Also how do I instruct the search that although it should search only with the supplied pages (urls), it can do at least two more levels deeper for any referenced urls eg: if inside the page by url www.example.com/page references www.example.com/access, then the latter can also be used for the search.