Skip to content

Commit

Permalink
GRPC clients version 10.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
clarifai-prod committed Apr 25, 2024
1 parent 587b0d6 commit 3d32e42
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 45 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.3.2
10.3.3
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clarifai-nodejs-grpc",
"version": "10.3.2",
"version": "10.3.3",
"description": "The official Clarifai Node.js gRPC client",
"main": "src/index.js",
"repository": "https://github.com/Clarifai/clarifai-javascript-grpc",
Expand Down
38 changes: 14 additions & 24 deletions proto/clarifai/api/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ option objc_class_prefix = "CAIP";

// Annotation of an asset with metadata
message Annotation {
reserved 4, 5, 6, 11, 12;
reserved 4, 5, 6, 11, 12, 20;

// The ID for the annotation
string id = 1;
Expand All @@ -34,10 +34,11 @@ message Annotation {
// task_id is deprecated in annotation_info. Use task_id
google.protobuf.Struct annotation_info = 13;

// ID of the user this annotation is created by
string user_id = 15;
// ID of the model version this annotation is created by
string model_version_id = 16;
// DEPRECATED: Use worker.user.id instead.
string user_id = 15 [deprecated = true];

// DEPRECATED: Use worker.model.model_version.id instead
string model_version_id = 16 [deprecated=true];

// DEPRECATED.
string embed_model_version_id = 14 [deprecated = true];
Expand Down Expand Up @@ -68,8 +69,9 @@ message Annotation {
google.protobuf.Struct consensus_info = 18;
// The id of the task annotation belongs to
string task_id = 19;
// ID of the workflow version this annotation is created by
string workflow_version_id = 20;

// Worker is the worker that created the annotation.
Worker worker = 21;
}

// Worker is the author of an annotation.
Expand Down Expand Up @@ -2200,9 +2202,6 @@ message And {
// - data.geo.geo_point.latitude
// - data.geo.geo_point.longitude
// - data.image.url
// - data.metadata - allow search with empty metadata
// note that searching by empty metadata will actually not influence the search results.
// however, in order to be user-friendly, we are still supporting searching by empty metadata.
// - data.metadata.fields - filter by metadata. metadata key&value fields are OR-ed.
// - dataset_ids[] - filter by dataset IDs
// - id - filter by input ID
Expand All @@ -2225,7 +2224,6 @@ message And {
// - data.concepts[].id
// - data.concepts[].name
// - data.concepts[].value
// - input.data.image - empty image is required when searching by input ID
// - input.data.image.base64[]
// - input.data.image.url
// - input.id
Expand All @@ -2246,9 +2244,6 @@ message And {
// combinable with queries like visual search (a query with Output filled in).
//
// ########## Supported fields ##########
// - annotation_info - allows searching by empty annotation info
// note that searching by empty annotation info will actually not influence the search results.
// however, in order to be user-friendly, we are still supporting searching by empty annotation info.
// - annotation_info.fields - filter by annotation info
// - data.concepts[].id
// - data.concepts[].name
Expand All @@ -2260,9 +2255,6 @@ message And {
// - data.geo.geo_point.latitude
// - data.geo.geo_point.longitude
// - data.image.url
// - data.metadata - allow search with empty metadata
// note that searching by empty metadata will actually not influence the search results.
// however, in order to be user-friendly, we are still supporting searching by empty metadata.
// - data.metadata.fields - filter by metadata. metadata key&value fields are OR-ed.
// - input_id
// - input_level
Expand Down Expand Up @@ -2370,12 +2362,13 @@ message Filter {
// - model_version_id
// - task_id
// - user_id
// - workflow_version_id
//
// # Filter by worker fields such as model, workflow and user IDs
// - worker.model.model_version.id
// - worker.user.id
// - worker.workflow.version.id
//
// # Filter by other top-level fields
// - annotation_info - allows searching by empty annotation-info, i.e. `{"data": "annotation_info": {}}`;
// note that searching by empty annotation-info will actually not influence the search results.
// however, in order to be user-friendly, we still support searching by empty annotation-info.
// - annotation_info.fields - filter by annotation info
// - input_level - filter only input-level annotations
// - status.code - filter by annotation status code
Expand Down Expand Up @@ -2410,9 +2403,6 @@ message Filter {
// - data.geo.geo_limit.value
// - data.geo.geo_point.latitude
// - data.geo.geo_point.longitude
// - data.metadata - allow search with empty metadata, i.e. `{"data": "metadata": {}}`;
// note that searching by empty metadata will actually not influence the search results;
// however, in order to be user-friendly, we still support searching by empty metadata.
// - data.metadata.fields - filter by metadata
// - Important to note: metadata key&value fields are OR-ed.
// - example with 1 metadata key: searching by
Expand Down
9 changes: 6 additions & 3 deletions proto/clarifai/api/resources_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ export class Annotation extends jspb.Message {
setConsensusInfo(value?: google_protobuf_struct_pb.Struct): Annotation;
getTaskId(): string;
setTaskId(value: string): Annotation;
getWorkflowVersionId(): string;
setWorkflowVersionId(value: string): Annotation;

hasWorker(): boolean;
clearWorker(): void;
getWorker(): Worker | undefined;
setWorker(value?: Worker): Annotation;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Annotation.AsObject;
Expand Down Expand Up @@ -90,7 +93,7 @@ export namespace Annotation {
inputLevel: boolean,
consensusInfo?: google_protobuf_struct_pb.Struct.AsObject,
taskId: string,
workflowVersionId: string,
worker?: Worker.AsObject,
}
}

Expand Down
53 changes: 37 additions & 16 deletions proto/clarifai/api/resources_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -4701,7 +4701,7 @@ proto.clarifai.api.Annotation.toObject = function(includeInstance, msg) {
inputLevel: jspb.Message.getBooleanFieldWithDefault(msg, 17, false),
consensusInfo: (f = msg.getConsensusInfo()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
taskId: jspb.Message.getFieldWithDefault(msg, 19, ""),
workflowVersionId: jspb.Message.getFieldWithDefault(msg, 20, "")
worker: (f = msg.getWorker()) && proto.clarifai.api.Worker.toObject(includeInstance, f)
};

if (includeInstance) {
Expand Down Expand Up @@ -4800,9 +4800,10 @@ proto.clarifai.api.Annotation.deserializeBinaryFromReader = function(msg, reader
var value = /** @type {string} */ (reader.readString());
msg.setTaskId(value);
break;
case 20:
var value = /** @type {string} */ (reader.readString());
msg.setWorkflowVersionId(value);
case 21:
var value = new proto.clarifai.api.Worker;
reader.readMessage(value,proto.clarifai.api.Worker.deserializeBinaryFromReader);
msg.setWorker(value);
break;
default:
reader.skipField();
Expand Down Expand Up @@ -4937,11 +4938,12 @@ proto.clarifai.api.Annotation.serializeBinaryToWriter = function(message, writer
f
);
}
f = message.getWorkflowVersionId();
if (f.length > 0) {
writer.writeString(
20,
f
f = message.getWorker();
if (f != null) {
writer.writeMessage(
21,
f,
proto.clarifai.api.Worker.serializeBinaryToWriter
);
}
};
Expand Down Expand Up @@ -5314,20 +5316,39 @@ proto.clarifai.api.Annotation.prototype.setTaskId = function(value) {


/**
* optional string workflow_version_id = 20;
* @return {string}
* optional Worker worker = 21;
* @return {?proto.clarifai.api.Worker}
*/
proto.clarifai.api.Annotation.prototype.getWorkflowVersionId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 20, ""));
proto.clarifai.api.Annotation.prototype.getWorker = function() {
return /** @type{?proto.clarifai.api.Worker} */ (
jspb.Message.getWrapperField(this, proto.clarifai.api.Worker, 21));
};


/**
* @param {string} value
* @param {?proto.clarifai.api.Worker|undefined} value
* @return {!proto.clarifai.api.Annotation} returns this
*/
proto.clarifai.api.Annotation.prototype.setWorker = function(value) {
return jspb.Message.setWrapperField(this, 21, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.clarifai.api.Annotation} returns this
*/
proto.clarifai.api.Annotation.prototype.setWorkflowVersionId = function(value) {
return jspb.Message.setProto3StringField(this, 20, value);
proto.clarifai.api.Annotation.prototype.clearWorker = function() {
return this.setWorker(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.clarifai.api.Annotation.prototype.hasWorker = function() {
return jspb.Message.getField(this, 21) != null;
};


Expand Down
4 changes: 4 additions & 0 deletions proto/clarifai/api/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3765,6 +3765,10 @@ service V2 {
// For now there will only be one of those if the model prediction only has one request.
// NOTE(zeiler): downside of this is you can't use HTTP REST requests to do runner work.
rpc ProcessRunnerItems (stream PostRunnerItemOutputsRequest) returns (stream MultiRunnerItemResponse) {
option (google.api.http) = {
post: "/v2/runners/items/process"
body: "*"
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
option (clarifai.auth.util.cl_depending_scopes) = Apps_Get;
option (clarifai.auth.util.cl_depending_scopes) = Runners_Get;
Expand Down
4 changes: 4 additions & 0 deletions proto/clarifai/api/service_processed.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3765,6 +3765,10 @@ service V2 {
// For now there will only be one of those if the model prediction only has one request.
// NOTE(zeiler): downside of this is you can't use HTTP REST requests to do runner work.
rpc ProcessRunnerItems (stream PostRunnerItemOutputsRequest) returns (stream MultiRunnerItemResponse) {
option (google.api.http) = {
post: "/v2/runners/items/process"
body: "*"
};
option (clarifai.auth.util.cl_auth_type) = PATAuth;
option (clarifai.auth.util.cl_depending_scopes) = Apps_Get;
option (clarifai.auth.util.cl_depending_scopes) = Runners_Get;
Expand Down

0 comments on commit 3d32e42

Please sign in to comment.