Class GenerativeServiceConnection (2.30.0-rc)

This interface defines virtual methods for each of the user-facing overload sets in GenerativeServiceClient. This allows users to inject custom behavior (e.g., with a Google Mock object) when writing tests that use objects of type GenerativeServiceClient.

To create a concrete instance, see MakeGenerativeServiceConnection().

For mocking, see generativelanguage_v1_mocks::MockGenerativeServiceConnection.

Functions

virtual options()

Returns
Type Description
Options

virtual GenerateContent(google::ai::generativelanguage::v1::GenerateContentRequest const &)

Parameter
Name Description
request google::ai::generativelanguage::v1::GenerateContentRequest const &
Returns
Type Description
StatusOr< google::ai::generativelanguage::v1::GenerateContentResponse >

virtual StreamGenerateContent(google::ai::generativelanguage::v1::GenerateContentRequest const &)

Parameter
Name Description
request google::ai::generativelanguage::v1::GenerateContentRequest const &
Returns
Type Description
StreamRange< google::ai::generativelanguage::v1::GenerateContentResponse >

virtual EmbedContent(google::ai::generativelanguage::v1::EmbedContentRequest const &)

Parameter
Name Description
request google::ai::generativelanguage::v1::EmbedContentRequest const &
Returns
Type Description
StatusOr< google::ai::generativelanguage::v1::EmbedContentResponse >

virtual BatchEmbedContents(google::ai::generativelanguage::v1::BatchEmbedContentsRequest const &)

Parameter
Name Description
request google::ai::generativelanguage::v1::BatchEmbedContentsRequest const &
Returns
Type Description
StatusOr< google::ai::generativelanguage::v1::BatchEmbedContentsResponse >

virtual CountTokens(google::ai::generativelanguage::v1::CountTokensRequest const &)

Parameter
Name Description
request google::ai::generativelanguage::v1::CountTokensRequest const &
Returns
Type Description
StatusOr< google::ai::generativelanguage::v1::CountTokensResponse >