Class StreamableHttpTransport

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

public abstract class StreamableHttpTransport extends JsonSerializable
A transport that can stream HTTP requests and responses. Next ID: 6. This data type is not supported in Vertex AI.
  • Constructor Details

    • StreamableHttpTransport

      public StreamableHttpTransport()
  • Method Details

    • headers

      public abstract Optional<Map<String,String>> headers()
      Optional: Fields for authentication headers, timeouts, etc., if needed.
    • sseReadTimeout

      public abstract Optional<Duration> sseReadTimeout()
      Timeout for SSE read operations.
    • terminateOnClose

      public abstract Optional<Boolean> terminateOnClose()
      Whether to close the client session when the transport closes.
    • timeout

      public abstract Optional<Duration> timeout()
      HTTP timeout for regular operations.
    • url

      public abstract Optional<String> url()
      The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp".
    • builder

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

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

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