Skip to content

Commit

Permalink
remove source from out of context answer
Browse files Browse the repository at this point in the history
  • Loading branch information
ibizabroker committed Aug 26, 2023
1 parent 9773060 commit d564d4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def get_response(input):
response = message.content
source_doc = chain_result['source_documents'][0].metadata['source']
source_doc_page = chain_result['source_documents'][0].metadata['page']


if response.startswith("I'm sorry"):
return response

output = f"""{response} \n \n*Source*: {source_doc} \n*Page number*: {source_doc_page}"""

return output

0 comments on commit d564d4e

Please sign in to comment.