Class PineconePlugin
java.lang.Object
com.google.genkit.plugins.pinecone.PineconePlugin
- All Implemented Interfaces:
Plugin
Pinecone plugin for Genkit providing vector database functionality.
Example usage:
Genkit genkit = Genkit.builder().plugin(GoogleGenAIPlugin.create(apiKey))
.plugin(PineconePlugin.builder().apiKey(System.getenv("PINECONE_API_KEY")).addIndex(PineconeIndexConfig
.builder().indexName("my-index").embedderName("googleai/text-embedding-004").build()).build())
.build();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic PineconePlugin.Builderbuilder()Creates a new builder for PineconePlugin.static PineconePlugin.BuilderCreates a PineconePlugin with the specified API key.io.pinecone.clients.PineconeGets the Pinecone client.getName()Returns the unique identifier for the plugin.getVectorStore(String indexName) Gets a vector store by index name.getVectorStore(String indexName, String namespace) Gets a vector store by index name and namespace.init()Initializes the plugin.Initializes the plugin with access to the registry.
-
Method Details
-
builder
Creates a new builder for PineconePlugin. -
create
Creates a PineconePlugin with the specified API key.- Parameters:
apiKey- the Pinecone API key- Returns:
- a builder for further configuration
-
getName
Description copied from interface:PluginReturns the unique identifier for the plugin. This name is used for registration and lookup. -
init
Description copied from interface:PluginInitializes the plugin. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides. -
init
Description copied from interface:PluginInitializes the plugin with access to the registry. This method is called once during Genkit initialization. The plugin should return a list of actions that it provides.Override this method instead of
Plugin.init()when your plugin needs to resolve dependencies from the registry (e.g., embedders, models). -
getVectorStore
Gets a vector store by index name.- Parameters:
indexName- the index name- Returns:
- the vector store, or null if not found
-
getVectorStore
Gets a vector store by index name and namespace.- Parameters:
indexName- the index namenamespace- the namespace- Returns:
- the vector store, or null if not found
-
getClient
public io.pinecone.clients.Pinecone getClient()Gets the Pinecone client.
-