mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-08 06:23:20 +00:00
Templates (#12294)
Co-authored-by: Harrison Chase <hw.chase.17@gmail.com> Co-authored-by: Lance Martin <lance@langchain.dev> Co-authored-by: Jacob Lee <jacoblee93@gmail.com>
This commit is contained in:
20
templates/rag-fusion/ingest.py
Normal file
20
templates/rag-fusion/ingest.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import pinecone
|
||||
from langchain.vectorstores import Pinecone
|
||||
from langchain.embeddings import OpenAIEmbeddings
|
||||
|
||||
pinecone.init(api_key="...",environment="...")
|
||||
|
||||
all_documents = {
|
||||
"doc1": "Climate change and economic impact.",
|
||||
"doc2": "Public health concerns due to climate change.",
|
||||
"doc3": "Climate change: A social perspective.",
|
||||
"doc4": "Technological solutions to climate change.",
|
||||
"doc5": "Policy changes needed to combat climate change.",
|
||||
"doc6": "Climate change and its impact on biodiversity.",
|
||||
"doc7": "Climate change: The science and models.",
|
||||
"doc8": "Global warming: A subset of climate change.",
|
||||
"doc9": "How climate change affects daily weather.",
|
||||
"doc10": "The history of climate change activism."
|
||||
}
|
||||
|
||||
Pinecone.from_texts(list(all_documents.values()), OpenAIEmbeddings(), index_name='rag-fusion')
|
Reference in New Issue
Block a user