pub struct LarkBitableLoader { /* private fields */ }Expand description
Load Feishu/Lark Bitable records into Synaptic Documents for RAG pipelines.
Each Bitable record becomes one Document. The content field is populated from
the field named by [with_content_field], or the first string-typed field when
no explicit field is given. All other fields are stored in metadata.
§Example
use synaptic_lark::{LarkConfig, LarkBitableLoader};
use synaptic_core::Loader;
let config = LarkConfig::new("cli_xxx", "secret_xxx");
let loader = LarkBitableLoader::new(config)
.with_app("bascnAbcXxx")
.with_table("tblXxx")
.with_content_field("Description");
let docs = loader.load().await?;
for doc in &docs {
println!("Record: {}", doc.id);
println!("Content: {}", doc.content);
}Implementations§
Source§impl LarkBitableLoader
impl LarkBitableLoader
Sourcepub fn new(config: LarkConfig) -> Self
pub fn new(config: LarkConfig) -> Self
Create a new loader using the given config.
Sourcepub fn with_app(self, app_token: impl Into<String>) -> Self
pub fn with_app(self, app_token: impl Into<String>) -> Self
Set the Bitable app token (e.g. "bascnAbcXxx").
Sourcepub fn with_table(self, table_id: impl Into<String>) -> Self
pub fn with_table(self, table_id: impl Into<String>) -> Self
Set the table ID within the Bitable app (e.g. "tblXxx").
Sourcepub fn with_view(self, view_id: impl Into<String>) -> Self
pub fn with_view(self, view_id: impl Into<String>) -> Self
Optionally filter records by a specific view (e.g. "vewXxx").
Sourcepub fn with_content_field(self, field: impl Into<String>) -> Self
pub fn with_content_field(self, field: impl Into<String>) -> Self
Specify which field’s value becomes the Document.content.
When not set, the first string-typed field is used automatically.
Sourcepub fn content_field(&self) -> Option<&str>
pub fn content_field(&self) -> Option<&str>
Returns the configured content field name if any.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LarkBitableLoader
impl !RefUnwindSafe for LarkBitableLoader
impl Send for LarkBitableLoader
impl Sync for LarkBitableLoader
impl Unpin for LarkBitableLoader
impl UnsafeUnpin for LarkBitableLoader
impl !UnwindSafe for LarkBitableLoader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more