Class: PineconeHybridDatastore<DocMeta>
Extends
AbstractHybridDatastore
<DocMeta
,Pinecone.QueryFilter
<DocMeta
>>
Type parameters
Parameter |
---|
DocMeta extends BaseMeta |
Constructors
new PineconeHybridDatastore(args)
new PineconeHybridDatastore<
DocMeta
>(args
):PineconeHybridDatastore
<DocMeta
>
Parameters
Parameter | Type | Description |
---|---|---|
args | object | - |
args.cache ? | CacheStorage <string , QueryResult <DocMeta >> | Enables caching for queries. Must implement .get(key) and .set(key, value) , both of which can be either sync or async.Some examples include: new Map() , quick-lru (opens in a new tab), or any keyv adaptor (opens in a new tab). |
args.cacheKey ? | CacheKey <Query <DocMeta , QueryFilter <DocMeta >>, string > | A function that returns a cache key for the given params. A simple example would be: (params) => JSON.stringify(params) The default cacheKey function uses hash-object (opens in a new tab) to create a stable sha256 hash of the params. |
args.contentKey | keyof DocMeta | The metadata key of the content that is embedded. The value associated with the key must be a string. |
args.context ? | Ctx | - |
args.debug ? | boolean | Whether or not to add default console.log event handlers |
args.embeddingModel | EmbeddingModel | - |
args.events ? | Events <DocMeta , QueryFilter <DocMeta >> | - |
args.namespace ? | string | - |
args.pinecone ? | PineconeClient <DocMeta > | - |
args.spladeModel | SparseVectorModel | Splade instance for creating sparse vectors |
Returns
PineconeHybridDatastore
<DocMeta
>
Overrides
AbstractHybridDatastore
.constructor
Source
src/datastore/pinecone/hybrid-datastore.ts:15 (opens in a new tab)
Properties
Property | Type | Description | Inheritance | Source |
---|---|---|---|---|
datastoreProvider | "pinecone" | - | AbstractHybridDatastore .datastoreProvider | src/datastore/pinecone/hybrid-datastore.ts:12 (opens in a new tab) |
datastoreType | "hybrid" | - | AbstractHybridDatastore .datastoreType | src/datastore/pinecone/hybrid-datastore.ts:11 (opens in a new tab) |
Methods
addEvents()
addEvents(
events
):PineconeHybridDatastore
<DocMeta
>
Add event handlers to the datastore.
Parameters
Parameter | Type |
---|---|
events | Events <DocMeta , QueryFilter <DocMeta >> |
Returns
PineconeHybridDatastore
<DocMeta
>
Inherited from
AbstractHybridDatastore
.addEvents
Source
src/datastore/datastore.ts:153 (opens in a new tab)
delete()
delete(
docIds
):Promise
<void
>
Parameters
Parameter | Type |
---|---|
docIds | string [] |
Returns
Promise
<void
>
Overrides
AbstractHybridDatastore
.delete
Source
src/datastore/pinecone/hybrid-datastore.ts:176 (opens in a new tab)
deleteAll()
deleteAll():
Promise
<void
>
Returns
Promise
<void
>
Overrides
AbstractHybridDatastore
.deleteAll
Source
src/datastore/pinecone/hybrid-datastore.ts:180 (opens in a new tab)
getEvents()
getEvents():
Events
<DocMeta
,QueryFilter
<DocMeta
>>
Get the current event handlers
Returns
Events
<DocMeta
, QueryFilter
<DocMeta
>>
Inherited from
AbstractHybridDatastore
.getEvents
Source
src/datastore/datastore.ts:148 (opens in a new tab)
query()
query(
query
,context
?):Promise
<QueryResult
<DocMeta
>>
Parameters
Parameter | Type |
---|---|
query | Query <DocMeta , QueryFilter <DocMeta >> |
context ? | Ctx |
Returns
Promise
<QueryResult
<DocMeta
>>
Inherited from
Source
src/datastore/datastore.ts:53 (opens in a new tab)
runQuery()
runQuery(
query
,context
?):Promise
<QueryResult
<DocMeta
>>
Parameters
Parameter | Type |
---|---|
query | Query <DocMeta , QueryFilter <DocMeta >> |
context ? | Ctx |
Returns
Promise
<QueryResult
<DocMeta
>>
Overrides
AbstractHybridDatastore.runQuery
Source
src/datastore/pinecone/hybrid-datastore.ts:31 (opens in a new tab)
setEvents()
setEvents(
events
):PineconeHybridDatastore
<DocMeta
>
Set the event handlers to a new set of events. Removes all existing event handlers.
Set to empty object {}
to remove all events.
Parameters
Parameter | Type |
---|---|
events | Events <DocMeta , QueryFilter <DocMeta >> |
Returns
PineconeHybridDatastore
<DocMeta
>
Inherited from
AbstractHybridDatastore
.setEvents
Source
src/datastore/datastore.ts:162 (opens in a new tab)
upsert()
upsert(
docs
,context
?):Promise
<void
>
Parameters
Parameter | Type |
---|---|
docs | Doc <DocMeta >[] |
context ? | Ctx |
Returns
Promise
<void
>
Overrides
AbstractHybridDatastore
.upsert
Source
src/datastore/pinecone/hybrid-datastore.ts:89 (opens in a new tab)