Table of Contents

Class HttpOptions

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

HTTP options to be used in each of the requests.

public record HttpOptions : IEquatable<HttpOptions>
Inheritance
HttpOptions
Implements
Inherited Members

Properties

ApiVersion

Specifies the version of the API to use.

[JsonPropertyName("apiVersion")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ApiVersion { get; set; }

Property Value

string

BaseUrl

The base URL for the AI platform service endpoint.

[JsonPropertyName("baseUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? BaseUrl { get; set; }

Property Value

string

BaseUrlResourceScope

The resource scope used to constructing the resource name when base_url is set

[JsonPropertyName("baseUrlResourceScope")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ResourceScope? BaseUrlResourceScope { get; set; }

Property Value

ResourceScope?

Headers

Additional HTTP headers to be sent with the request.

[JsonPropertyName("headers")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Dictionary<string, string>? Headers { get; set; }

Property Value

Dictionary<string, string>

Timeout

Timeout for the request in milliseconds.

[JsonPropertyName("timeout")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Timeout { get; set; }

Property Value

int?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a HttpOptions object.

public static HttpOptions? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

HttpOptions

The deserialized HttpOptions object, or null if deserialization fails.