-
Notifications
You must be signed in to change notification settings - Fork 0
Fix CI Sync Workflow and Rand API Migration #725
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ use std::sync::Arc; | |
| use tokio::sync::OnceCell; | ||
|
|
||
| /// Record type for SurrealDB serialization. | ||
| #[derive(Debug, Serialize, Deserialize)] | ||
| #[derive(Debug, Serialize, Deserialize, surrealdb::SurrealValue)] | ||
| struct MemoryRecord { | ||
| content: String, | ||
| layer: u8, | ||
|
|
@@ -55,7 +55,7 @@ pub struct SurrealDbAdapter { | |
| impl SurrealDbAdapter { | ||
| /// Create a new SurrealDB adapter with file-based persistent storage. | ||
| /// | ||
| /// # Arguments | ||
| /// #[derive(Debug, Deserialize, surrealdb::SurrealValue)]Arguments | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| /// * `path` - Path to the database directory (uses SurrealKV backend) | ||
| /// | ||
| /// This uses the SurrealKV embedded storage engine for persistence. | ||
|
|
@@ -221,6 +221,23 @@ impl MemoryPort for SurrealDbAdapter { | |
| .await | ||
| .map_err(|e| Error::System(format!("Search failed: {}", e)))?; | ||
|
|
||
| #[derive(Debug, Deserialize, surrealdb::SurrealValue)] | ||
| struct VectorSearchResult { | ||
| id: Thing, | ||
| content: String, | ||
| layer: u8, | ||
| node_type: String, | ||
| created_at: i64, | ||
| updated_at: i64, | ||
| embedding: Vec<f32>, | ||
| metadata: String, | ||
| namespace: String, | ||
| source: String, | ||
| holographic_data: Option<Vec<u8>>, | ||
| loop_level: u8, | ||
| distance: f32, | ||
| } | ||
|
Comment on lines
+224
to
+239
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Consider moving this struct definition to the module level, possibly by modifying the existing |
||
|
|
||
| let results: Vec<VectorSearchResult> = response | ||
| .take(0) | ||
| .map_err(|e| Error::System(format!("Failed to parse results: {}", e)))?; | ||
|
|
@@ -282,6 +299,23 @@ impl MemoryPort for SurrealDbAdapter { | |
| .await | ||
| .map_err(|e| Error::System(format!("Search layer failed: {}", e)))?; | ||
|
|
||
| #[derive(Debug, Deserialize, surrealdb::SurrealValue)] | ||
| struct VectorSearchResult { | ||
| id: Thing, | ||
| content: String, | ||
| layer: u8, | ||
| node_type: String, | ||
| created_at: i64, | ||
| updated_at: i64, | ||
| embedding: Vec<f32>, | ||
| metadata: String, | ||
| namespace: String, | ||
| source: String, | ||
| holographic_data: Option<Vec<u8>>, | ||
| loop_level: u8, | ||
| distance: f32, | ||
| } | ||
|
|
||
| let results: Vec<VectorSearchResult> = response | ||
| .take(0) | ||
| .map_err(|e| Error::System(format!("Failed to parse results: {}", e)))?; | ||
|
|
@@ -341,6 +375,23 @@ impl MemoryPort for SurrealDbAdapter { | |
| .await | ||
| .map_err(|e| Error::System(format!("Search namespace failed: {}", e)))?; | ||
|
|
||
| #[derive(Debug, Deserialize, surrealdb::SurrealValue)] | ||
| struct VectorSearchResult { | ||
| id: Thing, | ||
| content: String, | ||
| layer: u8, | ||
| node_type: String, | ||
| created_at: i64, | ||
| updated_at: i64, | ||
| embedding: Vec<f32>, | ||
| metadata: String, | ||
| namespace: String, | ||
| source: String, | ||
| holographic_data: Option<Vec<u8>>, | ||
| loop_level: u8, | ||
| distance: f32, | ||
| } | ||
|
|
||
| let results: Vec<VectorSearchResult> = response | ||
| .take(0) | ||
| .map_err(|e| Error::System(format!("Failed to parse results: {}", e)))?; | ||
|
|
@@ -392,7 +443,7 @@ impl MemoryPort for SurrealDbAdapter { | |
| .await | ||
| .map_err(|e| Error::System(format!("Get by layer failed: {}", e)))?; | ||
|
|
||
| #[derive(Deserialize)] | ||
| #[derive(Deserialize, surrealdb::SurrealValue)] | ||
| struct LayerResult { | ||
| id: Thing, | ||
| content: String, | ||
|
|
@@ -524,6 +575,21 @@ impl MemoryPort for SurrealDbAdapter { | |
| .await | ||
| .map_err(|e| Error::System(format!("Search all failed: {}", e)))?; | ||
|
|
||
| #[derive(Debug, Serialize, Deserialize, surrealdb::SurrealValue)] | ||
| struct MemoryRecord { | ||
| content: String, | ||
| layer: u8, | ||
| node_type: String, | ||
| created_at: i64, | ||
| updated_at: i64, | ||
| embedding: Vec<f32>, | ||
| metadata: String, // JSON serialized | ||
| namespace: String, | ||
| source: String, | ||
| holographic_data: Option<Vec<u8>>, | ||
| loop_level: u8, | ||
| } | ||
|
Comment on lines
+578
to
+591
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| let results: Vec<MemoryRecord> = response | ||
| .take(0) | ||
| .map_err(|e| Error::System(format!("Failed to parse search results: {}", e)))?; | ||
|
|
@@ -542,7 +608,7 @@ impl MemoryPort for SurrealDbAdapter { | |
| .await | ||
| .map_err(|e| Error::System(e.to_string()))?; | ||
|
|
||
| #[derive(Deserialize)] | ||
| #[derive(Deserialize, surrealdb::SurrealValue)] | ||
| struct RecordWithId { | ||
| id: Thing, | ||
| content: String, | ||
|
|
@@ -587,7 +653,7 @@ impl MemoryPort for SurrealDbAdapter { | |
| let sql = "SELECT * FROM memory_node ORDER BY created_at DESC LIMIT 1"; | ||
| let mut response = self.db.query(sql).await.map_err(|e| Error::System(e.to_string()))?; | ||
|
|
||
| #[derive(Deserialize)] | ||
| #[derive(Deserialize, surrealdb::SurrealValue)] | ||
| struct RecordWithId { | ||
| id: Thing, | ||
| content: String, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method
random_rangedoes not appear to be a valid method on therand::Rngtrait. The correct method for generating a value within a range isgen_range. Usingrandom_rangewill likely result in a compilation error.