Spaces:
Running
Running
izammohammed
commited on
Commit
•
b0ed380
1
Parent(s):
3a7461f
Update openai_call.py
Browse files- openai_call.py +2 -7
openai_call.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
from
|
2 |
from langchain_pinecone import PineconeVectorStore
|
3 |
from langchain.prompts import PromptTemplate
|
4 |
from langchain_openai import OpenAI
|
5 |
from langchain.chains import RetrievalQA
|
6 |
from dotenv import load_dotenv
|
7 |
-
from
|
8 |
import os
|
9 |
|
10 |
load_dotenv()
|
@@ -43,8 +43,3 @@ qa = RetrievalQA.from_chain_type(
|
|
43 |
def openai_call(input):
|
44 |
result = qa.invoke({"query": input})
|
45 |
return str(result["result"])
|
46 |
-
|
47 |
-
|
48 |
-
if __name__ == "__main__":
|
49 |
-
msg = "If a previous owner of a land had allowed a neighbour or neighbour to walk or drive over his land in a shortcut and this has been going on for say a decade or so can I as the new owner stop them now from using the shortcut?"
|
50 |
-
print(f"response: {openai_call(msg)}")
|
|
|
1 |
+
from helper import download_hugging_face_embeddings
|
2 |
from langchain_pinecone import PineconeVectorStore
|
3 |
from langchain.prompts import PromptTemplate
|
4 |
from langchain_openai import OpenAI
|
5 |
from langchain.chains import RetrievalQA
|
6 |
from dotenv import load_dotenv
|
7 |
+
from prompt import prompt_template
|
8 |
import os
|
9 |
|
10 |
load_dotenv()
|
|
|
43 |
def openai_call(input):
|
44 |
result = qa.invoke({"query": input})
|
45 |
return str(result["result"])
|
|
|
|
|
|
|
|
|
|