Package com.google.genai.types
Class ExternalApi
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ExternalApi
Retrieve from data source powered by external API for grounding. The external API is not owned by
Google, but need to follow the pre-defined API spec.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapiAuth()
The authentication config to access the API.apiSpec()
The API spec that the external API implements.abstract Optional<AuthConfig>
The authentication config to access the API.static ExternalApi.Builder
builder()
Instantiates a builder for ExternalApi.abstract Optional<ExternalApiElasticSearchParams>
Parameters for the elastic search API.endpoint()
The endpoint of the external API.static ExternalApi
Deserializes a JSON string to a ExternalApi object.abstract Optional<ExternalApiSimpleSearchParams>
Parameters for the simple search API.abstract ExternalApi.Builder
Creates a builder with the same values as this instance.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
ExternalApi
public ExternalApi()
-
-
Method Details
-
apiAuth
The authentication config to access the API. Deprecated. Please use auth_config instead. -
apiSpec
The API spec that the external API implements. -
authConfig
The authentication config to access the API. -
elasticSearchParams
Parameters for the elastic search API. -
endpoint
The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search -
simpleSearchParams
Parameters for the simple search API. -
builder
Instantiates a builder for ExternalApi. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a ExternalApi object.
-