Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/testing-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@ name: "Integration Tests"
workflow_call: {}

jobs:
plugin-inference:
name: Test inference plugin
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [3.9, 3.12]
steps:
- uses: actions/checkout@v4
- name: 'Set up Python ${{ matrix.python_version }}'
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python_version }}'
- name: Setup Poetry
uses: ./.github/actions/setup-poetry
with:
include_grpc: 'true'
- name: 'Run integration tests'
run: poetry run pytest tests/integration/inference -s -vv
env:
PINECONE_DEBUG_CURL: 'true'
PINECONE_API_KEY: '${{ secrets.PINECONE_API_KEY }}'

data-plane-serverless:
name: Data plane serverless integration tests
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions codegen/build-oas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ is_early_access=$2 # e.g. true
# if is_early_access is true, add the "ea" module
if [ "$is_early_access" = "true" ]; then
destination="pinecone/core_ea/openapi"
modules=("db_control" "db_data")
modules=("db_control" "db_data" "inference")
py_module_name="core_ea"
template_dir="codegen/python-oas-templates/templates5.2.0"
else
destination="pinecone/core/openapi"
modules=("db_control" "db_data")
modules=("db_control" "db_data" "inference")
py_module_name="core"
template_dir="codegen/python-oas-templates/templates5.2.0"
fi
Expand Down
6 changes: 6 additions & 0 deletions pinecone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

warnings.filterwarnings("ignore", category=TqdmExperimentalWarning)

from .deprecated_plugins import check_for_deprecated_plugins
from .deprecation_warnings import *
from .config import *
from .exceptions import *
Expand All @@ -18,4 +19,9 @@

import logging

# Raise an exception if the user is attempting to use the SDK with deprecated plugins
# installed in their project.
check_for_deprecated_plugins()

# Silence annoying log messages from the plugin interface
logging.getLogger("pinecone_plugin_interface").setLevel(logging.CRITICAL)
11 changes: 10 additions & 1 deletion pinecone/control/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from .langchain_import_warnings import _build_langchain_attribute_error_message
from pinecone.utils import parse_non_empty_args, docslinks

from pinecone.data import _Index, _AsyncioIndex
from pinecone.data import _Index, _AsyncioIndex, _Inference

from pinecone_plugin_interface import load_and_install as install_plugins

Expand Down Expand Up @@ -85,6 +85,8 @@ def __init__(
self.openapi_config = ConfigBuilder.build_openapi_config(self.config, **kwargs)
self.pool_threads = pool_threads

self._inference = None # Lazy initialization

if index_api:
self.index_api = index_api
else:
Expand All @@ -102,6 +104,13 @@ def __init__(

self.load_plugins()

@property
def inference(self):
"""Dynamically create and cache the Inference instance."""
if self._inference is None:
self._inference = _Inference(config=self.config, openapi_config=self.openapi_config)
return self._inference

def load_plugins(self):
"""@private"""
try:
Expand Down
3 changes: 1 addition & 2 deletions pinecone/core/openapi/db_control/api/manage_indexes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@


class ManageIndexesApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated.

Do not edit the class manually.
"""
Expand Down
3 changes: 1 addition & 2 deletions pinecone/core/openapi/db_data/api/bulk_operations_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@


class BulkOperationsApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated.

Do not edit the class manually.
"""
Expand Down
3 changes: 1 addition & 2 deletions pinecone/core/openapi/db_data/api/vector_operations_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@


class VectorOperationsApi(object):
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
"""NOTE: This class is auto generated.

Do not edit the class manually.
"""
Expand Down
29 changes: 29 additions & 0 deletions pinecone/core/openapi/inference/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# flake8: noqa

"""
Pinecone Inference API

Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501

The version of the OpenAPI document: 2025-01
Contact: support@pinecone.io
Generated by: https://openapi-generator.tech
"""

__version__ = "1.0.0"

# import ApiClient
from pinecone.openapi_support import ApiClient

# import Configuration
from pinecone.openapi_support import Configuration

# import exceptions
from pinecone.openapi_support.exceptions import PineconeException
from pinecone.openapi_support.exceptions import PineconeApiAttributeError
from pinecone.openapi_support.exceptions import PineconeApiTypeError
from pinecone.openapi_support.exceptions import PineconeApiValueError
from pinecone.openapi_support.exceptions import PineconeApiKeyError
from pinecone.openapi_support.exceptions import PineconeApiException

API_VERSION = "2025-01"
3 changes: 3 additions & 0 deletions pinecone/core/openapi/inference/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# do not import all apis into this module because that uses a lot of memory and stack frames
# if you need the ability to import all apis from one package, import them with
# from pinecone.core.openapi.inference.apis import InferenceApi
Loading
Loading