pub struct LanguageClient {
pub discuss_service: DiscussServiceClient<InterceptedService<Channel, Authentication>>,
pub model_service: ModelServiceClient<InterceptedService<Channel, Authentication>>,
pub text_service: TextServiceClient<InterceptedService<Channel, Authentication>>,
}
Expand description
Generative Language client.
Fields§
§discuss_service: DiscussServiceClient<InterceptedService<Channel, Authentication>>
The Discuss service client. In particular, this client is used for
DiscussServiceClient::count_message_tokens
and
DiscussServiceClient::generate_message
.
model_service: ModelServiceClient<InterceptedService<Channel, Authentication>>
The Model service client. Notably, this client is used for
ModelServiceClient::list_models
and
ModelServiceClient::get_model
.
text_service: TextServiceClient<InterceptedService<Channel, Authentication>>
The Text service client. Notably, this client is used for
TextServiceClient::generate_text
,
and TextServiceClient::embed_text
.
Implementations§
source§impl LanguageClient
impl LanguageClient
sourcepub async fn new(credentials: Credentials) -> Result<Self, Error>
pub async fn new(credentials: Credentials) -> Result<Self, Error>
Creates a new LanguageClient.
Example
use std::env;
use gcp_vertex_ai_generative_language::LanguageClient;
let creds = gcp_vertex_ai_generative_language::Credentials::ApiKey("my-api-key".to_string());
let mut client = LanguageClient::new(creds).await.unwrap();
sourcepub async fn from_channel(
credentials: Credentials,
channel: Channel
) -> Result<LanguageClient, Error>
pub async fn from_channel( credentials: Credentials, channel: Channel ) -> Result<LanguageClient, Error>
Creates a new LanguageClient from a Channel.
Trait Implementations§
source§impl Clone for LanguageClient
impl Clone for LanguageClient
source§fn clone(&self) -> LanguageClient
fn clone(&self) -> LanguageClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for LanguageClient
impl Send for LanguageClient
impl Sync for LanguageClient
impl Unpin for LanguageClient
impl !UnwindSafe for LanguageClient
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