pub struct KnowledgeClient { /* private fields */ }Expand description
gRPC client for interacting with the knowledge base server.
Implementations§
Source§impl KnowledgeClient
impl KnowledgeClient
Sourcepub async fn connect(addr: impl Into<String>) -> Result<Self>
pub async fn connect(addr: impl Into<String>) -> Result<Self>
Connect to a knowledge base server.
Sourcepub async fn add_entry(
&mut self,
title: impl Into<String>,
content: impl Into<String>,
) -> Result<String>
pub async fn add_entry( &mut self, title: impl Into<String>, content: impl Into<String>, ) -> Result<String>
Add a new knowledge entry.
Sourcepub async fn add_entry_full(
&mut self,
request: AddEntryRequest,
) -> Result<String>
pub async fn add_entry_full( &mut self, request: AddEntryRequest, ) -> Result<String>
Add entry with full options.
Sourcepub async fn add_entries(
&mut self,
entries: Vec<AddEntryRequest>,
) -> Result<Vec<String>>
pub async fn add_entries( &mut self, entries: Vec<AddEntryRequest>, ) -> Result<Vec<String>>
Add multiple entries in batch.
Sourcepub async fn get_entry(
&mut self,
id: impl Into<String>,
) -> Result<Option<KnowledgeEntry>>
pub async fn get_entry( &mut self, id: impl Into<String>, ) -> Result<Option<KnowledgeEntry>>
Get an entry by ID.
Sourcepub async fn update_entry(&mut self, request: UpdateEntryRequest) -> Result<()>
pub async fn update_entry(&mut self, request: UpdateEntryRequest) -> Result<()>
Update an existing entry.
Sourcepub async fn search(
&mut self,
query: impl Into<String>,
limit: u32,
) -> Result<Vec<SearchResult>>
pub async fn search( &mut self, query: impl Into<String>, limit: u32, ) -> Result<Vec<SearchResult>>
Search for similar entries.
Sourcepub async fn search_full(
&mut self,
request: SearchRequest,
) -> Result<SearchResponse>
pub async fn search_full( &mut self, request: SearchRequest, ) -> Result<SearchResponse>
Search with full options.
Sourcepub async fn record_feedback(
&mut self,
entry_id: impl Into<String>,
positive: bool,
) -> Result<()>
pub async fn record_feedback( &mut self, entry_id: impl Into<String>, positive: bool, ) -> Result<()>
Record feedback on a search result.
Get related entries.
Sourcepub async fn link_entries(
&mut self,
id1: impl Into<String>,
id2: impl Into<String>,
) -> Result<()>
pub async fn link_entries( &mut self, id1: impl Into<String>, id2: impl Into<String>, ) -> Result<()>
Link two entries as related.
Sourcepub async fn get_stats(&mut self) -> Result<GetStatsResponse>
pub async fn get_stats(&mut self) -> Result<GetStatsResponse>
Get knowledge base statistics.
Sourcepub async fn health(&mut self) -> Result<HealthResponse>
pub async fn health(&mut self) -> Result<HealthResponse>
Health check.
Auto Trait Implementations§
impl !Freeze for KnowledgeClient
impl !RefUnwindSafe for KnowledgeClient
impl Send for KnowledgeClient
impl Sync for KnowledgeClient
impl Unpin for KnowledgeClient
impl UnsafeUnpin for KnowledgeClient
impl !UnwindSafe for KnowledgeClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request