Class: PineconeDatastore<DocMeta>
Extends
AbstractDatastore
<DocMeta
,Pinecone.QueryFilter
<DocMeta
>>
Type parameters
Parameter |
---|
DocMeta extends BaseMeta |
Constructors
new PineconeDatastore(args)
new PineconeDatastore<
DocMeta
>(args
):PineconeDatastore
<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 > | - |
Returns
PineconeDatastore
<DocMeta
>
Overrides
Source
src/datastore/pinecone/datastore.ts:14 (opens in a new tab)
Properties
Property | Type | Description | Inheritance | Source |
---|---|---|---|---|
datastoreProvider | "pinecone" | - | AbstractDatastore .datastoreProvider | src/datastore/pinecone/datastore.ts:11 (opens in a new tab) |
datastoreType | "embedding" | - | AbstractDatastore .datastoreType | src/datastore/pinecone/datastore.ts:10 (opens in a new tab) |
Methods
addEvents()
addEvents(
events
):PineconeDatastore
<DocMeta
>
Add event handlers to the datastore.
Parameters
Parameter | Type |
---|---|
events | Events <DocMeta , QueryFilter <DocMeta >> |
Returns
PineconeDatastore
<DocMeta
>
Inherited from
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
Source
src/datastore/pinecone/datastore.ts:153 (opens in a new tab)
deleteAll()
deleteAll():
Promise
<void
>
Returns
Promise
<void
>
Overrides
Source
src/datastore/pinecone/datastore.ts:157 (opens in a new tab)
getEvents()
getEvents():
Events
<DocMeta
,QueryFilter
<DocMeta
>>
Get the current event handlers
Returns
Events
<DocMeta
, QueryFilter
<DocMeta
>>
Inherited from
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
AbstractDatastore.runQuery
Source
src/datastore/pinecone/datastore.ts:30 (opens in a new tab)
setEvents()
setEvents(
events
):PineconeDatastore
<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
PineconeDatastore
<DocMeta
>
Inherited from
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
>