Skip to content

Commit

Permalink
Fix heading hierarchy
Browse files Browse the repository at this point in the history
We had multiple h1 headings.
  • Loading branch information
jseldess committed Aug 8, 2024
1 parent c3d885d commit c5d49fa
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Pinecone Python SDK
# Pinecone Python SDK

![License](https://img.shields.io/github/license/pinecone-io/pinecone-python-client?color=orange) [![CI](https://github.com/pinecone-io/pinecone-python-client/actions/workflows/pr.yaml/badge.svg)](https://github.com/pinecone-io/pinecone-python-client/actions/workflows/pr.yaml)

The official Pinecone Python SDK.
Expand Down Expand Up @@ -193,9 +194,7 @@ index.upsert(vectors=[])
index.query(vector=[...], top_key=10)
```

# Indexes

## Create Index
## Indexes

### Create a serverless index

Expand Down Expand Up @@ -264,7 +263,7 @@ pc.create_index(
)
```

## List indexes
### List indexes

The following example returns all indexes in your project.

Expand All @@ -276,7 +275,7 @@ for index in pc.list_indexes():
print(index['name'])
```

## Describe index
### Describe index

The following example returns information about the index `example-index`.

Expand All @@ -288,7 +287,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
index_description = pc.describe_index("example-index")
```

## Delete an index
### Delete an index

The following example deletes the index named `example-index`. Only indexes which are not protected by deletion protection may be deleted.

Expand All @@ -300,7 +299,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
pc.delete_index("example-index")
```

## Scale replicas
### Scale replicas

The following example changes the number of replicas for `example-index`.

Expand All @@ -313,7 +312,7 @@ new_number_of_replicas = 4
pc.configure_index("example-index", replicas=new_number_of_replicas)
```

## Configuring deletion protection
### Configuring deletion protection

If you would like to enable deletion protection, which prevents an index from being deleted, the `configure_index` method also handles that via an optional `deletion_protection` keyword argument.

Expand All @@ -333,7 +332,7 @@ desc = pc.describe_index("example-index")
print(desc.deletion_protection)
```

## Describe index statistics
### Describe index statistics

The following example returns statistics about the index `example-index`.

Expand All @@ -347,7 +346,7 @@ index = pc.Index(host=os.environ.get('INDEX_HOST'))
index_stats_response = index.describe_index_stats()
```

## Upsert vectors
### Upsert vectors

The following example upserts vectors to `example-index`.

Expand All @@ -367,7 +366,7 @@ upsert_response = index.upsert(
)
```

## Query an index
### Query an index

The following example queries the index `example-index` with metadata
filtering.
Expand All @@ -394,7 +393,7 @@ query_response = index.query(
)
```

## Delete vectors
### Delete vectors

The following example deletes vectors by ID.

Expand All @@ -411,7 +410,7 @@ index = pc.Index(host=os.environ.get('INDEX_HOST'))
delete_response = index.delete(ids=["vec1", "vec2"], namespace="example-namespace")
```

## Fetch vectors
### Fetch vectors

The following example fetches vectors by ID.

Expand All @@ -428,7 +427,7 @@ index = pc.Index(host=os.environ.get('INDEX_HOST'))
fetch_response = index.fetch(ids=["vec1", "vec2"], namespace="example-namespace")
```

## Update vectors
### Update vectors

The following example updates vectors by ID.

Expand All @@ -449,7 +448,7 @@ update_response = index.update(
)
```

## List vectors
### List vectors

The `list` and `list_paginated` methods can be used to list vector ids matching a particular id prefix.
With clever assignment of vector ids, this can be used to help model hierarchical relationships between
Expand Down Expand Up @@ -494,9 +493,9 @@ print(results.pagination.next) # 'eyJza2lwX3Bhc3QiOiI5IiwicHJlZml4IjpudWxsfQ=='
print(results.usage) # { 'read_units': 1 }
```

# Collections
## Collections

## Create collection
### Create collection

The following example creates the collection `example-collection` from
`example-index`.
Expand All @@ -512,7 +511,7 @@ pc.create_collection(
)
```

## List collections
### List collections

The following example returns a list of the collections in the current project.

Expand All @@ -524,7 +523,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
active_collections = pc.list_collections()
```

## Describe a collection
### Describe a collection

The following example returns a description of the collection
`example-collection`.
Expand All @@ -537,7 +536,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
collection_description = pc.describe_collection("example-collection")
```

## Delete a collection
### Delete a collection

The following example deletes the collection `example-collection`.

Expand All @@ -549,7 +548,7 @@ pc = Pinecone(api_key='<<PINECONE_API_KEY>>')
pc.delete_collection("example-collection")
```

# Inference API
## Inference API

The Pinecone SDK now supports creating embeddings via the [Inference API](https://docs.pinecone.io/guides/inference/understanding-inference).

Expand Down Expand Up @@ -583,6 +582,6 @@ query_embeddings = pc.inference.embed(
# Send query to Pinecone index to retrieve similar documents
```

# Contributing
## Contributing

If you'd like to make a contribution, or get setup locally to develop the Pinecone Python SDK, please see our [contributing guide](https://github.com/pinecone-io/pinecone-python-client/blob/main/CONTRIBUTING.md)

0 comments on commit c5d49fa

Please sign in to comment.