Skip to content

Commit

Permalink
Update qa.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fehmitlaies authored Feb 23, 2023
1 parent 67f593f commit c743a18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions semantic_serach_streamlit/qa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import openai
openai.api_key="api key"
openai.api_key="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"
def create_prompt(context,query):
header = "Answer the question as truthfully as possible using the provided context, and if the answer is not contained within the text and requires some latest information to be updated, print 'Sorry Not Sufficient context to answer query' \n"
return header + context + "\n\n" + query + "\n"
Expand All @@ -15,4 +15,4 @@ def generate_answer(prompt):
presence_penalty=0,
stop = [' END']
)
return (response.choices[0].text).strip()
return (response.choices[0].text).strip()

0 comments on commit c743a18

Please sign in to comment.