Class ExternalApi

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.ExternalApi

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.
  • Constructor Details

    • ExternalApi

      public ExternalApi()
  • Method Details

    • apiAuth

      public abstract Optional<ApiAuth> apiAuth()
      The authentication config to access the API. Deprecated. Please use auth_config instead.
    • apiSpec

      public abstract Optional<ApiSpec> apiSpec()
      The API spec that the external API implements.
    • authConfig

      public abstract Optional<AuthConfig> authConfig()
      The authentication config to access the API.
    • elasticSearchParams

      public abstract Optional<ExternalApiElasticSearchParams> elasticSearchParams()
      Parameters for the elastic search API.
    • endpoint

      public 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

      public abstract Optional<ExternalApiSimpleSearchParams> simpleSearchParams()
      Parameters for the simple search API.
    • builder

      public static ExternalApi.Builder builder()
      Instantiates a builder for ExternalApi.
    • toBuilder

      public abstract ExternalApi.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static ExternalApi fromJson(String jsonString)
      Deserializes a JSON string to a ExternalApi object.