Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data-3460: Adding GetInferenceResponse #608

Merged
merged 16 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 67 additions & 34 deletions app/mlinference/v1/ml_inference.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions gen/js/app/mlinference/v1/ml_inference_grpc_web_pb.js
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@ grpc.web = require('grpc-web');


var app_data_v1_data_pb = require('../../../app/data/v1/data_pb.js')

var service_mlmodel_v1_mlmodel_pb = require('../../../service/mlmodel/v1/mlmodel_pb.js')
const proto = {};
proto.viam = {};
proto.viam.app = {};
13 changes: 13 additions & 0 deletions gen/js/app/mlinference/v1/ml_inference_pb.d.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

import * as jspb from "google-protobuf";
import * as app_data_v1_data_pb from "../../../app/data/v1/data_pb";
import * as service_mlmodel_v1_mlmodel_pb from "../../../service/mlmodel/v1/mlmodel_pb";

export class GetInferenceRequest extends jspb.Message {
getRegistryItemId(): string;
@@ -39,6 +40,16 @@ export namespace GetInferenceRequest {
}

export class GetInferenceResponse extends jspb.Message {
hasOutputTensors(): boolean;
clearOutputTensors(): void;
getOutputTensors(): service_mlmodel_v1_mlmodel_pb.FlatTensors | undefined;
setOutputTensors(value?: service_mlmodel_v1_mlmodel_pb.FlatTensors): void;

hasAnnotations(): boolean;
clearAnnotations(): void;
getAnnotations(): app_data_v1_data_pb.Annotations | undefined;
setAnnotations(value?: app_data_v1_data_pb.Annotations): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetInferenceResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetInferenceResponse): GetInferenceResponse.AsObject;
@@ -51,6 +62,8 @@ export class GetInferenceResponse extends jspb.Message {

export namespace GetInferenceResponse {
export type AsObject = {
outputTensors?: service_mlmodel_v1_mlmodel_pb.FlatTensors.AsObject,
annotations?: app_data_v1_data_pb.Annotations.AsObject,
}
}

105 changes: 104 additions & 1 deletion gen/js/app/mlinference/v1/ml_inference_pb.js
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@ var global = (function() { return this || window || global || self || Function('

var app_data_v1_data_pb = require('../../../app/data/v1/data_pb.js');
goog.object.extend(proto, app_data_v1_data_pb);
var service_mlmodel_v1_mlmodel_pb = require('../../../service/mlmodel/v1/mlmodel_pb.js');
goog.object.extend(proto, service_mlmodel_v1_mlmodel_pb);
goog.exportSymbol('proto.viam.app.mlinference.v1.GetInferenceRequest', null, global);
goog.exportSymbol('proto.viam.app.mlinference.v1.GetInferenceResponse', null, global);
/**
@@ -334,7 +336,8 @@ proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.toObject = function
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.toObject = function(includeInstance, msg) {
var f, obj = {

outputTensors: (f = msg.getOutputTensors()) && service_mlmodel_v1_mlmodel_pb.FlatTensors.toObject(includeInstance, f),
annotations: (f = msg.getAnnotations()) && app_data_v1_data_pb.Annotations.toObject(includeInstance, f)
};

if (includeInstance) {
@@ -371,6 +374,16 @@ proto.viam.app.mlinference.v1.GetInferenceResponse.deserializeBinaryFromReader =
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new service_mlmodel_v1_mlmodel_pb.FlatTensors;
reader.readMessage(value,service_mlmodel_v1_mlmodel_pb.FlatTensors.deserializeBinaryFromReader);
msg.setOutputTensors(value);
break;
case 2:
var value = new app_data_v1_data_pb.Annotations;
reader.readMessage(value,app_data_v1_data_pb.Annotations.deserializeBinaryFromReader);
msg.setAnnotations(value);
break;
default:
reader.skipField();
break;
@@ -400,6 +413,96 @@ proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.serializeBinary = f
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getOutputTensors();
if (f != null) {
writer.writeMessage(
1,
f,
service_mlmodel_v1_mlmodel_pb.FlatTensors.serializeBinaryToWriter
);
}
f = message.getAnnotations();
if (f != null) {
writer.writeMessage(
2,
f,
app_data_v1_data_pb.Annotations.serializeBinaryToWriter
);
}
};


/**
* optional viam.service.mlmodel.v1.FlatTensors output_tensors = 1;
* @return {?proto.viam.service.mlmodel.v1.FlatTensors}
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.getOutputTensors = function() {
return /** @type{?proto.viam.service.mlmodel.v1.FlatTensors} */ (
jspb.Message.getWrapperField(this, service_mlmodel_v1_mlmodel_pb.FlatTensors, 1));
};


/**
* @param {?proto.viam.service.mlmodel.v1.FlatTensors|undefined} value
* @return {!proto.viam.app.mlinference.v1.GetInferenceResponse} returns this
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.setOutputTensors = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.viam.app.mlinference.v1.GetInferenceResponse} returns this
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.clearOutputTensors = function() {
return this.setOutputTensors(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.hasOutputTensors = function() {
return jspb.Message.getField(this, 1) != null;
};


/**
* optional viam.app.data.v1.Annotations annotations = 2;
* @return {?proto.viam.app.data.v1.Annotations}
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.getAnnotations = function() {
return /** @type{?proto.viam.app.data.v1.Annotations} */ (
jspb.Message.getWrapperField(this, app_data_v1_data_pb.Annotations, 2));
};


/**
* @param {?proto.viam.app.data.v1.Annotations|undefined} value
* @return {!proto.viam.app.mlinference.v1.GetInferenceResponse} returns this
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.setAnnotations = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.viam.app.mlinference.v1.GetInferenceResponse} returns this
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.clearAnnotations = function() {
return this.setAnnotations(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.viam.app.mlinference.v1.GetInferenceResponse.prototype.hasAnnotations = function() {
return jspb.Message.getField(this, 2) != null;
};


10 changes: 10 additions & 0 deletions gen/js/google/rpc/error_details_pb.d.ts
Original file line number Diff line number Diff line change
@@ -203,6 +203,14 @@ export namespace BadRequest {
getDescription(): string;
setDescription(value: string): void;

getReason(): string;
setReason(value: string): void;

hasLocalizedMessage(): boolean;
clearLocalizedMessage(): void;
getLocalizedMessage(): LocalizedMessage | undefined;
setLocalizedMessage(value?: LocalizedMessage): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): FieldViolation.AsObject;
static toObject(includeInstance: boolean, msg: FieldViolation): FieldViolation.AsObject;
@@ -217,6 +225,8 @@ export namespace BadRequest {
export type AsObject = {
field: string,
description: string,
reason: string,
localizedMessage?: LocalizedMessage.AsObject,
}
}
}
83 changes: 82 additions & 1 deletion gen/js/google/rpc/error_details_pb.js
Original file line number Diff line number Diff line change
@@ -1680,7 +1680,9 @@ proto.google.rpc.BadRequest.FieldViolation.prototype.toObject = function(opt_inc
proto.google.rpc.BadRequest.FieldViolation.toObject = function(includeInstance, msg) {
var f, obj = {
field: jspb.Message.getFieldWithDefault(msg, 1, ""),
description: jspb.Message.getFieldWithDefault(msg, 2, "")
description: jspb.Message.getFieldWithDefault(msg, 2, ""),
reason: jspb.Message.getFieldWithDefault(msg, 3, ""),
localizedMessage: (f = msg.getLocalizedMessage()) && proto.google.rpc.LocalizedMessage.toObject(includeInstance, f)
};

if (includeInstance) {
@@ -1725,6 +1727,15 @@ proto.google.rpc.BadRequest.FieldViolation.deserializeBinaryFromReader = functio
var value = /** @type {string} */ (reader.readString());
msg.setDescription(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setReason(value);
break;
case 4:
var value = new proto.google.rpc.LocalizedMessage;
reader.readMessage(value,proto.google.rpc.LocalizedMessage.deserializeBinaryFromReader);
msg.setLocalizedMessage(value);
break;
default:
reader.skipField();
break;
@@ -1768,6 +1779,21 @@ proto.google.rpc.BadRequest.FieldViolation.serializeBinaryToWriter = function(me
f
);
}
f = message.getReason();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getLocalizedMessage();
if (f != null) {
writer.writeMessage(
4,
f,
proto.google.rpc.LocalizedMessage.serializeBinaryToWriter
);
}
};


@@ -1807,6 +1833,61 @@ proto.google.rpc.BadRequest.FieldViolation.prototype.setDescription = function(v
};


/**
* optional string reason = 3;
* @return {string}
*/
proto.google.rpc.BadRequest.FieldViolation.prototype.getReason = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};


/**
* @param {string} value
* @return {!proto.google.rpc.BadRequest.FieldViolation} returns this
*/
proto.google.rpc.BadRequest.FieldViolation.prototype.setReason = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};


/**
* optional LocalizedMessage localized_message = 4;
* @return {?proto.google.rpc.LocalizedMessage}
*/
proto.google.rpc.BadRequest.FieldViolation.prototype.getLocalizedMessage = function() {
return /** @type{?proto.google.rpc.LocalizedMessage} */ (
jspb.Message.getWrapperField(this, proto.google.rpc.LocalizedMessage, 4));
};


/**
* @param {?proto.google.rpc.LocalizedMessage|undefined} value
* @return {!proto.google.rpc.BadRequest.FieldViolation} returns this
*/
proto.google.rpc.BadRequest.FieldViolation.prototype.setLocalizedMessage = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.google.rpc.BadRequest.FieldViolation} returns this
*/
proto.google.rpc.BadRequest.FieldViolation.prototype.clearLocalizedMessage = function() {
return this.setLocalizedMessage(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.google.rpc.BadRequest.FieldViolation.prototype.hasLocalizedMessage = function() {
return jspb.Message.getField(this, 4) != null;
};


/**
* repeated FieldViolation field_violations = 1;
* @return {!Array<!proto.google.rpc.BadRequest.FieldViolation>}
6 changes: 5 additions & 1 deletion proto/viam/app/mlinference/v1/ml_inference.proto
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ syntax = "proto3";
package viam.app.mlinference.v1;

import "app/data/v1/data.proto";
import "service/mlmodel/v1/mlmodel.proto";

option go_package = "go.viam.com/api/app/mlinference/v1";

@@ -20,4 +21,7 @@ message GetInferenceRequest {
string organization_id = 4;
}

message GetInferenceResponse {}
message GetInferenceResponse {
viam.service.mlmodel.v1.FlatTensors output_tensors = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wooh, awesome. Thanks for maintaining parity with the ML model proto defs :)

viam.app.data.v1.Annotations annotations = 2;
}