Skip to content

Latest commit

 

History

History
2066 lines (1477 loc) · 27.1 KB

File metadata and controls

2066 lines (1477 loc) · 27.1 KB

Reference

client.ListIndexesAsync() -> IndexList

📝 Description

List all indexes in a project.

🔌 Usage

await client.ListIndexesAsync();
client.CreateIndexAsync(CreateIndexRequest { ... }) -> Index

📝 Description

Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more.

For guidance and examples, see Create an index.

🔌 Usage

await client.CreateIndexAsync(
    new CreateIndexRequest
    {
        Name = "movie-recommendations",
        Dimension = 1536,
        Metric = MetricType.Cosine,
        DeletionProtection = DeletionProtection.Enabled,
        Spec = new ServerlessIndexSpec
        {
            Serverless = new ServerlessSpec
            {
                Cloud = ServerlessSpecCloud.Gcp,
                Region = "us-east1",
            },
        },
    }
);

⚙️ Parameters

request: CreateIndexRequest

client.DescribeIndexAsync(indexName) -> Index

📝 Description

Get a description of an index.

🔌 Usage

await client.DescribeIndexAsync("test-index");

⚙️ Parameters

indexName: string — The name of the index to be described.

client.DeleteIndexAsync(indexName)

📝 Description

Delete an existing index.

🔌 Usage

await client.DeleteIndexAsync("test-index");

⚙️ Parameters

indexName: string — The name of the index to delete.

client.ConfigureIndexAsync(indexName, ConfigureIndexRequest { ... }) -> Index

📝 Description

Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection.

It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then create a new pod-based index with a different pod type from the collection. For guidance and examples, see Configure an index.

🔌 Usage

await client.ConfigureIndexAsync(
    "test-index",
    new ConfigureIndexRequest
    {
        Spec = new ConfigureIndexRequestSpec
        {
            Pod = new ConfigureIndexRequestSpecPod { PodType = "p1.x2" },
        },
    }
);

⚙️ Parameters

indexName: string — The name of the index to configure.

request: ConfigureIndexRequest

client.ListCollectionsAsync() -> CollectionList

📝 Description

List all collections in a project. Serverless indexes do not support collections.

🔌 Usage

await client.ListCollectionsAsync();
client.CreateCollectionAsync(CreateCollectionRequest { ... }) -> CollectionModel

📝 Description

Create a Pinecone collection.

Serverless indexes do not support collections.

🔌 Usage

await client.CreateCollectionAsync(
    new CreateCollectionRequest { Name = "example-collection", Source = "example-source-index" }
);

⚙️ Parameters

request: CreateCollectionRequest

client.CreateIndexForModelAsync(CreateIndexForModelRequest { ... }) -> Index

📝 Description

Create an index with integrated embedding.

With this type of index, you provide source text, and Pinecone uses a hosted embedding model to convert the text automatically during upsert and search.

For guidance and examples, see Create an index.

🔌 Usage

await client.CreateIndexForModelAsync(
    new CreateIndexForModelRequest
    {
        Name = "multilingual-e5-large-index",
        Cloud = CreateIndexForModelRequestCloud.Gcp,
        Region = "us-east1",
        DeletionProtection = DeletionProtection.Enabled,
        Embed = new CreateIndexForModelRequestEmbed
        {
            Model = "multilingual-e5-large",
            Metric = MetricType.Cosine,
            FieldMap = new Dictionary<string, object>() { { "text", "your-text-field" } },
        },
    }
);

⚙️ Parameters

request: CreateIndexForModelRequest

client.DescribeCollectionAsync(collectionName) -> CollectionModel

📝 Description

Get a description of a collection. Serverless indexes do not support collections.

🔌 Usage

await client.DescribeCollectionAsync("tiny-collection");

⚙️ Parameters

collectionName: string — The name of the collection to be described.

client.DeleteCollectionAsync(collectionName)

📝 Description

Delete an existing collection. Serverless indexes do not support collections.

🔌 Usage

await client.DeleteCollectionAsync("test-collection");

⚙️ Parameters

collectionName: string — The name of the collection.

Backups

client.Backups.ListByIndexAsync(indexName, ListBackupsByIndexRequest { ... }) -> BackupList

📝 Description

List all backups for an index.

🔌 Usage

await client.Backups.ListByIndexAsync("index_name", new ListBackupsByIndexRequest());

⚙️ Parameters

indexName: string — Name of the backed up index

request: ListBackupsByIndexRequest

client.Backups.BackupIndexAsync(indexName, BackupIndexRequest { ... }) -> BackupModel

📝 Description

Create a backup of an index.

🔌 Usage

await client.Backups.BackupIndexAsync("index_name", new BackupIndexRequest());

⚙️ Parameters

indexName: string — Name of the index to backup

request: BackupIndexRequest

client.Backups.ListAsync() -> BackupList

📝 Description

List all backups for a project.

🔌 Usage

await client.Backups.ListAsync();
client.Backups.GetAsync(backupId) -> BackupModel

📝 Description

Get a description of a backup.

🔌 Usage

await client.Backups.GetAsync("670e8400-e29b-41d4-a716-446655440000");

⚙️ Parameters

backupId: string — The ID of the backup to describe.

client.Backups.DeleteAsync(backupId)

📝 Description

Delete a backup.

🔌 Usage

await client.Backups.DeleteAsync("670e8400-e29b-41d4-a716-446655440000");

⚙️ Parameters

backupId: string — The ID of the backup to delete.

client.Backups.CreateIndexFromBackupAsync(backupId, CreateIndexFromBackupRequest { ... }) -> CreateIndexFromBackupResponse

📝 Description

Create an index from a backup.

🔌 Usage

await client.Backups.CreateIndexFromBackupAsync(
    "670e8400-e29b-41d4-a716-446655440000",
    new CreateIndexFromBackupRequest { Name = "example-index" }
);

⚙️ Parameters

backupId: string — The ID of the backup to create an index from.

request: CreateIndexFromBackupRequest

RestoreJobs

client.RestoreJobs.ListAsync(ListRestoreJobsRequest { ... }) -> RestoreJobList

📝 Description

List all restore jobs for a project.

🔌 Usage

await client.RestoreJobs.ListAsync(new ListRestoreJobsRequest());

⚙️ Parameters

request: ListRestoreJobsRequest

client.RestoreJobs.GetAsync(jobId) -> RestoreJobModel

📝 Description

Get a description of a restore job.

🔌 Usage

await client.RestoreJobs.GetAsync("670e8400-e29b-41d4-a716-446655440000");

⚙️ Parameters

jobId: string — The ID of the restore job to describe.

Index

client.Index.ListBulkImportsAsync(ListBulkImportsRequest { ... }) -> ListImportsResponse

📝 Description

List all recent and ongoing import operations.

By default, list_imports returns up to 100 imports per page. If the limit parameter is set, list returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a pagination_token that you can use to get the next batch of imports. When the response does not include a pagination_token, there are no more imports to return.

For guidance and examples, see Import data.

🔌 Usage

await client.Index.ListBulkImportsAsync(new ListBulkImportsRequest());

⚙️ Parameters

request: ListBulkImportsRequest

client.Index.StartBulkImportAsync(StartImportRequest { ... }) -> StartImportResponse

📝 Description

Start an asynchronous import of vectors from object storage into an index.

For guidance and examples, see Import data.

🔌 Usage

await client.Index.StartBulkImportAsync(new StartImportRequest { Uri = "uri" });

⚙️ Parameters

request: StartImportRequest

client.Index.DescribeBulkImportAsync(id) -> ImportModel

📝 Description

Return details of a specific import operation.

For guidance and examples, see Import data.

🔌 Usage

await client.Index.DescribeBulkImportAsync("101");

⚙️ Parameters

id: string — Unique identifier for the import operation.

client.Index.CancelBulkImportAsync(id) -> CancelImportResponse

📝 Description

Cancel an import operation if it is not yet finished. It has no effect if the operation is already finished.

For guidance and examples, see Import data.

🔌 Usage

await client.Index.CancelBulkImportAsync("101");

⚙️ Parameters

id: string — Unique identifier for the import operation.

client.Index.SearchRecordsAsync(namespace_, SearchRecordsRequest { ... }) -> SearchRecordsResponse

📝 Description

Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query.

Searching with text is supported only for indexes with integrated embedding. Searching with a query vector or record ID is supported for all indexes.

For guidance and examples, see Search.

🔌 Usage

await client.Index.SearchRecordsAsync(
    "namespace",
    new SearchRecordsRequest
    {
        Query = new SearchRecordsRequestQuery
        {
            TopK = 10,
            Inputs = new Dictionary<string, object>() { { "text", "your query text" } },
        },
        Fields = new List<string>() { "chunk_text" },
    }
);

⚙️ Parameters

namespace_: string — The namespace to search.

request: SearchRecordsRequest

client.Index.DescribeIndexStatsAsync(DescribeIndexStatsRequest { ... }) -> DescribeIndexStatsResponse

📝 Description

Get index stats

Return statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness.

Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes.

🔌 Usage

await client.Index.DescribeIndexStatsAsync(new DescribeIndexStatsRequest());

⚙️ Parameters

request: DescribeIndexStatsRequest

client.Index.ListNamespacesAsync(ListNamespacesRequest { ... }) -> ListNamespacesResponse

📝 Description

Get list of all namespaces

Get a list of all namespaces within an index.

🔌 Usage

await client.Index.ListNamespacesAsync(new ListNamespacesRequest());

⚙️ Parameters

request: ListNamespacesRequest

client.Index.QueryAsync(QueryRequest { ... }) -> QueryResponse

📝 Description

Search with a vector

Search a namespace with a query vector or record ID and return the IDs of the most similar records, along with their similarity scores.

For guidance and examples, see Search.

🔌 Usage

await client.Index.QueryAsync(
    new QueryRequest
    {
        TopK = 3,
        Namespace = "example",
        IncludeValues = true,
        IncludeMetadata = true,
    }
);

⚙️ Parameters

request: QueryRequest

client.Index.DeleteAsync(DeleteRequest { ... }) -> DeleteResponse

📝 Description

Delete vectors

Delete vectors by id from a single namespace.

For guidance and examples, see Delete data.

🔌 Usage

await client.Index.DeleteAsync(
    new DeleteRequest
    {
        Ids = new List<string>() { "v1", "v2", "v3" },
        Namespace = "example",
    }
);

⚙️ Parameters

request: DeleteRequest

client.Index.FetchAsync(FetchRequest { ... }) -> FetchResponse

📝 Description

Fetch vectors

Look up and return vectors by ID from a single namespace. The returned vectors include the vector data and/or metadata.

For guidance and examples, see Fetch data.

🔌 Usage

await client.Index.FetchAsync(new FetchRequest { Ids = ["v1"], Namespace = "example" });

⚙️ Parameters

request: FetchRequest

client.Index.ListAsync(ListRequest { ... }) -> ListResponse

📝 Description

List vector IDs

List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix.

This returns up to 100 IDs at a time by default in sorted order (bitwise/"C" collation). If the limit parameter is set, list returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a pagination_token that you can use to get the next batch of IDs. When the response does not include a pagination_token, there are no more IDs to return.

For guidance and examples, see List record IDs.

Note: list is supported only for serverless indexes.

🔌 Usage

await client.Index.ListAsync(
    new ListRequest
    {
        Limit = 50,
        Namespace = "example",
        PaginationToken = "eyJza2lwX3Bhc3QiOiIxMDEwMy0=",
    }
);

⚙️ Parameters

request: ListRequest

client.Index.UpdateAsync(UpdateRequest { ... }) -> UpdateResponse

📝 Description

Update a vector

Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.

For guidance and examples, see Update data.

🔌 Usage

await client.Index.UpdateAsync(
    new UpdateRequest
    {
        Id = "v1",
        Namespace = "example",
        Values = new[] { 42.2f, 50.5f, 60.8f },
    }
);

⚙️ Parameters

request: UpdateRequest

client.Index.UpsertAsync(UpsertRequest { ... }) -> UpsertResponse

📝 Description

Upsert vectors

Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value.

For guidance and examples, see Upsert data.

🔌 Usage

await client.Index.UpsertAsync(
    new UpsertRequest
    {
        Vectors = new List<Vector>()
        {
            new Vector { Id = "v1", Values = new[] { 0.1f, 0.2f, 0.3f } },
        },
    }
);

⚙️ Parameters

request: UpsertRequest

Inference

client.Inference.EmbedAsync(EmbedRequest { ... }) -> EmbeddingsList

📝 Description

Generate vector embeddings for input data. This endpoint uses Pinecone Inference.

🔌 Usage

await client.Inference.EmbedAsync(
    new EmbedRequest
    {
        Model = "multilingual-e5-large",
        Inputs = new List<EmbedRequestInputsItem>() { new EmbedRequestInputsItem() },
    }
);

⚙️ Parameters

request: EmbedRequest

client.Inference.RerankAsync(RerankRequest { ... }) -> RerankResult

📝 Description

Rerank documents according to their relevance to a query.

For guidance and examples, see Rerank results.

🔌 Usage

await client.Inference.RerankAsync(
    new RerankRequest
    {
        Model = "bge-reranker-v2-m3",
        Query = "What is the capital of France?",
        Documents = new List<Dictionary<string, object?>>()
        {
            new Dictionary<string, object>()
            {
                { "id", "1" },
                { "text", "Paris is the capital of France." },
                { "title", "France" },
                { "url", "https://example.com" },
            },
        },
    }
);

⚙️ Parameters

request: RerankRequest

Inference Models

client.Inference.Models.ListAsync(ListModelsRequest { ... }) -> ModelInfoList

📝 Description

Get available models.

🔌 Usage

await client.Inference.Models.ListAsync(new ListModelsRequest());

⚙️ Parameters

request: ListModelsRequest

client.Inference.Models.GetAsync(modelName) -> ModelInfo

📝 Description

Get model details.

🔌 Usage

await client.Inference.Models.GetAsync("multilingual-e5-large");

⚙️ Parameters

modelName: string — The name of the model to look up.