Spaces:
Runtime error
Runtime error
Update models/langOpen.py
Browse filesAdded from langchain.retrievers import ContextualCompressionRetriever
from langchain.retrievers.document_compressors import CohereRerank
from langchain_community.llms import Cohere
- models/langOpen.py +4 -0
models/langOpen.py
CHANGED
|
@@ -9,6 +9,10 @@ from langchain.embeddings import OpenAIEmbeddings
|
|
| 9 |
from langchain.prompts import PromptTemplate
|
| 10 |
from langchain_pinecone import PineconeVectorStore
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
prompt_template = """You are an expert on California Drinking Water Regulations.
|
| 13 |
Answer the question solely using relevant regulations in the given context. DO NOT USE ANY OTHER SOURCES.
|
| 14 |
If the given context does not contain the relevant information, say so.
|
|
|
|
| 9 |
from langchain.prompts import PromptTemplate
|
| 10 |
from langchain_pinecone import PineconeVectorStore
|
| 11 |
|
| 12 |
+
from langchain.retrievers import ContextualCompressionRetriever
|
| 13 |
+
from langchain.retrievers.document_compressors import CohereRerank
|
| 14 |
+
from langchain_community.llms import Cohere
|
| 15 |
+
|
| 16 |
prompt_template = """You are an expert on California Drinking Water Regulations.
|
| 17 |
Answer the question solely using relevant regulations in the given context. DO NOT USE ANY OTHER SOURCES.
|
| 18 |
If the given context does not contain the relevant information, say so.
|