Package com.google.genai.types
Class StreamableHttpTransport
-
- All Implemented Interfaces:
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classStreamableHttpTransport.BuilderBuilder for StreamableHttpTransport.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description StreamableHttpTransport()
-
Method Summary
Modifier and Type Method Description abstract Optional<Map<String, String>>headers()Optional: Fields for authentication headers, timeouts, etc., if needed. abstract Optional<Duration>sseReadTimeout()Timeout for SSE read operations. abstract Optional<Boolean>terminateOnClose()Whether to close the client session when the transport closes. abstract Optional<Duration>timeout()HTTP timeout for regular operations. abstract Optional<String>url()The full URL for the MCPServer endpoint. static StreamableHttpTransport.Builderbuilder()Instantiates a builder for StreamableHttpTransport. abstract StreamableHttpTransport.BuildertoBuilder()Creates a builder with the same values as this instance. static StreamableHttpTransportfromJson(String jsonString)Deserializes a JSON string to a StreamableHttpTransport object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
headers
abstract Optional<Map<String, String>> headers()
Optional: Fields for authentication headers, timeouts, etc., if needed.
-
sseReadTimeout
abstract Optional<Duration> sseReadTimeout()
Timeout for SSE read operations.
-
terminateOnClose
abstract Optional<Boolean> terminateOnClose()
Whether to close the client session when the transport closes.
-
url
abstract Optional<String> url()
The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp".
-
builder
static StreamableHttpTransport.Builder builder()
Instantiates a builder for StreamableHttpTransport.
-
toBuilder
abstract StreamableHttpTransport.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static StreamableHttpTransport fromJson(String jsonString)
Deserializes a JSON string to a StreamableHttpTransport object.
-
-
-
-