Package com.hw.pinecone
Class PineconeClient
java.lang.Object
com.hw.pinecone.PineconeClient
- All Implemented Interfaces:
Closeable,AutoCloseable
Because the pinecone-java-client does not support managing Pinecone services,
only reading and writing from existing indices. Therefore, this needs to be rewritten.
- Author:
- HamaWhite
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the HttpClient connection pool.voidcreateIndex(CreateIndexRequest request) This operation creates a Pinecone index.retrofit2.RetrofitcreateRetrofit(String baseUrl) Initializes the PineconeClient instance.static com.fasterxml.jackson.databind.ObjectMappervoiddeleteIndex(String name) This operation deletes an existing index.describeIndex(String name) Get a description of an index.indexClient(String name) init()Initializes the PineconeClient instance.This operation returns a list of your Pinecone indexes.
-
Field Details
-
requestTimeout
protected long requestTimeoutDefault is 16 seconds.
-
-
Constructor Details
-
PineconeClient
public PineconeClient()
-
-
Method Details
-
init
Initializes the PineconeClient instance.- Returns:
- the initialized PineconeClient instance
-
indexClient
-
createRetrofit
Initializes the PineconeClient instance.- Returns:
- the initialized PineconeClient instance
-
defaultObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper() -
close
public void close()Closes the HttpClient connection pool.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
listIndexes
This operation returns a list of your Pinecone indexes.- Returns:
- a list of strings representing the Pinecone indexes.
-
createIndex
This operation creates a Pinecone index.- Parameters:
request- create index request
-
describeIndex
Get a description of an index.- Parameters:
name- the name of the index- Returns:
- a description of the index
-
deleteIndex
This operation deletes an existing index.- Parameters:
name- the name of the index
-