From 3db40bda6cec5c539641afb221f797b741123c27 Mon Sep 17 00:00:00 2001 From: Christophe Bornet Date: Wed, 13 Dec 2023 17:48:15 +0100 Subject: [PATCH] Fix for handling big messages from Python agent (#749) --- .../main/java/ai/langstream/agents/grpc/GrpcAgentProcessor.java | 2 +- .../src/main/java/ai/langstream/agents/grpc/GrpcAgentSink.java | 2 +- .../main/java/ai/langstream/agents/grpc/GrpcAgentSource.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentProcessor.java b/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentProcessor.java index 528d9c79c..9ee9433dd 100644 --- a/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentProcessor.java +++ b/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentProcessor.java @@ -59,7 +59,7 @@ public synchronized void onNewSchemaToSend(Schema schema) { @Override public void start() throws Exception { super.start(); - request = AgentServiceGrpc.newStub(channel).withWaitForReady().process(responseObserver); + request = asyncStub.process(responseObserver); restarting.set(false); startFailedButDevelopmentMode = false; } diff --git a/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSink.java b/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSink.java index c96fc9895..62f50e325 100644 --- a/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSink.java +++ b/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSink.java @@ -53,7 +53,7 @@ public void onNewSchemaToSend(Schema schema) { @Override public void start() throws Exception { super.start(); - request = AgentServiceGrpc.newStub(channel).withWaitForReady().write(responseObserver); + request = asyncStub.write(responseObserver); restarting.set(false); startFailedButDevelopmentMode = false; } diff --git a/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSource.java b/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSource.java index 30a75ae41..65f672ab2 100644 --- a/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSource.java +++ b/langstream-agents/langstream-agent-grpc/src/main/java/ai/langstream/agents/grpc/GrpcAgentSource.java @@ -53,7 +53,7 @@ public void onNewSchemaToSend(Schema schema) { @Override public void start() throws Exception { super.start(); - request = AgentServiceGrpc.newStub(channel).withWaitForReady().read(responseObserver); + request = asyncStub.read(responseObserver); restarting.set(false); startFailedButDevelopmentMode = false; }