Skip to content

Commit 8f08fd6

Browse files
committed
docs(inference): fix unstable internal import in reranking how-to
## Purpose The "Using the RerankModel enum" code snippet imported `Inference` from `pinecone.client.inference`, an internal module path not in the public API. Teaching users to import from internal paths violates the api-stability contract and will break if the module is reorganized. ## Solution Replaced `from pinecone.client.inference import Inference` + `Inference.RerankModel.Bge_Reranker_V2_M3` with the stable top-level import `from pinecone import Pinecone, RerankModel` and the direct `RerankModel.Bge_Reranker_V2_M3` reference. `RerankModel` is exported from `pinecone.__all__` and `_LAZY_IMPORTS`, making it part of the stable public API.
1 parent 4ccead0 commit 8f08fd6

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎docs/how-to/inference/reranking.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,12 @@ Use the {class}`~pinecone.models.enums.RerankModel` enum for tab-completion and
8888
safety:
8989

9090
```python
91-
from pinecone import Pinecone
92-
from pinecone.client.inference import Inference
91+
from pinecone import Pinecone, RerankModel
9392

9493
pc = Pinecone(api_key="your-api-key")
9594

9695
result = pc.inference.rerank(
97-
model=Inference.RerankModel.Bge_Reranker_V2_M3,
96+
model=RerankModel.Bge_Reranker_V2_M3,
9897
query="machine learning",
9998
documents=documents,
10099
)

0 commit comments

Comments
 (0)