Update app.py
Browse files628 unmodified lines629630631632633634635636637638639640641642628 unmodified linestemplate="""Rephrase the following conversational query into a concise, search-engine-friendly format.Remove any conversational elements and focus on the core information need.Conversational query: {query}Search query:""")chain = LLMChain(llm=model, prompt=rephrase_prompt)rephrased_query = chain.run(query=query).strip()return rephrased_querydef ask_question(question, temperature, top_p, repetition_penalty, web_search, google_news_rss):628 unmodified lines629630631632633634635636637638639640641642643644645646647628 unmodified linestemplate="""Rephrase the following conversational query into a concise, search-engine-friendly format.Remove any conversational elements and focus on the core information need.Provide only the rephrased query without any explanation.Conversational query: {query}Rephrased query:""")chain = LLMChain(llm=model, prompt=rephrase_prompt)response = chain.run(query=query).strip()# Extract only the rephrased query, ignoring any explanationsrephrased_query = response.split('\n')[0].strip()return rephrased_querydef ask_question(question, temperature, top_p, repetition_penalty, web_search, google_news_rss):
app.py+7-2