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 !Freeze for LanguageClient
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> 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>
Wrap the input message
T
in a tonic::Request