Class 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. This data type is not supported in Gemini API.
public record ExternalApi : IEquatable<ExternalApi>
- Inheritance
-
ExternalApi
- Implements
- Inherited Members
Properties
ApiAuth
The authentication config to access the API. Deprecated. Please use auth_config instead.
[JsonPropertyName("apiAuth")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ApiAuth? ApiAuth { get; set; }
Property Value
ApiSpec
The API spec that the external API implements.
[JsonPropertyName("apiSpec")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ApiSpec? ApiSpec { get; set; }
Property Value
AuthConfig
The authentication config to access the API.
[JsonPropertyName("authConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public AuthConfig? AuthConfig { get; set; }
Property Value
ElasticSearchParams
Parameters for the elastic search API.
[JsonPropertyName("elasticSearchParams")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ExternalApiElasticSearchParams? ElasticSearchParams { get; set; }
Property Value
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
[JsonPropertyName("endpoint")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Endpoint { get; set; }
Property Value
SimpleSearchParams
Parameters for the simple search API.
[JsonPropertyName("simpleSearchParams")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ExternalApiSimpleSearchParams? SimpleSearchParams { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a ExternalApi object.
public static ExternalApi? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- ExternalApi
The deserialized ExternalApi object, or null if deserialization fails.