pub struct NlpServerClient<T> { /* private fields */ }Expand description
NLPServer provides the interface for various NLP functionalities. These functions include text processing, content management in projects, and interaction with vectorized data structures.
Implementations§
Source§impl<T> NlpServerClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> NlpServerClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> NlpServerClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn get_functions(
&mut self,
request: impl IntoRequest<FunctionRequest>,
) -> Result<Response<Streaming<Function>>, Status>
pub async fn get_functions( &mut self, request: impl IntoRequest<FunctionRequest>, ) -> Result<Response<Streaming<Function>>, Status>
§GetFunctions
Returns all available processing functions (models) of the server. Each function includes a unique ID, a descriptive name, a description, and a list of possible arguments.
Request: FunctionRequest Response: stream Function
Sourcepub async fn run_functions(
&mut self,
request: impl IntoRequest<RunFunctionsRequest>,
) -> Result<Response<RunFunctionsResponse>, Status>
pub async fn run_functions( &mut self, request: impl IntoRequest<RunFunctionsRequest>, ) -> Result<Response<RunFunctionsResponse>, Status>
§RunFunctions
Processes the provided raw text using the specified functions. Multiple functions can be applied sequentially.
Request: RunFunctionsRequest
- functions: List of functions to apply.
- input: The raw text to process.
- arguments: Additional parameters. Response: RunFunctionsResponse (contains the processed text result)
Sourcepub async fn update_content(
&mut self,
request: impl IntoRequest<UpdateContentRequest>,
) -> Result<Response<UpdateContentResponse>, Status>
pub async fn update_content( &mut self, request: impl IntoRequest<UpdateContentRequest>, ) -> Result<Response<UpdateContentResponse>, Status>
§UpdateContent
Adds new content or updates existing content.
Request: UpdateContentRequest Response: UpdateContentResponse
Sourcepub async fn remove_content(
&mut self,
request: impl IntoRequest<RemoveContentRequest>,
) -> Result<Response<RemoveContentResponse>, Status>
pub async fn remove_content( &mut self, request: impl IntoRequest<RemoveContentRequest>, ) -> Result<Response<RemoveContentResponse>, Status>
§RemoveContent
Removes the specified content.
Request: RemoveContentRequest Response: RemoveContentResponse
Sourcepub async fn get_content(
&mut self,
request: impl IntoRequest<GetContentRequest>,
) -> Result<Response<Streaming<GetContentResponse>>, Status>
pub async fn get_content( &mut self, request: impl IntoRequest<GetContentRequest>, ) -> Result<Response<Streaming<GetContentResponse>>, Status>
§GetContent
Retrieves content that is available both as vectorized data and as plain text.
Request: GetContentRequest Response: stream GetContentResponse
Sourcepub async fn add_project(
&mut self,
request: impl IntoRequest<AddProjectRequest>,
) -> Result<Response<AddProjectResponse>, Status>
pub async fn add_project( &mut self, request: impl IntoRequest<AddProjectRequest>, ) -> Result<Response<AddProjectResponse>, Status>
Sourcepub async fn remove_project(
&mut self,
request: impl IntoRequest<RemoveProjectRequest>,
) -> Result<Response<RemoveProjectResponse>, Status>
pub async fn remove_project( &mut self, request: impl IntoRequest<RemoveProjectRequest>, ) -> Result<Response<RemoveProjectResponse>, Status>
§RemoveProject
Removes an existing project and all associated content.
Request: RemoveProjectRequest Response: RemoveProjectResponse
Sourcepub async fn update_project(
&mut self,
request: impl IntoRequest<UpdateProjectRequest>,
) -> Result<Response<UpdateProjectResponse>, Status>
pub async fn update_project( &mut self, request: impl IntoRequest<UpdateProjectRequest>, ) -> Result<Response<UpdateProjectResponse>, Status>
§UpdateProject
Updates the settings or configuration of an existing project.
Request: UpdateProjectRequest Response: UpdateProjectResponse
Sourcepub async fn get_projects(
&mut self,
request: impl IntoRequest<GetProjectsRequest>,
) -> Result<Response<Streaming<Project>>, Status>
pub async fn get_projects( &mut self, request: impl IntoRequest<GetProjectsRequest>, ) -> Result<Response<Streaming<Project>>, Status>
Sourcepub async fn get_intents(
&mut self,
request: impl IntoRequest<GetIntentsRequest>,
) -> Result<Response<Streaming<Intent>>, Status>
pub async fn get_intents( &mut self, request: impl IntoRequest<GetIntentsRequest>, ) -> Result<Response<Streaming<Intent>>, Status>
Sourcepub async fn get_score_limits(
&mut self,
request: impl IntoRequest<GetScoreLimitsRequest>,
) -> Result<Response<GetScoreLimitsResponse>, Status>
pub async fn get_score_limits( &mut self, request: impl IntoRequest<GetScoreLimitsRequest>, ) -> Result<Response<GetScoreLimitsResponse>, Status>
§GetScoreLimits
Determines score limits for a project based on test inputs.
Request: GetScoreLimitsRequest Response: GetScoreLimitsResponse
Sourcepub async fn get_embedding_models(
&mut self,
request: impl IntoRequest<GetEmbeddingModelsRequest>,
) -> Result<Response<Streaming<EmbeddingModel>>, Status>
pub async fn get_embedding_models( &mut self, request: impl IntoRequest<GetEmbeddingModelsRequest>, ) -> Result<Response<Streaming<EmbeddingModel>>, Status>
§GetEmbeddingModels
Returns a list of available embedding models for similarity searches.
Request: GetEmbeddingModelsRequest Response: stream EmbeddingModel
pub async fn sync_d_bs( &mut self, request: impl IntoRequest<SyncDBsRequest>, ) -> Result<Response<SyncDBsResponse>, Status>
Trait Implementations§
Source§impl<T: Clone> Clone for NlpServerClient<T>
impl<T: Clone> Clone for NlpServerClient<T>
Source§fn clone(&self) -> NlpServerClient<T>
fn clone(&self) -> NlpServerClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for NlpServerClient<T>
impl<T> RefUnwindSafe for NlpServerClient<T>where
T: RefUnwindSafe,
impl<T> Send for NlpServerClient<T>where
T: Send,
impl<T> Sync for NlpServerClient<T>where
T: Sync,
impl<T> Unpin for NlpServerClient<T>where
T: Unpin,
impl<T> UnwindSafe for NlpServerClient<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
T in a tonic::Request