Skip to content

Commit

Permalink
fix: add feature flag to examples in mongodb and lancedb crates
Browse files Browse the repository at this point in the history
  • Loading branch information
marieaurore123 committed Oct 18, 2024
1 parent 3bb2231 commit 3688b78
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ resolver = "2"
members = [
"rig-core", "rig-core/rig-core-derive",
"rig-mongodb",
"rig-lancedb"
]
"rig-lancedb"]
18 changes: 17 additions & 1 deletion rig-lancedb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
lancedb = "0.10.0"
rig-core = { path = "../rig-core", version = "0.2.1", features = ["derive"] }
rig-core = { path = "../rig-core", version = "0.2.1" }
arrow-array = "52.2.0"
serde_json = "1.0.128"
serde = "1.0.210"
Expand All @@ -14,3 +14,19 @@ futures = "0.3.30"
[dev-dependencies]
tokio = "1.40.0"
anyhow = "1.0.89"

[[example]]
name = "fixtures"
required-features = ["rig-core/derive"]

[[example]]
name = "vector_search_local_ann"
required-features = ["rig-core/derive"]

[[example]]
name = "vector_search_local_enn"
required-features = ["rig-core/derive"]

[[example]]
name = "vector_search_s3_ann"
required-features = ["rig-core/derive"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::Arc;

use arrow_array::{types::Float64Type, ArrayRef, FixedSizeListArray, RecordBatch, StringArray};
use lancedb::arrow::arrow_schema::{DataType, Field, Fields, Schema};
use rig::embeddings::embedding::Embedding;
use rig::embeddings::Embedding;
use rig::{Embeddable, OneOrMany};
use serde::Deserialize;

Expand Down
2 changes: 1 addition & 1 deletion rig-lancedb/examples/vector_search_local_ann.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rig::{
};
use rig_lancedb::{LanceDbVectorStore, SearchParams};

#[path = "./fixtures/lib.rs"]
#[path = "./fixtures/main.rs"]
mod fixture;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion rig-lancedb/examples/vector_search_local_enn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rig::{
};
use rig_lancedb::{LanceDbVectorStore, SearchParams};

#[path = "./fixtures/lib.rs"]
#[path = "./fixtures/main.rs"]
mod fixture;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion rig-lancedb/examples/vector_search_s3_ann.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rig::{
};
use rig_lancedb::{LanceDbVectorStore, SearchParams};

#[path = "./fixtures/lib.rs"]
#[path = "./fixtures/main.rs"]
mod fixture;

// Note: see docs to deploy LanceDB on other cloud providers such as google and azure.
Expand Down
6 changes: 5 additions & 1 deletion rig-mongodb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/0xPlaygrounds/rig"
[dependencies]
futures = "0.3.30"
mongodb = "2.8.2"
rig-core = { path = "../rig-core", version = "0.2.1", features = ["derive"] }
rig-core = { path = "../rig-core", version = "0.2.1" }

serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
Expand All @@ -21,3 +21,7 @@ tracing = "0.1.40"
[dev-dependencies]
anyhow = "1.0.86"
tokio = { version = "1.38.0", features = ["macros"] }

[[example]]
name = "vector_search_mongodb"
required-features = ["rig-core/derive"]

0 comments on commit 3688b78

Please sign in to comment.