Ganeshsivakumar commented on code in PR #36623:
URL: https://github.com/apache/beam/pull/36623#discussion_r2472558007


##########
sdks/java/ml/remoteinference/src/main/java/org/apache/beam/sdk/ml/remoteinference/RemoteInference.java:
##########
@@ -0,0 +1,91 @@
+package org.apache.beam.sdk.ml.remoteinference;
+
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+import org.apache.beam.sdk.ml.remoteinference.base.BaseInput;
+import org.apache.beam.sdk.ml.remoteinference.base.BaseModelHandler;
+import org.apache.beam.sdk.ml.remoteinference.base.BaseModelParameters;
+import org.apache.beam.sdk.ml.remoteinference.base.BaseResponse;
+import org.apache.beam.sdk.transforms.DoFn;
+import org.apache.beam.sdk.transforms.PTransform;
+import org.apache.beam.sdk.transforms.ParDo;
+import org.apache.beam.sdk.values.PCollection;
+
+
+import com.google.auto.value.AutoValue;
+
+@SuppressWarnings({ "rawtypes", "unchecked" })
+public class RemoteInference {
+
+  public static <InputT extends BaseInput, OutputT extends BaseResponse> 
Invoke<InputT, OutputT> invoke() {
+    return new AutoValue_RemoteInference_Invoke.Builder<InputT, 
OutputT>().setParameters(null)
+      .build();
+  }
+
+  private RemoteInference() {
+  }
+
+  @AutoValue
+  public abstract static class Invoke<InputT extends BaseInput, OutputT 
extends BaseResponse>
+    extends PTransform<PCollection<InputT>, PCollection<OutputT>> {
+
+    abstract @Nullable Class<? extends BaseModelHandler> handler();
+
+    abstract @Nullable BaseModelParameters parameters();
+
+    abstract Builder<InputT, OutputT> builder();
+
+    @AutoValue.Builder
+    abstract static class Builder<InputT extends BaseInput, OutputT extends 
BaseResponse> {
+
+      abstract Builder<InputT, OutputT> setHandler(Class<? extends 
BaseModelHandler> modelHandler);
+
+      abstract Builder<InputT, OutputT> setParameters(BaseModelParameters 
modelParameters);
+
+      abstract Invoke<InputT, OutputT> build();
+    }
+
+    public Invoke<InputT, OutputT> handler(Class<? extends BaseModelHandler> 
modelHandler) {
+      return builder().setHandler(modelHandler).build();
+    }
+
+    public Invoke<InputT, OutputT> withParameters(BaseModelParameters 
modelParameters) {
+      return builder().setParameters(modelParameters).build();
+    }
+
+    @Override

Review Comment:
   Thanks, updated output format.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to