Skip to content

Commit

Permalink
GRPC clients version 11.0.3
Browse files Browse the repository at this point in the history
clarifai-prod committed Jan 21, 2025
1 parent d9ea8c5 commit ea4997e
Showing 9 changed files with 114 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11.0.2
11.0.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": "11.0.2",
"version": "11.0.3",
"description": "The official Clarifai Node.js gRPC client",
"main": "src/index.js",
"repository": "https://github.com/Clarifai/clarifai-javascript-grpc",
7 changes: 7 additions & 0 deletions proto/clarifai/api/resources.proto
Original file line number Diff line number Diff line change
@@ -2220,6 +2220,11 @@ message Output {
// The output data for this Output. For example if we have a concept model then the predicted
// concepts will appear here.
Data data = 6;

// Number of prompt tokens as reported by the model or third-party API.
uint32 prompt_tokens = 7;
// Number of completion tokens as reported by the model or third-party API.
uint32 completion_tokens = 8;
}

// ScopeDeps
@@ -2479,6 +2484,8 @@ message Filter {
// - in order to enable this, you need to set the field to an empty object, i.e. `{"data": {"regions": [{"region_info": {"polygon":{}}}]}}`
// - data.regions[].region_info.span - filter only span annotations
// - in order to enable this, you need to set the field to an empty object, i.e. `{"data": {"regions": [{"region_info": {"span":{}}}]}}`
// - data.regions[].track_id - filter annotations by track_id
// - in order to enable this, you need to provide "track_id_value" i.e. `{"data": {"regions": [{"track_id" : "track_id_value"}]}}`
// - data.time_segments[].time_info - filter only time-segment annotations
// - in order to enable this, you need to set the field to an empty object, i.e. `{"data": {"time_segments": [{"time_info": {}}]}}`
//
6 changes: 6 additions & 0 deletions proto/clarifai/api/resources_pb.d.ts
Original file line number Diff line number Diff line change
@@ -4315,6 +4315,10 @@ export class Output extends jspb.Message {
clearData(): void;
getData(): Data | undefined;
setData(value?: Data): Output;
getPromptTokens(): number;
setPromptTokens(value: number): Output;
getCompletionTokens(): number;
setCompletionTokens(value: number): Output;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Output.AsObject;
@@ -4334,6 +4338,8 @@ export namespace Output {
model?: Model.AsObject,
input?: Input.AsObject,
data?: Data.AsObject,
promptTokens: number,
completionTokens: number,
}
}

62 changes: 61 additions & 1 deletion proto/clarifai/api/resources_pb.js
Original file line number Diff line number Diff line change
@@ -38402,7 +38402,9 @@ proto.clarifai.api.Output.toObject = function(includeInstance, msg) {
createdAt: (f = msg.getCreatedAt()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
model: (f = msg.getModel()) && proto.clarifai.api.Model.toObject(includeInstance, f),
input: (f = msg.getInput()) && proto.clarifai.api.Input.toObject(includeInstance, f),
data: (f = msg.getData()) && proto.clarifai.api.Data.toObject(includeInstance, f)
data: (f = msg.getData()) && proto.clarifai.api.Data.toObject(includeInstance, f),
promptTokens: jspb.Message.getFieldWithDefault(msg, 7, 0),
completionTokens: jspb.Message.getFieldWithDefault(msg, 8, 0)
};

if (includeInstance) {
@@ -38468,6 +38470,14 @@ proto.clarifai.api.Output.deserializeBinaryFromReader = function(msg, reader) {
reader.readMessage(value,proto.clarifai.api.Data.deserializeBinaryFromReader);
msg.setData(value);
break;
case 7:
var value = /** @type {number} */ (reader.readUint32());
msg.setPromptTokens(value);
break;
case 8:
var value = /** @type {number} */ (reader.readUint32());
msg.setCompletionTokens(value);
break;
default:
reader.skipField();
break;
@@ -38544,6 +38554,20 @@ proto.clarifai.api.Output.serializeBinaryToWriter = function(message, writer) {
proto.clarifai.api.Data.serializeBinaryToWriter
);
}
f = message.getPromptTokens();
if (f !== 0) {
writer.writeUint32(
7,
f
);
}
f = message.getCompletionTokens();
if (f !== 0) {
writer.writeUint32(
8,
f
);
}
};


@@ -38750,6 +38774,42 @@ proto.clarifai.api.Output.prototype.hasData = function() {
};


/**
* optional uint32 prompt_tokens = 7;
* @return {number}
*/
proto.clarifai.api.Output.prototype.getPromptTokens = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0));
};


/**
* @param {number} value
* @return {!proto.clarifai.api.Output} returns this
*/
proto.clarifai.api.Output.prototype.setPromptTokens = function(value) {
return jspb.Message.setProto3IntField(this, 7, value);
};


/**
* optional uint32 completion_tokens = 8;
* @return {number}
*/
proto.clarifai.api.Output.prototype.getCompletionTokens = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};


/**
* @param {number} value
* @return {!proto.clarifai.api.Output} returns this
*/
proto.clarifai.api.Output.prototype.setCompletionTokens = function(value) {
return jspb.Message.setProto3IntField(this, 8, value);
};



/**
* List of repeated fields within this message type.
2 changes: 2 additions & 0 deletions proto/clarifai/api/service.proto
Original file line number Diff line number Diff line change
@@ -5763,6 +5763,8 @@ message PostModelVersionsUploadConfig {
uint64 total_size = 4;
// Whether the uploaded package will be a .tar.gz which contains a Dockerfile or the standard .zip
bool is_v3 = 5;
// Number of bytes requested for the build process.
uint64 storage_request_size = 6;
}

// PutModelVersionExportsRequest
3 changes: 3 additions & 0 deletions proto/clarifai/api/service_pb.d.ts
Original file line number Diff line number Diff line change
@@ -4642,6 +4642,8 @@ export class PostModelVersionsUploadConfig extends jspb.Message {
setTotalSize(value: number): PostModelVersionsUploadConfig;
getIsV3(): boolean;
setIsV3(value: boolean): PostModelVersionsUploadConfig;
getStorageRequestSize(): number;
setStorageRequestSize(value: number): PostModelVersionsUploadConfig;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): PostModelVersionsUploadConfig.AsObject;
@@ -4660,6 +4662,7 @@ export namespace PostModelVersionsUploadConfig {
modelVersion?: proto_clarifai_api_resources_pb.ModelVersion.AsObject,
totalSize: number,
isV3: boolean,
storageRequestSize: number,
}
}

32 changes: 31 additions & 1 deletion proto/clarifai/api/service_pb.js
Original file line number Diff line number Diff line change
@@ -42973,7 +42973,8 @@ proto.clarifai.api.PostModelVersionsUploadConfig.toObject = function(includeInst
modelId: jspb.Message.getFieldWithDefault(msg, 2, ""),
modelVersion: (f = msg.getModelVersion()) && proto_clarifai_api_resources_pb.ModelVersion.toObject(includeInstance, f),
totalSize: jspb.Message.getFieldWithDefault(msg, 4, 0),
isV3: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
isV3: jspb.Message.getBooleanFieldWithDefault(msg, 5, false),
storageRequestSize: jspb.Message.getFieldWithDefault(msg, 6, 0)
};

if (includeInstance) {
@@ -43032,6 +43033,10 @@ proto.clarifai.api.PostModelVersionsUploadConfig.deserializeBinaryFromReader = f
var value = /** @type {boolean} */ (reader.readBool());
msg.setIsV3(value);
break;
case 6:
var value = /** @type {number} */ (reader.readUint64());
msg.setStorageRequestSize(value);
break;
default:
reader.skipField();
break;
@@ -43098,6 +43103,13 @@ proto.clarifai.api.PostModelVersionsUploadConfig.serializeBinaryToWriter = funct
f
);
}
f = message.getStorageRequestSize();
if (f !== 0) {
writer.writeUint64(
6,
f
);
}
};


@@ -43229,6 +43241,24 @@ proto.clarifai.api.PostModelVersionsUploadConfig.prototype.setIsV3 = function(va
};


/**
* optional uint64 storage_request_size = 6;
* @return {number}
*/
proto.clarifai.api.PostModelVersionsUploadConfig.prototype.getStorageRequestSize = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};


/**
* @param {number} value
* @return {!proto.clarifai.api.PostModelVersionsUploadConfig} returns this
*/
proto.clarifai.api.PostModelVersionsUploadConfig.prototype.setStorageRequestSize = function(value) {
return jspb.Message.setProto3IntField(this, 6, value);
};





2 changes: 2 additions & 0 deletions proto/clarifai/api/service_processed.proto
Original file line number Diff line number Diff line change
@@ -5763,6 +5763,8 @@ message PostModelVersionsUploadConfig {
uint64 total_size = 4;
// Whether the uploaded package will be a .tar.gz which contains a Dockerfile or the standard .zip
bool is_v3 = 5;
// Number of bytes requested for the build process.
uint64 storage_request_size = 6;
}

// PutModelVersionExportsRequest

0 comments on commit ea4997e

Please sign in to comment.