Spaces:
Runtime error
Runtime error
Commit
·
128592a
1
Parent(s):
bda7c70
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ chain = load_qa_chain(OpenAI(openai_api_key=os.environ['OPENAI_API_KEY']), chain
|
|
17 |
|
18 |
def learn_from_chanakya_neeti(chat_history,query):
|
19 |
docs = docsearch.similarity_search(query)
|
20 |
-
result = result if "i don’t know" in (result:=chain.run(input_documents=docs, question=query)).lower().strip() else "Please only ask questions from chanakya neeti."
|
21 |
|
22 |
return chat_history + [(query,result)]
|
23 |
|
|
|
17 |
|
18 |
def learn_from_chanakya_neeti(chat_history,query):
|
19 |
docs = docsearch.similarity_search(query)
|
20 |
+
result = result if "i don’t know" not in (result:=chain.run(input_documents=docs, question=query)).lower().strip() else "Please only ask questions from chanakya neeti."
|
21 |
|
22 |
return chat_history + [(query,result)]
|
23 |
|