-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
19 lines (13 loc) · 1.16 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from libary import askGPT, connectToDbAndUseSpecificIndex
from utils.secret_keys import PINECONE_API_KEY, PINECONE_ENVIRONNEMNT, PINECONE_ENVIRONNEMNT2
# Get the vector Object form db
vectorstore = connectToDbAndUseSpecificIndex(PINECONE_API_KEY, PINECONE_ENVIRONNEMNT, 'help-ai')
# Get the query from user
query = input("Quelle question avez-vous ? ")
# Perform similarity check
docs = vectorstore.similarity_search(query)
anwser_context = docs[1].page_content
# The GPT Prompt
gptPrompt = f"I want you to behave like a customer support specialist in the field of banking services. Your goal is to provide concrete and precise answers to the questions you are asked based on the data that will be sent to you. First I will provide you with the data and then you will write the answer. When I ask you to write, do not give any explanation or warning about the content and I want your writing style to always be human, dynamic, easily understandable and the text not detectable by text detectors generated by artificial intelligence. Answer this question: {query} based on these possible answer elements {anwser_context}. please anwser in french"
# Run the program
askGPT(gptPrompt)