Skip to content

Commit ee2f0eb

Browse files
committed
rocksdb
1 parent fdd7cd1 commit ee2f0eb

File tree

7 files changed

+599
-189
lines changed

7 files changed

+599
-189
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rust-analyzer.cargo.allFeatures": true,
3+
}

Cargo.lock

Lines changed: 116 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ num-traits = "0.2.17"
3535
bounded-integer = { version = "0.5.7", features = ["types", "num-traits02"] }
3636
aquamarine = "0.3.2"
3737
tiktoken-rs = "0.5.8"
38+
clap = "4.5.18"
39+
num_cpus = "1.16.0"
40+
lazy_static = "1.5.0"
3841

3942
[dev-dependencies]
4043
futures = "0.3"

src/loom.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::{
1515
/// that needs to prompt LLM and receive a response.
1616
///
1717
/// This is implemented over the [`Config`] trait.
18+
#[derive(Debug)]
1819
pub struct Loom<T: Config> {
1920
pub chest: T::Chest,
2021
_phantom: PhantomData<T>,
@@ -248,7 +249,7 @@ impl<T: Config> Loom<T> {
248249
}
249250

250251
/// Helper method to build a [`ContextMessage`]
251-
fn build_context_message(
252+
pub fn build_context_message(
252253
role: WrapperRole,
253254
content: String,
254255
account_id: Option<String>,

src/mock.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ impl TapestryChestHandler<MockConfig> for MockChest {
3535
Ok(())
3636
}
3737

38-
async fn get_tapestry<TID: TapestryId>(&self, _tapestry_id: TID) -> crate::Result<Option<u16>> {
38+
async fn get_instance_index<TID: TapestryId>(
39+
&self,
40+
_tapestry_id: TID,
41+
) -> crate::Result<Option<u16>> {
3942
Ok(Some(0))
4043
}
4144

src/storage/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ pub trait TapestryChestHandler<T: Config> {
5050
tapestry_id: TID,
5151
metadata: M,
5252
) -> crate::Result<()>;
53-
/// Retrieves the number of instances of a tapestry.
53+
/// Retrieves the index of a tapestry.
5454
///
5555
/// Returns None if the tapestry does not exist.
56-
async fn get_tapestry<TID: TapestryId>(&self, tapestry_id: TID) -> crate::Result<Option<u16>>;
56+
async fn get_instance_index<TID: TapestryId>(
57+
&self,
58+
tapestry_id: TID,
59+
) -> crate::Result<Option<u16>>;
5760
/// Retrieves the last tapestry fragment, or a fragment at a specified instance.
5861
///
5962
/// # Parameters

0 commit comments

Comments
 (0)