# Inference API plugin for python SDK
## Installation
The plugin is distributed separately from the core python sdk.
```
# Install the base python SDK, version 4.1.1 or higher
pip install pinecone-client
# And also the plugin functionality
pip install pinecone-plugin-inference
```
## Usage
Interact with Pinecone's Inference APIs, e.g. create embeddings (currently in preview).
Models currently supported:
- [multilingual-e5-large](https://arxiv.org/pdf/2402.05672)
## Generate embeddings
The following example highlights how to use an embedding model to generate embeddings for a list of documents and a
user query, with the ultimate goal of retrieving similar documents from a Pinecone index.
```python
from pinecone import Pinecone
pc = Pinecone(api_key="<<PINECONE_API_KEY>>")
model = "multilingual-e5-large"
# Embed documents
text = [
"Turkey is a classic meat to eat at American Thanksgiving.",
"Many people enjoy the beautiful mosques in Turkey.",
]
text_embeddings = pc.inference.embed(
model=model,
inputs=text,
parameters={"input_type": "passage", "truncate": "END"},
)
# <<Upsert documents into Pinecone index>>
# Embed query
query = ["How should I prepare my turkey?"]
query_embeddings = pc.inference.embed(
model=model,
inputs=query,
parameters={"input_type": "query", "truncate": "END"},
)
# <<Send query to Pinecone index to retrieve similar documents>>
```
Raw data
{
"_id": null,
"home_page": "https://www.pinecone.io",
"name": "pinecone-plugin-inference",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Pinecone Systems, Inc.",
"author_email": "support@pinecone.io",
"download_url": "https://files.pythonhosted.org/packages/79/98/4601b7bcc985d563ac0dfc10a686ac4ae14a99de56c7cee258c5c0bdb565/pinecone_plugin_inference-0.4.0.tar.gz",
"platform": null,
"description": "# Inference API plugin for python SDK\n\n## Installation\n\nThe plugin is distributed separately from the core python sdk.\n\n```\n# Install the base python SDK, version 4.1.1 or higher\npip install pinecone-client\n\n# And also the plugin functionality\npip install pinecone-plugin-inference\n```\n\n## Usage\n\nInteract with Pinecone's Inference APIs, e.g. create embeddings (currently in preview).\n\nModels currently supported:\n- [multilingual-e5-large](https://arxiv.org/pdf/2402.05672)\n\n## Generate embeddings\nThe following example highlights how to use an embedding model to generate embeddings for a list of documents and a \nuser query, with the ultimate goal of retrieving similar documents from a Pinecone index.\n\n```python\nfrom pinecone import Pinecone\n\npc = Pinecone(api_key=\"<<PINECONE_API_KEY>>\")\nmodel = \"multilingual-e5-large\"\n\n# Embed documents\ntext = [\n \"Turkey is a classic meat to eat at American Thanksgiving.\",\n \"Many people enjoy the beautiful mosques in Turkey.\",\n]\ntext_embeddings = pc.inference.embed(\n model=model,\n inputs=text,\n parameters={\"input_type\": \"passage\", \"truncate\": \"END\"},\n)\n\n# <<Upsert documents into Pinecone index>>\n\n# Embed query\nquery = [\"How should I prepare my turkey?\"]\nquery_embeddings = pc.inference.embed(\n model=model,\n inputs=query,\n parameters={\"input_type\": \"query\", \"truncate\": \"END\"},\n)\n\n# <<Send query to Pinecone index to retrieve similar documents>>\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Embeddings plugin for Pinecone SDK",
"version": "0.4.0",
"project_urls": {
"Documentation": "https://pinecone.io/docs",
"Homepage": "https://www.pinecone.io"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "000bb94b20e61b60ab2d8ec4549daf9bbc40f56edff41b1d3fc68e220ef34ece",
"md5": "6e5ccf7fdcfb6d759ec5c257dc8ed4d8",
"sha256": "2d4cf3f267e055907e9fbd560cd32f97125680a03cc201c474541ac18ac19cda"
},
"downloads": -1,
"filename": "pinecone_plugin_inference-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6e5ccf7fdcfb6d759ec5c257dc8ed4d8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 129243,
"upload_time": "2024-06-17T16:16:54",
"upload_time_iso_8601": "2024-06-17T16:16:54.657817Z",
"url": "https://files.pythonhosted.org/packages/00/0b/b94b20e61b60ab2d8ec4549daf9bbc40f56edff41b1d3fc68e220ef34ece/pinecone_plugin_inference-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "79984601b7bcc985d563ac0dfc10a686ac4ae14a99de56c7cee258c5c0bdb565",
"md5": "a92fda360bcd38468d42c05794db8ab3",
"sha256": "a67d8be4795994303481440b0c821e59176880f758c72403664c94ad70ca1ea5"
},
"downloads": -1,
"filename": "pinecone_plugin_inference-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "a92fda360bcd38468d42c05794db8ab3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 56782,
"upload_time": "2024-06-17T16:16:58",
"upload_time_iso_8601": "2024-06-17T16:16:58.590192Z",
"url": "https://files.pythonhosted.org/packages/79/98/4601b7bcc985d563ac0dfc10a686ac4ae14a99de56c7cee258c5c0bdb565/pinecone_plugin_inference-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-17 16:16:58",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pinecone-plugin-inference"
}