Class McpOperationHandler
java.lang.Object
dev.langchain4j.mcp.client.transport.McpOperationHandler
Handles incoming messages from the MCP server. Transport implementations
should call the "handle" method on each received message. A transport also has
to call "startOperation" when before starting an operation that requires a response
to register its ID in the map of pending operations.
-
Constructor Summary
ConstructorDescriptionMcpOperationHandler
(Map<Long, CompletableFuture<com.fasterxml.jackson.databind.JsonNode>> pendingOperations) -
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(com.fasterxml.jackson.databind.JsonNode message) void
startOperation
(Long id, CompletableFuture<com.fasterxml.jackson.databind.JsonNode> future)
-
Constructor Details
-
McpOperationHandler
public McpOperationHandler(Map<Long, CompletableFuture<com.fasterxml.jackson.databind.JsonNode>> pendingOperations)
-
-
Method Details
-
handle
public void handle(com.fasterxml.jackson.databind.JsonNode message) -
startOperation
public void startOperation(Long id, CompletableFuture<com.fasterxml.jackson.databind.JsonNode> future)
-