Skip to content

Commit

Permalink
improve README for control plane usage
Browse files Browse the repository at this point in the history
  • Loading branch information
haruska committed Mar 15, 2024
1 parent f391ac7 commit bcc1b08
Showing 1 changed file with 58 additions and 3 deletions.
61 changes: 58 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,71 @@
Official Pinecone Go Client

## Features
go-pinecone contains gRPC bindings for all Pinecone vector plane operations: list, upsert, fetch, query, delete, and info.
go-pinecone contains

It notably does *not* yet support Index management (creating, deleting Pinecone indexes.)
* gRPC bindings for Data Plane operations on Vectors
* REST bindings for Control Plane operations on Indexes and Collections

See [Pinecone API Docs](https://docs.pinecone.io/reference/) for more info.


## Installation
go-pinecone requires a Go version with [modules](https://github.com/golang/go/wiki/Modules) support.

To add a dependency on go-pinecone:
```shell
go get github.com/pinecone-io/go-pinecone
go get github.com/pinecone-io/go-pinecone/pinecone
```

## Usage

```go
package main

import (
"context"
"fmt"
"github.com/pinecone-io/go-pinecone/pinecone"
)

func main() {
ctx := context.Background()

pc, err := pinecone.NewClient(pinecone.NewClientParams{
ApiKey: "api-key",
})

if err != nil {
fmt.Println("Error:", err)
return
}

idxs, err := pc.ListIndexes(ctx)
if err != nil {
fmt.Println("Error:", err)
return
}

for _, index := range idxs {
fmt.Println(index)
}

idx, err := pc.Index(idxs[0].Host)
defer idx.Close()

if err != nil {
fmt.Println("Error:", err)
return
}

res, err := idx.DescribeIndexStats(&ctx)
if err != nil {
fmt.Println("Error:", err)
return
}

fmt.Println(res)
}
```

## Support
Expand Down

0 comments on commit bcc1b08

Please sign in to comment.