Skip to main content

KnowledgeService

Trait KnowledgeService 

Source
pub trait KnowledgeService:
    Send
    + Sync
    + 'static {
    type SearchStreamStream: Stream<Item = Result<SearchResult, Status>> + Send + 'static;

    // Required methods
    fn add_entry<'life0, 'async_trait>(
        &'life0 self,
        request: Request<AddEntryRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<AddEntryResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_entries<'life0, 'async_trait>(
        &'life0 self,
        request: Request<AddEntriesRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<AddEntriesResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_entry<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetEntryRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetEntryResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_entry<'life0, 'async_trait>(
        &'life0 self,
        request: Request<UpdateEntryRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<UpdateEntryResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_entry<'life0, 'async_trait>(
        &'life0 self,
        request: Request<DeleteEntryRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<DeleteEntryResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SearchRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<SearchResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search_stream<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SearchRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SearchStreamStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn record_feedback<'life0, 'async_trait>(
        &'life0 self,
        request: Request<FeedbackRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<FeedbackResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_related<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetRelatedRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetRelatedResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn link_entries<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LinkEntriesRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<LinkEntriesResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_stats<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetStatsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<GetStatsResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn health<'life0, 'async_trait>(
        &'life0 self,
        request: Request<HealthRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<HealthResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with KnowledgeServiceServer.

Required Associated Types§

Source

type SearchStreamStream: Stream<Item = Result<SearchResult, Status>> + Send + 'static

Server streaming response type for the SearchStream method.

Required Methods§

Source

fn add_entry<'life0, 'async_trait>( &'life0 self, request: Request<AddEntryRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AddEntryResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a new knowledge entry

Source

fn add_entries<'life0, 'async_trait>( &'life0 self, request: Request<AddEntriesRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<AddEntriesResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add multiple entries in batch

Source

fn get_entry<'life0, 'async_trait>( &'life0 self, request: Request<GetEntryRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetEntryResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get an entry by ID

Source

fn update_entry<'life0, 'async_trait>( &'life0 self, request: Request<UpdateEntryRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<UpdateEntryResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update an existing entry

Source

fn delete_entry<'life0, 'async_trait>( &'life0 self, request: Request<DeleteEntryRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<DeleteEntryResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete an entry

Source

fn search<'life0, 'async_trait>( &'life0 self, request: Request<SearchRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<SearchResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search for similar entries

Source

fn search_stream<'life0, 'async_trait>( &'life0 self, request: Request<SearchRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SearchStreamStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream search results

Source

fn record_feedback<'life0, 'async_trait>( &'life0 self, request: Request<FeedbackRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<FeedbackResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record user feedback on a result

Get related entries

Link two entries as related

Source

fn get_stats<'life0, 'async_trait>( &'life0 self, request: Request<GetStatsRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<GetStatsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get knowledge base statistics

Source

fn health<'life0, 'async_trait>( &'life0 self, request: Request<HealthRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<HealthResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Health check

Implementors§