Table of Contents

Class StreamableHttpTransport

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

A transport that can stream HTTP requests and responses. Next ID: 6. This data type is not supported in Vertex AI.

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

Properties

Headers

Optional: Fields for authentication headers, timeouts, etc., if needed.

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

Property Value

Dictionary<string, string>

SseReadTimeout

Timeout for SSE read operations.

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

Property Value

string

TerminateOnClose

Whether to close the client session when the transport closes.

[JsonPropertyName("terminateOnClose")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? TerminateOnClose { get; set; }

Property Value

bool?

Timeout

HTTP timeout for regular operations.

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

Property Value

string

Url

The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp".

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

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a StreamableHttpTransport object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

StreamableHttpTransport

The deserialized StreamableHttpTransport object, or null if deserialization fails.