Skip to content

Commit 057a6c1

Browse files
jirispilkaTC-MO
andauthored
docs: update examples for pinecone integration (because of the new actor) (#1072)
Co-authored-by: Michał Olender <[email protected]>
1 parent 2998476 commit 057a6c1

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

sources/platform/integrations/ai/pinecone.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The examples utilize the Website Content Crawler Actor, which deeply crawls webs
4444

4545
![Website Content Crawler with Pinecone integration](../images/pinecone-wcc-integration.png)
4646

47-
1. Select when to trigger this integration (typically when a run succeeds) and fill in all the required fields for the Pinecone integration. You can learn more about the input parameters at the [Pinecone integration input schema](https://apify.com/jan.turon/pinecone-integration/input-schema).
47+
1. Select when to trigger this integration (typically when a run succeeds) and fill in all the required fields for the Pinecone integration. You can learn more about the input parameters at the [Pinecone integration input schema](https://apify.com/apify/pinecone-integration/input-schema).
4848

4949
![Pinecone integration configuration](../images/pinecone-integration-setup.png)
5050

@@ -63,9 +63,9 @@ Another way to interact with Pinecone is through the [Apify Python SDK](https://
6363
```python
6464
from apify_client import ApifyClient
6565

66-
APIFY_API_TOKEN = "YOUR APIFY TOKEN"
67-
OPENAI_API_KEY = "YOUR OPENAI API KEY"
68-
PINECONE_TOKEN = "YOUR PINECONE TOKEN"
66+
APIFY_API_TOKEN = "YOUR-APIFY-TOKEN"
67+
OPENAI_API_KEY = "YOUR-OPENAI-API-KEY"
68+
PINECONE_API_KEY = "YOUR-PINECONE-API-KEY"
6969

7070
client = ApifyClient(APIFY_API_TOKEN)
7171
```
@@ -76,30 +76,38 @@ Another way to interact with Pinecone is through the [Apify Python SDK](https://
7676
actor_call = client.actor("apify/website-content-crawler").call(
7777
run_input={"startUrls": [{"url": "https://docs.pinecone.io/home"}]}
7878
)
79+
80+
print("Website Content Crawler Actor has finished")
81+
print(actor_call)
7982
```
8083

81-
1. Call Apify's Pinecone integration and store all data in the Pinecone Vector Database:
84+
1. Use Apify's [Pinecone integration](https://apify.com/apify/pinecone-integration) to store all the selected data from the dataset (provided by `datasetId` from the Actor call) into the Pinecone vector database.
8285

8386
```python
84-
pinecone_integration_inputs = dict(
85-
index_name="apify",
86-
pinecone_token=PINECONE_TOKEN,
87-
openai_token=OPENAI_API_KEY,
88-
fields=["text"],
89-
perform_chunking=True,
90-
chunk_size=2048,
91-
chunk_overlap=0,
92-
)
93-
94-
pinecone_integration_inputs["dataset_id"] = actor_call["defaultDatasetId"]
95-
actor_call = client.actor("jan.turon/pinecone-integration").call(run_input=pinecone_integration_inputs)
96-
87+
pinecone_integration_inputs = {
88+
"pineconeApiKey": PINECONE_API_KEY,
89+
"pineconeIndexName": "apify",
90+
"datasetFields": ["text"],
91+
"datasetId": actor_call["defaultDatasetId"],
92+
"enableDeltaUpdates": True,
93+
"deltaUpdatesPrimaryDatasetFields": ["url"],
94+
"expiredObjectDeletionPeriodDays": 30,
95+
"embeddingsApiKey": OPENAI_API_KEY,
96+
"embeddingsProvider": "OpenAI",
97+
"performChunking": True,
98+
"chunkSize": 1000,
99+
"chunkOverlap": 0,
100+
}
101+
102+
actor_call = client.actor("apify/pinecone-integration").call(run_input=pinecone_integration_inputs)
103+
print("Apify's Pinecone Integration has finished")
104+
print(actor_call)
97105
```
98106

99107
You have successfully integrated Apify with Pinecone and the data is now stored in the Pinecone vector database.
100108

101109
## Additional Resources
102110

103-
- [Apify Pinecone integration](https://apify.com/jan.turon/pinecone-integration)
111+
- [Apify Pinecone integration](https://apify.com/apify/pinecone-integration)
104112
- [What is Pinecone and why use it with your LLMs?](https://blog.apify.com/what-is-pinecone-why-use-it-with-llms/)
105113
- [Pinecone documentation](https://docs.pinecone.io/)
-19.9 KB
Loading

0 commit comments

Comments
 (0)