[Go] pinecone: use index ID instead of host
jba opened this issue · comments
The Go pinecone plugin uses Host to determine the index.
The JS one uses index ID.
Change the Go to match the JS.
I'm not sure if the discrepancy here is due to underlying differences in the respective languages' pinecone clients, or just an easily fixed mismatch.
The Go code uses the REST API. The REST API provides a way to look up the index ID to get the host. Then you have to use the host for everything. Right now that is exposed in the Go code, in that you have to call IndexData
or Indexes
to find the index host. You can see this happening in TestPinecone
or TestGenkit
.
In general you may need to call IndexData
anyhow to get the dimension of the index.
Not sure there is anything to do here.
I think you want to call describe_index in init to map the user-provided index name to a host. Then use the host internally.
https://docs.pinecone.io/guides/data/get-an-index-endpoint