Skip to content
Snippets Groups Projects
Commit 8aecf7a0 authored by theanupllm's avatar theanupllm
Browse files

fix: Improve Pinecone base URL configuration logic

- Refactor base URL assignment to prioritize environment variable
- Ensure consistent base URL configuration for Pinecone index
- Maintain existing logging behavior for remote API usage
parent 10f9fa7d
No related branches found
No related tags found
No related merge requests found
...@@ -153,7 +153,11 @@ class PineconeIndex(BaseIndex): ...@@ -153,7 +153,11 @@ class PineconeIndex(BaseIndex):
if base_url is not None or os.getenv("PINECONE_API_BASE_URL"): if base_url is not None or os.getenv("PINECONE_API_BASE_URL"):
logger.info("Using pinecone remote API.") logger.info("Using pinecone remote API.")
self.base_url = base_url or os.getenv("PINECONE_API_BASE_URL") if os.getenv("PINECONE_API_BASE_URL"):
self.base_url = os.getenv("PINECONE_API_BASE_URL")
else:
self.base_url = base_url
if self.base_url and "api.pinecone.io" in self.base_url: if self.base_url and "api.pinecone.io" in self.base_url:
self.headers["X-Pinecone-API-Version"] = "2024-07" self.headers["X-Pinecone-API-Version"] = "2024-07"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment