Skip to content

Commit

Permalink
GRPC clients version 10.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
clarifai-prod committed Oct 16, 2024
1 parent f47f0ee commit 9110f24
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 1 deletion.
164 changes: 164 additions & 0 deletions Sources/ClarifaiGrpc/proto/clarifai/api/resources.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2616,13 +2616,54 @@ public struct Clarifai_Api_Data {
set {_uniqueStorage()._heatmaps = newValue}
}

/// For data messages that have multiple parts such as multi-modal
/// requests, we allow you to specify those as a list of Data objects.
public var parts: [Clarifai_Api_Part] {
get {return _storage._parts}
set {_uniqueStorage()._parts = newValue}
}

/// A proto representation for numpy arrays, useful to pass information from python SDK to a
/// python based model implementation.
public var ndarray: Clarifai_Api_NDArray {
get {return _storage._ndarray ?? Clarifai_Api_NDArray()}
set {_uniqueStorage()._ndarray = newValue}
}
/// Returns true if `ndarray` has been explicitly set.
public var hasNdarray: Bool {return _storage._ndarray != nil}
/// Clears the value of `ndarray`. Subsequent reads from it will return its default value.
public mutating func clearNdarray() {_uniqueStorage()._ndarray = nil}

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}

fileprivate var _storage = _StorageClass.defaultInstance
}

/// A part of data used for multi-modal processing.
public struct Clarifai_Api_Part {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

/// The data for this part.
public var data: Clarifai_Api_Data {
get {return _data ?? Clarifai_Api_Data()}
set {_data = newValue}
}
/// Returns true if `data` has been explicitly set.
public var hasData: Bool {return self._data != nil}
/// Clears the value of `data`. Subsequent reads from it will return its default value.
public mutating func clearData() {self._data = nil}

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}

fileprivate var _data: Clarifai_Api_Data? = nil
}

/// A region within the data.
public struct Clarifai_Api_Region {
// SwiftProtobuf.Message conformance is added in an extension below. See the
Expand Down Expand Up @@ -2831,6 +2872,33 @@ public struct Clarifai_Api_Frame {
fileprivate var _data: Clarifai_Api_Data? = nil
}

/// A representation of a numpy array as a proto.
/// To convert a numpy array 'ndarray' to this proto do:
/// NDArray(buffer=ndarray.tobytes(), shape=ndarray.shape, dtype=str(ndarray.dtype))
///
/// To convert this proto 'ndarray_proto' to a numpy array:
/// array = np.frombuffer(ndarray_proto.buffer, dtype=ndarray_proto.dtype)
/// array = array.reshape(tuple(ndarray_proto.shape))
public struct Clarifai_Api_NDArray {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

/// The bytes of data from the array from array.tobytes()
public var buffer: Data = Data()

/// Simply the shape of the numpy array. array.shape.
public var shape: [UInt32] = []

/// Dtype for numpy. You can get it back from this string format using:
/// np.dtype('float32') for example.
public var dtype: String = String()

public var unknownFields = SwiftProtobuf.UnknownStorage()

public init() {}
}

/// Segmentation mask.
public struct Clarifai_Api_Mask {
// SwiftProtobuf.Message conformance is added in an extension below. See the
Expand Down Expand Up @@ -14673,6 +14741,8 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
16: .standard(proto: "time_segments"),
17: .same(proto: "hits"),
18: .same(proto: "heatmaps"),
19: .same(proto: "parts"),
20: .same(proto: "ndarray"),
]

fileprivate class _StorageClass {
Expand All @@ -14692,6 +14762,8 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
var _timeSegments: [Clarifai_Api_TimeSegment] = []
var _hits: [Clarifai_Api_Hit] = []
var _heatmaps: [Clarifai_Api_Image] = []
var _parts: [Clarifai_Api_Part] = []
var _ndarray: Clarifai_Api_NDArray? = nil

static let defaultInstance = _StorageClass()

Expand All @@ -14714,6 +14786,8 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
_timeSegments = source._timeSegments
_hits = source._hits
_heatmaps = source._heatmaps
_parts = source._parts
_ndarray = source._ndarray
}
}

Expand Down Expand Up @@ -14748,6 +14822,8 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
case 16: try { try decoder.decodeRepeatedMessageField(value: &_storage._timeSegments) }()
case 17: try { try decoder.decodeRepeatedMessageField(value: &_storage._hits) }()
case 18: try { try decoder.decodeRepeatedMessageField(value: &_storage._heatmaps) }()
case 19: try { try decoder.decodeRepeatedMessageField(value: &_storage._parts) }()
case 20: try { try decoder.decodeSingularMessageField(value: &_storage._ndarray) }()
default: break
}
}
Expand Down Expand Up @@ -14808,6 +14884,12 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
if !_storage._heatmaps.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._heatmaps, fieldNumber: 18)
}
if !_storage._parts.isEmpty {
try visitor.visitRepeatedMessageField(value: _storage._parts, fieldNumber: 19)
}
try { if let v = _storage._ndarray {
try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
} }()
}
try unknownFields.traverse(visitor: &visitor)
}
Expand All @@ -14833,6 +14915,8 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
if _storage._timeSegments != rhs_storage._timeSegments {return false}
if _storage._hits != rhs_storage._hits {return false}
if _storage._heatmaps != rhs_storage._heatmaps {return false}
if _storage._parts != rhs_storage._parts {return false}
if _storage._ndarray != rhs_storage._ndarray {return false}
return true
}
if !storagesAreEqual {return false}
Expand All @@ -14842,6 +14926,42 @@ extension Clarifai_Api_Data: SwiftProtobuf.Message, SwiftProtobuf._MessageImplem
}
}

extension Clarifai_Api_Part: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".Part"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "data"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularMessageField(value: &self._data) }()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every if/case branch local when no optimizations
// are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
// https://github.com/apple/swift-protobuf/issues/1182
try { if let v = self._data {
try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
} }()
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Clarifai_Api_Part, rhs: Clarifai_Api_Part) -> Bool {
if lhs._data != rhs._data {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Clarifai_Api_Region: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".Region"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
Expand Down Expand Up @@ -15154,6 +15274,50 @@ extension Clarifai_Api_Frame: SwiftProtobuf.Message, SwiftProtobuf._MessageImple
}
}

extension Clarifai_Api_NDArray: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".NDArray"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
1: .same(proto: "buffer"),
2: .same(proto: "shape"),
3: .same(proto: "dtype"),
]

public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
// The use of inline closures is to circumvent an issue where the compiler
// allocates stack space for every case branch when no optimizations are
// enabled. https://github.com/apple/swift-protobuf/issues/1034
switch fieldNumber {
case 1: try { try decoder.decodeSingularBytesField(value: &self.buffer) }()
case 2: try { try decoder.decodeRepeatedUInt32Field(value: &self.shape) }()
case 3: try { try decoder.decodeSingularStringField(value: &self.dtype) }()
default: break
}
}
}

public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
if !self.buffer.isEmpty {
try visitor.visitSingularBytesField(value: self.buffer, fieldNumber: 1)
}
if !self.shape.isEmpty {
try visitor.visitPackedUInt32Field(value: self.shape, fieldNumber: 2)
}
if !self.dtype.isEmpty {
try visitor.visitSingularStringField(value: self.dtype, fieldNumber: 3)
}
try unknownFields.traverse(visitor: &visitor)
}

public static func ==(lhs: Clarifai_Api_NDArray, rhs: Clarifai_Api_NDArray) -> Bool {
if lhs.buffer != rhs.buffer {return false}
if lhs.shape != rhs.shape {return false}
if lhs.dtype != rhs.dtype {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
}

extension Clarifai_Api_Mask: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
public static let protoMessageName: String = _protobuf_package + ".Mask"
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ public enum Clarifai_Api_Status_StatusCode: SwiftProtobuf.Enum {
/// Billing related issues: 69xxx
case billingInvalidInfo // = 69000

/// Logs related issues: 70000;
case logEntriesInvalidRequest // = 70000

/// Internal issues: 98xxx
case internalServerIssue // = 98004
case internalFetchingIssue // = 98005
Expand Down Expand Up @@ -1037,6 +1040,7 @@ public enum Clarifai_Api_Status_StatusCode: SwiftProtobuf.Enum {
case 68005: self = .uploadCanceled
case 68006: self = .uploadConflict
case 69000: self = .billingInvalidInfo
case 70000: self = .logEntriesInvalidRequest
case 90400: self = .badRequest
case 90500: self = .serverError
case 98004: self = .internalServerIssue
Expand Down Expand Up @@ -1425,6 +1429,7 @@ public enum Clarifai_Api_Status_StatusCode: SwiftProtobuf.Enum {
case .uploadCanceled: return 68005
case .uploadConflict: return 68006
case .billingInvalidInfo: return 69000
case .logEntriesInvalidRequest: return 70000
case .badRequest: return 90400
case .serverError: return 90500
case .internalServerIssue: return 98004
Expand Down Expand Up @@ -1818,6 +1823,7 @@ extension Clarifai_Api_Status_StatusCode: CaseIterable {
.uploadCanceled,
.uploadConflict,
.billingInvalidInfo,
.logEntriesInvalidRequest,
.internalServerIssue,
.internalFetchingIssue,
.internalDatabaseIssue,
Expand Down Expand Up @@ -2209,6 +2215,7 @@ extension Clarifai_Api_Status_StatusCode: SwiftProtobuf._ProtoNameProviding {
68005: .same(proto: "UPLOAD_CANCELED"),
68006: .same(proto: "UPLOAD_CONFLICT"),
69000: .same(proto: "BILLING_INVALID_INFO"),
70000: .same(proto: "LOG_ENTRIES_INVALID_REQUEST"),
90400: .same(proto: "BAD_REQUEST"),
90500: .same(proto: "SERVER_ERROR"),
98004: .same(proto: "INTERNAL_SERVER_ISSUE"),
Expand Down
5 changes: 5 additions & 0 deletions Sources/ClarifaiGrpc/proto/clarifai/auth/scope/scope.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public enum Clarifai_Auth_Scope_S: SwiftProtobuf.Enum {
case deploymentsDelete // = 146
case instanceTypesGet // = 148
case auditLogsGet // = 149
case logEntriesGet // = 151
case UNRECOGNIZED(Int)

public init() {
Expand Down Expand Up @@ -426,6 +427,7 @@ public enum Clarifai_Auth_Scope_S: SwiftProtobuf.Enum {
case 148: self = .instanceTypesGet
case 149: self = .auditLogsGet
case 150: self = .modelsPull
case 151: self = .logEntriesGet
default: self = .UNRECOGNIZED(rawValue)
}
}
Expand Down Expand Up @@ -534,6 +536,7 @@ public enum Clarifai_Auth_Scope_S: SwiftProtobuf.Enum {
case .instanceTypesGet: return 148
case .auditLogsGet: return 149
case .modelsPull: return 150
case .logEntriesGet: return 151
case .UNRECOGNIZED(let i): return i
}
}
Expand Down Expand Up @@ -647,6 +650,7 @@ extension Clarifai_Auth_Scope_S: CaseIterable {
.deploymentsDelete,
.instanceTypesGet,
.auditLogsGet,
.logEntriesGet,
]
}

Expand Down Expand Up @@ -852,6 +856,7 @@ extension Clarifai_Auth_Scope_S: SwiftProtobuf._ProtoNameProviding {
148: .same(proto: "InstanceTypes_Get"),
149: .same(proto: "AuditLogs_Get"),
150: .same(proto: "Models_Pull"),
151: .same(proto: "LogEntries_Get"),
]
}

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.9.1
10.9.2

0 comments on commit 9110f24

Please sign in to comment.