// DO NOT EDIT. // swift-format-ignore-file // swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: apple_intelligence.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ import Foundation import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. // Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } /// Image data for vision requests public struct Appleintelligence_ImageData: Sendable { // 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. public var data: Data = Data() public var filename: String = String() public var mimeType: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } /// Vision analysis results public struct Appleintelligence_ImageAnalysis: Sendable { // 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. public var textContent: String = String() public var labels: [String] = [] public var description_p: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } /// Completion request public struct Appleintelligence_CompletionRequest: Sendable { // 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. public var prompt: String = String() public var temperature: Float { get {return _temperature ?? 0} set {_temperature = newValue} } /// Returns true if `temperature` has been explicitly set. public var hasTemperature: Bool {return self._temperature != nil} /// Clears the value of `temperature`. Subsequent reads from it will return its default value. public mutating func clearTemperature() {self._temperature = nil} public var maxTokens: Int32 { get {return _maxTokens ?? 0} set {_maxTokens = newValue} } /// Returns true if `maxTokens` has been explicitly set. public var hasMaxTokens: Bool {return self._maxTokens != nil} /// Clears the value of `maxTokens`. Subsequent reads from it will return its default value. public mutating func clearMaxTokens() {self._maxTokens = nil} public var images: [Appleintelligence_ImageData] = [] public var includeAnalysis: Bool = false public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} fileprivate var _temperature: Float? = nil fileprivate var _maxTokens: Int32? = nil } /// Completion response (non-streaming) public struct Appleintelligence_CompletionResponse: Sendable { // 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. public var id: String = String() public var text: String = String() public var finishReason: String = String() public var imageAnalyses: [Appleintelligence_ImageAnalysis] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } /// Streaming completion chunk public struct Appleintelligence_CompletionChunk: Sendable { // 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. public var id: String = String() public var delta: String = String() public var isFinal: Bool = false public var finishReason: String = String() public var imageAnalyses: [Appleintelligence_ImageAnalysis] = [] public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } /// Health check request public struct Appleintelligence_HealthRequest: Sendable { // 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. public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } /// Health check response public struct Appleintelligence_HealthResponse: Sendable { // 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. public var healthy: Bool = false public var modelStatus: String = String() public var unknownFields = SwiftProtobuf.UnknownStorage() public init() {} } // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "appleintelligence" extension Appleintelligence_ImageData: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ImageData" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}data\0\u{1}filename\0\u{3}mime_type\0") public mutating func decodeMessage(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.data) }() case 2: try { try decoder.decodeSingularStringField(value: &self.filename) }() case 3: try { try decoder.decodeSingularStringField(value: &self.mimeType) }() default: break } } } public func traverse(visitor: inout V) throws { if !self.data.isEmpty { try visitor.visitSingularBytesField(value: self.data, fieldNumber: 1) } if !self.filename.isEmpty { try visitor.visitSingularStringField(value: self.filename, fieldNumber: 2) } if !self.mimeType.isEmpty { try visitor.visitSingularStringField(value: self.mimeType, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_ImageData, rhs: Appleintelligence_ImageData) -> Bool { if lhs.data != rhs.data {return false} if lhs.filename != rhs.filename {return false} if lhs.mimeType != rhs.mimeType {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Appleintelligence_ImageAnalysis: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".ImageAnalysis" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}text_content\0\u{1}labels\0\u{1}description\0") public mutating func decodeMessage(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.decodeSingularStringField(value: &self.textContent) }() case 2: try { try decoder.decodeRepeatedStringField(value: &self.labels) }() case 3: try { try decoder.decodeSingularStringField(value: &self.description_p) }() default: break } } } public func traverse(visitor: inout V) throws { if !self.textContent.isEmpty { try visitor.visitSingularStringField(value: self.textContent, fieldNumber: 1) } if !self.labels.isEmpty { try visitor.visitRepeatedStringField(value: self.labels, fieldNumber: 2) } if !self.description_p.isEmpty { try visitor.visitSingularStringField(value: self.description_p, fieldNumber: 3) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_ImageAnalysis, rhs: Appleintelligence_ImageAnalysis) -> Bool { if lhs.textContent != rhs.textContent {return false} if lhs.labels != rhs.labels {return false} if lhs.description_p != rhs.description_p {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Appleintelligence_CompletionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".CompletionRequest" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}prompt\0\u{1}temperature\0\u{3}max_tokens\0\u{1}images\0\u{3}include_analysis\0") public mutating func decodeMessage(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.decodeSingularStringField(value: &self.prompt) }() case 2: try { try decoder.decodeSingularFloatField(value: &self._temperature) }() case 3: try { try decoder.decodeSingularInt32Field(value: &self._maxTokens) }() case 4: try { try decoder.decodeRepeatedMessageField(value: &self.images) }() case 5: try { try decoder.decodeSingularBoolField(value: &self.includeAnalysis) }() default: break } } } public func traverse(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 if !self.prompt.isEmpty { try visitor.visitSingularStringField(value: self.prompt, fieldNumber: 1) } try { if let v = self._temperature { try visitor.visitSingularFloatField(value: v, fieldNumber: 2) } }() try { if let v = self._maxTokens { try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) } }() if !self.images.isEmpty { try visitor.visitRepeatedMessageField(value: self.images, fieldNumber: 4) } if self.includeAnalysis != false { try visitor.visitSingularBoolField(value: self.includeAnalysis, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_CompletionRequest, rhs: Appleintelligence_CompletionRequest) -> Bool { if lhs.prompt != rhs.prompt {return false} if lhs._temperature != rhs._temperature {return false} if lhs._maxTokens != rhs._maxTokens {return false} if lhs.images != rhs.images {return false} if lhs.includeAnalysis != rhs.includeAnalysis {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Appleintelligence_CompletionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".CompletionResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}text\0\u{3}finish_reason\0\u{3}image_analyses\0") public mutating func decodeMessage(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.decodeSingularStringField(value: &self.id) }() case 2: try { try decoder.decodeSingularStringField(value: &self.text) }() case 3: try { try decoder.decodeSingularStringField(value: &self.finishReason) }() case 4: try { try decoder.decodeRepeatedMessageField(value: &self.imageAnalyses) }() default: break } } } public func traverse(visitor: inout V) throws { if !self.id.isEmpty { try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) } if !self.text.isEmpty { try visitor.visitSingularStringField(value: self.text, fieldNumber: 2) } if !self.finishReason.isEmpty { try visitor.visitSingularStringField(value: self.finishReason, fieldNumber: 3) } if !self.imageAnalyses.isEmpty { try visitor.visitRepeatedMessageField(value: self.imageAnalyses, fieldNumber: 4) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_CompletionResponse, rhs: Appleintelligence_CompletionResponse) -> Bool { if lhs.id != rhs.id {return false} if lhs.text != rhs.text {return false} if lhs.finishReason != rhs.finishReason {return false} if lhs.imageAnalyses != rhs.imageAnalyses {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Appleintelligence_CompletionChunk: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".CompletionChunk" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}delta\0\u{3}is_final\0\u{3}finish_reason\0\u{3}image_analyses\0") public mutating func decodeMessage(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.decodeSingularStringField(value: &self.id) }() case 2: try { try decoder.decodeSingularStringField(value: &self.delta) }() case 3: try { try decoder.decodeSingularBoolField(value: &self.isFinal) }() case 4: try { try decoder.decodeSingularStringField(value: &self.finishReason) }() case 5: try { try decoder.decodeRepeatedMessageField(value: &self.imageAnalyses) }() default: break } } } public func traverse(visitor: inout V) throws { if !self.id.isEmpty { try visitor.visitSingularStringField(value: self.id, fieldNumber: 1) } if !self.delta.isEmpty { try visitor.visitSingularStringField(value: self.delta, fieldNumber: 2) } if self.isFinal != false { try visitor.visitSingularBoolField(value: self.isFinal, fieldNumber: 3) } if !self.finishReason.isEmpty { try visitor.visitSingularStringField(value: self.finishReason, fieldNumber: 4) } if !self.imageAnalyses.isEmpty { try visitor.visitRepeatedMessageField(value: self.imageAnalyses, fieldNumber: 5) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_CompletionChunk, rhs: Appleintelligence_CompletionChunk) -> Bool { if lhs.id != rhs.id {return false} if lhs.delta != rhs.delta {return false} if lhs.isFinal != rhs.isFinal {return false} if lhs.finishReason != rhs.finishReason {return false} if lhs.imageAnalyses != rhs.imageAnalyses {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Appleintelligence_HealthRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".HealthRequest" public static let _protobuf_nameMap = SwiftProtobuf._NameMap() public mutating func decodeMessage(decoder: inout D) throws { // Load everything into unknown fields while try decoder.nextFieldNumber() != nil {} } public func traverse(visitor: inout V) throws { try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_HealthRequest, rhs: Appleintelligence_HealthRequest) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension Appleintelligence_HealthResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".HealthResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}healthy\0\u{3}model_status\0") public mutating func decodeMessage(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.decodeSingularBoolField(value: &self.healthy) }() case 2: try { try decoder.decodeSingularStringField(value: &self.modelStatus) }() default: break } } } public func traverse(visitor: inout V) throws { if self.healthy != false { try visitor.visitSingularBoolField(value: self.healthy, fieldNumber: 1) } if !self.modelStatus.isEmpty { try visitor.visitSingularStringField(value: self.modelStatus, fieldNumber: 2) } try unknownFields.traverse(visitor: &visitor) } public static func ==(lhs: Appleintelligence_HealthResponse, rhs: Appleintelligence_HealthResponse) -> Bool { if lhs.healthy != rhs.healthy {return false} if lhs.modelStatus != rhs.modelStatus {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } }