Skip to content

Commit

Permalink
update Pinecone integration page based on the new API (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Jun 10, 2024
1 parent 7735bdb commit 3113ae9
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions integrations/pinecone-document-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ To use Pinecone as your data storage for your Haystack LLM pipelines, you must h
from haystack_integrations.document_stores.pinecone import PineconeDocumentStore

# Make sure you have the PINECONE_API_KEY environment variable set
document_store = PineconeDocumentStore(metric="cosine", dimension=768, index="YOUR_INDEX_NAME", environment = "YOUR_ENVIRONMENT")
document_store = PineconeDocumentStore(
index="YOUR_INDEX_NAME",
metric="cosine",
dimension=768,
spec={"serverless": {"region": "us-east-1", "cloud": "aws"}},
)
```

#### Writing Documents to PineconeDocumentStore
Expand All @@ -78,7 +83,12 @@ from haystack.components.preprocessors import DocumentSplitter
from haystack_integrations.document_stores.pinecone import PineconeDocumentStore

# Make sure you have the PINECONE_API_KEY environment variable set
document_store = PineconeDocumentStore(metric="cosine", dimension=768, index="YOUR_INDEX_NAME", environment = "YOUR_ENVIRONMENT")
document_store = PineconeDocumentStore(
index="YOUR_INDEX_NAME",
metric="cosine",
dimension=768,
spec={"serverless": {"region": "us-east-1", "cloud": "aws"}},
)

indexing = Pipeline()
indexing.add_component("converter", MarkdownToDocument())
Expand All @@ -105,7 +115,12 @@ from haystack_integrations.document_stores.pinecone import PineconeDocumentStore
from haystack_integrations.components.retrievers.pinecone import PineconeEmbeddingRetriever

# Make sure you have the PINECONE_API_KEY environment variable set
document_store = PineconeDocumentStore(metric="cosine", dimension=768, index="YOUR_INDEX_NAME", environment = "YOUR_ENVIRONMENT")
document_store = PineconeDocumentStore(
index="YOUR_INDEX_NAME",
metric="cosine",
dimension=768,
spec={"serverless": {"region": "us-east-1", "cloud": "aws"}},
)

prompt_template = """Answer the following query based on the provided context. If the context does
not include an answer, reply with 'I don't know'.\n
Expand Down

0 comments on commit 3113ae9

Please sign in to comment.