Package com.google.genai.types
Class ExternalApi
-
- All Implemented Interfaces:
public abstract class ExternalApi extends JsonSerializable
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. This data type is not supported in Gemini API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classExternalApi.BuilderBuilder for ExternalApi.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description ExternalApi()
-
Method Summary
Modifier and Type Method Description abstract Optional<ApiAuth>apiAuth()The authentication config to access the API. abstract Optional<ApiSpec>apiSpec()The API spec that the external API implements. abstract Optional<AuthConfig>authConfig()The authentication config to access the API. abstract Optional<ExternalApiElasticSearchParams>elasticSearchParams()Parameters for the elastic search API. abstract Optional<String>endpoint()The endpoint of the external API. abstract Optional<ExternalApiSimpleSearchParams>simpleSearchParams()Parameters for the simple search API. static ExternalApi.Builderbuilder()Instantiates a builder for ExternalApi. abstract ExternalApi.BuildertoBuilder()Creates a builder with the same values as this instance. static ExternalApifromJson(String jsonString)Deserializes a JSON string to a ExternalApi object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
apiAuth
abstract Optional<ApiAuth> apiAuth()
The authentication config to access the API. Deprecated. Please use auth_config instead.
-
authConfig
abstract Optional<AuthConfig> authConfig()
The authentication config to access the API.
-
elasticSearchParams
abstract Optional<ExternalApiElasticSearchParams> elasticSearchParams()
Parameters for the elastic search API.
-
endpoint
abstract Optional<String> 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
abstract Optional<ExternalApiSimpleSearchParams> simpleSearchParams()
Parameters for the simple search API.
-
builder
static ExternalApi.Builder builder()
Instantiates a builder for ExternalApi.
-
toBuilder
abstract ExternalApi.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static ExternalApi fromJson(String jsonString)
Deserializes a JSON string to a ExternalApi object.
-
-
-
-