Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #51

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ readme = "./README.md"
license = "Apache-2.0"
keywords = ["pinecone", "vector", "database", "cloud", "vectordb"]
categories = ["api-bindings", "database"]
exclude = ["tests/*"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let pinecone: PineconeClient = config.client().expect("Failed to create Pinecone
```

### Default client
Use the `default_client()` function, which is the equivalent of constructing a `PineconeClientConfig` struct with all fields set to `None`. Configuration values will be read from environment variables.
Use the `default_client()` function, which is the equivalent of constructing a `PineconeClientConfig` struct with all fields set to `None`. The API key and control plane host (optional) will be read from environment variables.
```rust
let pinecone: PineconeClient = pinecone_sdk::pinecone::default_client().expect("Failed to create Pinecone instance");
```
Expand Down Expand Up @@ -390,7 +390,7 @@ let pinecone = config.client()?;

let mut index = pinecone.index("index-host").await?;

let vectors = &["1".to_string(), "2".to_string()];
let vectors = &["1", "2"];

let response: FetchResponse = index.fetch(vectors, &Default::default()).await?;
```
Expand Down Expand Up @@ -490,4 +490,4 @@ pinecone.delete_collection("collection-name").await?;
```

# Contributing
If you'd like to make a contribution, or get setup locally to develop the Pinecone Rust client, please see our [contributing guide](https://github.com/pinecone-io/pinecone-rust-client/blob/emily/update-readme/CONTRIBUTING.md)
If you'd like to make a contribution, or get setup locally to develop the Pinecone Rust client, please see our [contributing guide](https://github.com/pinecone-io/pinecone-rust-client/blob/emily/update-readme/CONTRIBUTING.md)
2 changes: 1 addition & 1 deletion codegen/apis
Submodule apis updated from 062b11 to 4de445
16 changes: 9 additions & 7 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ mod embedding;
pub use self::embedding::Embedding;

pub use crate::openapi::models::{
serverless_spec::Cloud, CollectionList, CollectionModel, ConfigureIndexRequest,
ConfigureIndexRequestSpec, ConfigureIndexRequestSpecPod, CreateCollectionRequest,
DeletionProtection, EmbedRequestParameters, IndexModelSpec, IndexModelStatus, IndexSpec,
PodSpec, PodSpecMetadataConfig, ServerlessSpec,
index_model_status::State, serverless_spec::Cloud, CollectionList, CollectionModel,
ConfigureIndexRequest, ConfigureIndexRequestSpec, ConfigureIndexRequestSpecPod,
CreateCollectionRequest, DeletionProtection, EmbedRequestParameters, IndexModelSpec,
IndexModelStatus, IndexSpec, PodSpec, PodSpecMetadataConfig, ServerlessSpec,
};

pub use crate::protos::{DescribeIndexStatsResponse, FetchResponse, ListResponse, QueryResponse, SparseValues,
UpdateResponse, UpsertResponse, Vector};
pub use crate::protos::{
DescribeIndexStatsResponse, FetchResponse, ListResponse, QueryResponse, SparseValues,
UpdateResponse, UpsertResponse, Vector,
};

pub use prost_types::{value::Kind as Kind, Struct as Metadata, Value};
pub use prost_types::{value::Kind, Struct as Metadata, Value};
4 changes: 3 additions & 1 deletion tests/integration_test_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ async fn test_create_delete_collection() -> Result<(), PineconeError> {
let index_name = &get_pod_index();
loop {
if match pinecone.describe_index(index_name).await {
Ok(index) => index.status.ready,
Ok(index) => {
index.status.ready && (index.status.state == pinecone_sdk::models::State::Ready)
}
Err(_) => false,
} {
break;
Expand Down
Loading