Documentation
¶
Overview ¶
Package pinecone implements a genkit plugin for the Pinecone vector database. This defines a retriever.
Accessing Pinecone requires an API key, passed via Config. If the API key is the empty string, the plugin will use the PINECONE_API_KEY environment variable.
All Pinecone data is stored in what Pinecone calls an index. The Pinecone plugin supports a single index, passed via Config.
Indexes can be partitioned into namespaces. Operations that use indexes pass a namespace argument, via RetrieverOptions. If the namespace is not specified the code uses the default namespace.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDefinedRetriever ¶ added in v0.1.0
IsDefinedRetriever reports whether the named Retriever is defined by this plugin.
Types ¶
type Config ¶
type Config struct { IndexID string // The index ID to use. Embedder ai.Embedder // Embedder to use. Required. EmbedderOptions any // Options to pass to the embedder. TextKey string // Metadata key to use to store document text in Pinecone; the default is "_content". }
Config provides configuration options for DefineRetriever.
type Docstore ¶ added in v0.6.0
Docstore implements the genkit ai.DocumentStore interface.
func DefineRetriever ¶
func DefineRetriever(ctx context.Context, g *genkit.Genkit, cfg Config) (*Docstore, ai.Retriever, error)
DefineRetriever defines a Retriever with the given configuration.
func (*Docstore) Retrieve ¶ added in v0.6.0
func (ds *Docstore) Retrieve(ctx context.Context, req *ai.RetrieverRequest) (*ai.RetrieverResponse, error)
Retrieve implements the genkit Retriever.Retrieve method.
type Pinecone ¶ added in v0.3.0
type Pinecone struct { APIKey string // API key to use for Pinecone requests. // contains filtered or unexported fields }
type RetrieverOptions ¶
type RetrieverOptions struct { Namespace string `json:"namespace,omitempty"` // Pinecone namespace to use Count int `json:"count,omitempty"` // maximum number of values to retrieve }
RetrieverOptions may be passed in the Options field of ai.RetrieverRequest to pass options to Pinecone. The Options field should be either nil or a value of type *RetrieverOptions.