Skip to content

Latest commit

 

History

History
1303 lines (936 loc) · 17.7 KB

reference.md

File metadata and controls

1303 lines (936 loc) · 17.7 KB

Reference

client.ListIndexesAsync() -> IndexList

📝 Description

This operation returns a list of all indexes in a project.

🔌 Usage

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

📝 Description

This operation deploys 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 = CreateIndexRequestMetric.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

This operation deletes 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

This operation configures an existing index.

For serverless indexes, you can configure only index deletion protection and tags. 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

This operation returns a list of all collections in a project. Serverless indexes do not support collections.

🔌 Usage

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

📝 Description

This operation creates 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.DescribeCollectionAsync(collectionName) -> CollectionModel

📝 Description

This operation gets 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

This operation deletes an existing collection. Serverless indexes do not support collections.

🔌 Usage

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

⚙️ Parameters

collectionName: string — The name of the collection.

Index

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

📝 Description

The list_imports operation lists all recent and ongoing import operations. For guidance and examples, see Import data.

🔌 Usage

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

⚙️ Parameters

request: ListBulkImportsRequest

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

📝 Description

The start_import operation starts 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

The describe_import operation returns details of a specific import operation. For guidance and examples, see Import data.

🔌 Usage

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

⚙️ Parameters

id: string

client.Index.CancelBulkImportAsync(id) -> CancelImportResponse

📝 Description

The cancel_import operation cancels 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

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

📝 Description

Get index stats

The describe_index_stats operation returns 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.

For pod-based indexes, the index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use describe_index.

🔌 Usage

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

⚙️ Parameters

request: DescribeIndexStatsRequest

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

📝 Description

Query vectors

The query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

For guidance and examples, see Query data.

🔌 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

The delete operation deletes 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

The fetch operation looks up and returns 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

The list operation lists 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.

list 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

The update operation updates 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

The upsert operation writes 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 embeddings for input data.

For guidance and examples, see Generate embeddings.

🔌 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 items according to their relevance to a query.

For guidance and examples, see Rerank documents.

🔌 Usage

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

⚙️ Parameters

request: RerankRequest