diff --git "a/src/proto/message.js" "b/src/proto/message.js" --- "a/src/proto/message.js" +++ "b/src/proto/message.js" @@ -9,32 +9,27 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.ut // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); -$root.ChatMessage = (function() { +$root.AvailableModelsResponse = (function() { /** - * Properties of a ChatMessage. - * @exports IChatMessage - * @interface IChatMessage - * @property {Array.|null} [userMessages] ChatMessage userMessages - * @property {ChatMessage.IInstructions|null} [instructions] ChatMessage instructions - * @property {ChatMessage.IModel|null} [model] ChatMessage model - * @property {number|null} [unknown13] ChatMessage unknown13 - * @property {string|null} [conversationId] ChatMessage conversationId - * @property {number|null} [unknown16] ChatMessage unknown16 - * @property {number|null} [unknown29] ChatMessage unknown29 - * @property {number|null} [unknown31] ChatMessage unknown31 + * Properties of an AvailableModelsResponse. + * @exports IAvailableModelsResponse + * @interface IAvailableModelsResponse + * @property {Array.|null} [models] AvailableModelsResponse models + * @property {Array.|null} [modelNames] AvailableModelsResponse modelNames */ /** - * Constructs a new ChatMessage. - * @exports ChatMessage - * @classdesc Represents a ChatMessage. - * @implements IChatMessage + * Constructs a new AvailableModelsResponse. + * @exports AvailableModelsResponse + * @classdesc Represents an AvailableModelsResponse. + * @implements IAvailableModelsResponse * @constructor - * @param {IChatMessage=} [properties] Properties to set + * @param {IAvailableModelsResponse=} [properties] Properties to set */ - function ChatMessage(properties) { - this.userMessages = []; + function AvailableModelsResponse(properties) { + this.models = []; + this.modelNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42,176 +37,95 @@ $root.ChatMessage = (function() { } /** - * ChatMessage userMessages. - * @member {Array.} userMessages - * @memberof ChatMessage - * @instance - */ - ChatMessage.prototype.userMessages = $util.emptyArray; - - /** - * ChatMessage instructions. - * @member {ChatMessage.IInstructions|null|undefined} instructions - * @memberof ChatMessage - * @instance - */ - ChatMessage.prototype.instructions = null; - - /** - * ChatMessage model. - * @member {ChatMessage.IModel|null|undefined} model - * @memberof ChatMessage - * @instance - */ - ChatMessage.prototype.model = null; - - /** - * ChatMessage unknown13. - * @member {number} unknown13 - * @memberof ChatMessage - * @instance - */ - ChatMessage.prototype.unknown13 = 0; - - /** - * ChatMessage conversationId. - * @member {string} conversationId - * @memberof ChatMessage - * @instance - */ - ChatMessage.prototype.conversationId = ""; - - /** - * ChatMessage unknown16. - * @member {number} unknown16 - * @memberof ChatMessage - * @instance - */ - ChatMessage.prototype.unknown16 = 0; - - /** - * ChatMessage unknown29. - * @member {number} unknown29 - * @memberof ChatMessage + * AvailableModelsResponse models. + * @member {Array.} models + * @memberof AvailableModelsResponse * @instance */ - ChatMessage.prototype.unknown29 = 0; + AvailableModelsResponse.prototype.models = $util.emptyArray; /** - * ChatMessage unknown31. - * @member {number} unknown31 - * @memberof ChatMessage + * AvailableModelsResponse modelNames. + * @member {Array.} modelNames + * @memberof AvailableModelsResponse * @instance */ - ChatMessage.prototype.unknown31 = 0; + AvailableModelsResponse.prototype.modelNames = $util.emptyArray; /** - * Creates a new ChatMessage instance using the specified properties. + * Creates a new AvailableModelsResponse instance using the specified properties. * @function create - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static - * @param {IChatMessage=} [properties] Properties to set - * @returns {ChatMessage} ChatMessage instance + * @param {IAvailableModelsResponse=} [properties] Properties to set + * @returns {AvailableModelsResponse} AvailableModelsResponse instance */ - ChatMessage.create = function create(properties) { - return new ChatMessage(properties); + AvailableModelsResponse.create = function create(properties) { + return new AvailableModelsResponse(properties); }; /** - * Encodes the specified ChatMessage message. Does not implicitly {@link ChatMessage.verify|verify} messages. + * Encodes the specified AvailableModelsResponse message. Does not implicitly {@link AvailableModelsResponse.verify|verify} messages. * @function encode - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static - * @param {IChatMessage} message ChatMessage message or plain object to encode + * @param {IAvailableModelsResponse} message AvailableModelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChatMessage.encode = function encode(message, writer) { + AvailableModelsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userMessages != null && message.userMessages.length) - for (var i = 0; i < message.userMessages.length; ++i) - $root.ChatMessage.UserMessage.encode(message.userMessages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.instructions != null && Object.hasOwnProperty.call(message, "instructions")) - $root.ChatMessage.Instructions.encode(message.instructions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - $root.ChatMessage.Model.encode(message.model, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.unknown13 != null && Object.hasOwnProperty.call(message, "unknown13")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.unknown13); - if (message.conversationId != null && Object.hasOwnProperty.call(message, "conversationId")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.conversationId); - if (message.unknown16 != null && Object.hasOwnProperty.call(message, "unknown16")) - writer.uint32(/* id 16, wireType 0 =*/128).int32(message.unknown16); - if (message.unknown29 != null && Object.hasOwnProperty.call(message, "unknown29")) - writer.uint32(/* id 29, wireType 0 =*/232).int32(message.unknown29); - if (message.unknown31 != null && Object.hasOwnProperty.call(message, "unknown31")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.unknown31); + if (message.modelNames != null && message.modelNames.length) + for (var i = 0; i < message.modelNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelNames[i]); + if (message.models != null && message.models.length) + for (var i = 0; i < message.models.length; ++i) + $root.AvailableModelsResponse.AvailableModel.encode(message.models[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ChatMessage message, length delimited. Does not implicitly {@link ChatMessage.verify|verify} messages. + * Encodes the specified AvailableModelsResponse message, length delimited. Does not implicitly {@link AvailableModelsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static - * @param {IChatMessage} message ChatMessage message or plain object to encode + * @param {IAvailableModelsResponse} message AvailableModelsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ChatMessage.encodeDelimited = function encodeDelimited(message, writer) { + AvailableModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ChatMessage message from the specified reader or buffer. + * Decodes an AvailableModelsResponse message from the specified reader or buffer. * @function decode - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {ChatMessage} ChatMessage + * @returns {AvailableModelsResponse} AvailableModelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ChatMessage.decode = function decode(reader, length) { + AvailableModelsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChatMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AvailableModelsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: { - if (!(message.userMessages && message.userMessages.length)) - message.userMessages = []; - message.userMessages.push($root.ChatMessage.UserMessage.decode(reader, reader.uint32())); - break; - } - case 4: { - message.instructions = $root.ChatMessage.Instructions.decode(reader, reader.uint32()); - break; - } - case 7: { - message.model = $root.ChatMessage.Model.decode(reader, reader.uint32()); - break; - } - case 13: { - message.unknown13 = reader.int32(); - break; - } - case 15: { - message.conversationId = reader.string(); - break; - } - case 16: { - message.unknown16 = reader.int32(); - break; - } - case 29: { - message.unknown29 = reader.int32(); + if (!(message.models && message.models.length)) + message.models = []; + message.models.push($root.AvailableModelsResponse.AvailableModel.decode(reader, reader.uint32())); break; } - case 31: { - message.unknown31 = reader.int32(); + case 1: { + if (!(message.modelNames && message.modelNames.length)) + message.modelNames = []; + message.modelNames.push(reader.string()); break; } default: @@ -223,206 +137,160 @@ $root.ChatMessage = (function() { }; /** - * Decodes a ChatMessage message from the specified reader or buffer, length delimited. + * Decodes an AvailableModelsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ChatMessage} ChatMessage + * @returns {AvailableModelsResponse} AvailableModelsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ChatMessage.decodeDelimited = function decodeDelimited(reader) { + AvailableModelsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ChatMessage message. + * Verifies an AvailableModelsResponse message. * @function verify - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ChatMessage.verify = function verify(message) { + AvailableModelsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userMessages != null && message.hasOwnProperty("userMessages")) { - if (!Array.isArray(message.userMessages)) - return "userMessages: array expected"; - for (var i = 0; i < message.userMessages.length; ++i) { - var error = $root.ChatMessage.UserMessage.verify(message.userMessages[i]); + if (message.models != null && message.hasOwnProperty("models")) { + if (!Array.isArray(message.models)) + return "models: array expected"; + for (var i = 0; i < message.models.length; ++i) { + var error = $root.AvailableModelsResponse.AvailableModel.verify(message.models[i]); if (error) - return "userMessages." + error; + return "models." + error; } } - if (message.instructions != null && message.hasOwnProperty("instructions")) { - var error = $root.ChatMessage.Instructions.verify(message.instructions); - if (error) - return "instructions." + error; - } - if (message.model != null && message.hasOwnProperty("model")) { - var error = $root.ChatMessage.Model.verify(message.model); - if (error) - return "model." + error; + if (message.modelNames != null && message.hasOwnProperty("modelNames")) { + if (!Array.isArray(message.modelNames)) + return "modelNames: array expected"; + for (var i = 0; i < message.modelNames.length; ++i) + if (!$util.isString(message.modelNames[i])) + return "modelNames: string[] expected"; } - if (message.unknown13 != null && message.hasOwnProperty("unknown13")) - if (!$util.isInteger(message.unknown13)) - return "unknown13: integer expected"; - if (message.conversationId != null && message.hasOwnProperty("conversationId")) - if (!$util.isString(message.conversationId)) - return "conversationId: string expected"; - if (message.unknown16 != null && message.hasOwnProperty("unknown16")) - if (!$util.isInteger(message.unknown16)) - return "unknown16: integer expected"; - if (message.unknown29 != null && message.hasOwnProperty("unknown29")) - if (!$util.isInteger(message.unknown29)) - return "unknown29: integer expected"; - if (message.unknown31 != null && message.hasOwnProperty("unknown31")) - if (!$util.isInteger(message.unknown31)) - return "unknown31: integer expected"; return null; }; /** - * Creates a ChatMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AvailableModelsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static * @param {Object.} object Plain object - * @returns {ChatMessage} ChatMessage + * @returns {AvailableModelsResponse} AvailableModelsResponse */ - ChatMessage.fromObject = function fromObject(object) { - if (object instanceof $root.ChatMessage) + AvailableModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.AvailableModelsResponse) return object; - var message = new $root.ChatMessage(); - if (object.userMessages) { - if (!Array.isArray(object.userMessages)) - throw TypeError(".ChatMessage.userMessages: array expected"); - message.userMessages = []; - for (var i = 0; i < object.userMessages.length; ++i) { - if (typeof object.userMessages[i] !== "object") - throw TypeError(".ChatMessage.userMessages: object expected"); - message.userMessages[i] = $root.ChatMessage.UserMessage.fromObject(object.userMessages[i]); + var message = new $root.AvailableModelsResponse(); + if (object.models) { + if (!Array.isArray(object.models)) + throw TypeError(".AvailableModelsResponse.models: array expected"); + message.models = []; + for (var i = 0; i < object.models.length; ++i) { + if (typeof object.models[i] !== "object") + throw TypeError(".AvailableModelsResponse.models: object expected"); + message.models[i] = $root.AvailableModelsResponse.AvailableModel.fromObject(object.models[i]); } } - if (object.instructions != null) { - if (typeof object.instructions !== "object") - throw TypeError(".ChatMessage.instructions: object expected"); - message.instructions = $root.ChatMessage.Instructions.fromObject(object.instructions); - } - if (object.model != null) { - if (typeof object.model !== "object") - throw TypeError(".ChatMessage.model: object expected"); - message.model = $root.ChatMessage.Model.fromObject(object.model); + if (object.modelNames) { + if (!Array.isArray(object.modelNames)) + throw TypeError(".AvailableModelsResponse.modelNames: array expected"); + message.modelNames = []; + for (var i = 0; i < object.modelNames.length; ++i) + message.modelNames[i] = String(object.modelNames[i]); } - if (object.unknown13 != null) - message.unknown13 = object.unknown13 | 0; - if (object.conversationId != null) - message.conversationId = String(object.conversationId); - if (object.unknown16 != null) - message.unknown16 = object.unknown16 | 0; - if (object.unknown29 != null) - message.unknown29 = object.unknown29 | 0; - if (object.unknown31 != null) - message.unknown31 = object.unknown31 | 0; return message; }; /** - * Creates a plain object from a ChatMessage message. Also converts values to other types if specified. + * Creates a plain object from an AvailableModelsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static - * @param {ChatMessage} message ChatMessage + * @param {AvailableModelsResponse} message AvailableModelsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ChatMessage.toObject = function toObject(message, options) { + AvailableModelsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.userMessages = []; - if (options.defaults) { - object.instructions = null; - object.model = null; - object.unknown13 = 0; - object.conversationId = ""; - object.unknown16 = 0; - object.unknown29 = 0; - object.unknown31 = 0; + if (options.arrays || options.defaults) { + object.modelNames = []; + object.models = []; + } + if (message.modelNames && message.modelNames.length) { + object.modelNames = []; + for (var j = 0; j < message.modelNames.length; ++j) + object.modelNames[j] = message.modelNames[j]; } - if (message.userMessages && message.userMessages.length) { - object.userMessages = []; - for (var j = 0; j < message.userMessages.length; ++j) - object.userMessages[j] = $root.ChatMessage.UserMessage.toObject(message.userMessages[j], options); + if (message.models && message.models.length) { + object.models = []; + for (var j = 0; j < message.models.length; ++j) + object.models[j] = $root.AvailableModelsResponse.AvailableModel.toObject(message.models[j], options); } - if (message.instructions != null && message.hasOwnProperty("instructions")) - object.instructions = $root.ChatMessage.Instructions.toObject(message.instructions, options); - if (message.model != null && message.hasOwnProperty("model")) - object.model = $root.ChatMessage.Model.toObject(message.model, options); - if (message.unknown13 != null && message.hasOwnProperty("unknown13")) - object.unknown13 = message.unknown13; - if (message.conversationId != null && message.hasOwnProperty("conversationId")) - object.conversationId = message.conversationId; - if (message.unknown16 != null && message.hasOwnProperty("unknown16")) - object.unknown16 = message.unknown16; - if (message.unknown29 != null && message.hasOwnProperty("unknown29")) - object.unknown29 = message.unknown29; - if (message.unknown31 != null && message.hasOwnProperty("unknown31")) - object.unknown31 = message.unknown31; return object; }; /** - * Converts this ChatMessage to JSON. + * Converts this AvailableModelsResponse to JSON. * @function toJSON - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @instance * @returns {Object.} JSON object */ - ChatMessage.prototype.toJSON = function toJSON() { + AvailableModelsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ChatMessage + * Gets the default type url for AvailableModelsResponse * @function getTypeUrl - * @memberof ChatMessage + * @memberof AvailableModelsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ChatMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AvailableModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/ChatMessage"; + return typeUrlPrefix + "/AvailableModelsResponse"; }; - ChatMessage.UserMessage = (function() { + AvailableModelsResponse.AvailableModel = (function() { /** - * Properties of a UserMessage. - * @memberof ChatMessage - * @interface IUserMessage - * @property {string|null} [content] UserMessage content - * @property {number|null} [role] UserMessage role - * @property {string|null} [messageId] UserMessage messageId + * Properties of an AvailableModel. + * @memberof AvailableModelsResponse + * @interface IAvailableModel + * @property {string|null} [name] AvailableModel name + * @property {boolean|null} [defaultOn] AvailableModel defaultOn + * @property {boolean|null} [isLongContextOnly] AvailableModel isLongContextOnly + * @property {boolean|null} [isChatOnly] AvailableModel isChatOnly */ /** - * Constructs a new UserMessage. - * @memberof ChatMessage - * @classdesc Represents a UserMessage. - * @implements IUserMessage + * Constructs a new AvailableModel. + * @memberof AvailableModelsResponse + * @classdesc Represents an AvailableModel. + * @implements IAvailableModel * @constructor - * @param {ChatMessage.IUserMessage=} [properties] Properties to set + * @param {AvailableModelsResponse.IAvailableModel=} [properties] Properties to set */ - function UserMessage(properties) { + function AvailableModel(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -430,103 +298,132 @@ $root.ChatMessage = (function() { } /** - * UserMessage content. - * @member {string} content - * @memberof ChatMessage.UserMessage + * AvailableModel name. + * @member {string} name + * @memberof AvailableModelsResponse.AvailableModel * @instance */ - UserMessage.prototype.content = ""; + AvailableModel.prototype.name = ""; + + /** + * AvailableModel defaultOn. + * @member {boolean} defaultOn + * @memberof AvailableModelsResponse.AvailableModel + * @instance + */ + AvailableModel.prototype.defaultOn = false; /** - * UserMessage role. - * @member {number} role - * @memberof ChatMessage.UserMessage + * AvailableModel isLongContextOnly. + * @member {boolean|null|undefined} isLongContextOnly + * @memberof AvailableModelsResponse.AvailableModel * @instance */ - UserMessage.prototype.role = 0; + AvailableModel.prototype.isLongContextOnly = null; /** - * UserMessage messageId. - * @member {string} messageId - * @memberof ChatMessage.UserMessage + * AvailableModel isChatOnly. + * @member {boolean|null|undefined} isChatOnly + * @memberof AvailableModelsResponse.AvailableModel * @instance */ - UserMessage.prototype.messageId = ""; + AvailableModel.prototype.isChatOnly = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AvailableModel.prototype, "_isLongContextOnly", { + get: $util.oneOfGetter($oneOfFields = ["isLongContextOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AvailableModel.prototype, "_isChatOnly", { + get: $util.oneOfGetter($oneOfFields = ["isChatOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new UserMessage instance using the specified properties. + * Creates a new AvailableModel instance using the specified properties. * @function create - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static - * @param {ChatMessage.IUserMessage=} [properties] Properties to set - * @returns {ChatMessage.UserMessage} UserMessage instance + * @param {AvailableModelsResponse.IAvailableModel=} [properties] Properties to set + * @returns {AvailableModelsResponse.AvailableModel} AvailableModel instance */ - UserMessage.create = function create(properties) { - return new UserMessage(properties); + AvailableModel.create = function create(properties) { + return new AvailableModel(properties); }; /** - * Encodes the specified UserMessage message. Does not implicitly {@link ChatMessage.UserMessage.verify|verify} messages. + * Encodes the specified AvailableModel message. Does not implicitly {@link AvailableModelsResponse.AvailableModel.verify|verify} messages. * @function encode - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static - * @param {ChatMessage.IUserMessage} message UserMessage message or plain object to encode + * @param {AvailableModelsResponse.IAvailableModel} message AvailableModel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserMessage.encode = function encode(message, writer) { + AvailableModel.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.role); - if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.messageId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.defaultOn != null && Object.hasOwnProperty.call(message, "defaultOn")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultOn); + if (message.isLongContextOnly != null && Object.hasOwnProperty.call(message, "isLongContextOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isLongContextOnly); + if (message.isChatOnly != null && Object.hasOwnProperty.call(message, "isChatOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isChatOnly); return writer; }; /** - * Encodes the specified UserMessage message, length delimited. Does not implicitly {@link ChatMessage.UserMessage.verify|verify} messages. + * Encodes the specified AvailableModel message, length delimited. Does not implicitly {@link AvailableModelsResponse.AvailableModel.verify|verify} messages. * @function encodeDelimited - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static - * @param {ChatMessage.IUserMessage} message UserMessage message or plain object to encode + * @param {AvailableModelsResponse.IAvailableModel} message AvailableModel message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserMessage.encodeDelimited = function encodeDelimited(message, writer) { + AvailableModel.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserMessage message from the specified reader or buffer. + * Decodes an AvailableModel message from the specified reader or buffer. * @function decode - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {ChatMessage.UserMessage} UserMessage + * @returns {AvailableModelsResponse.AvailableModel} AvailableModel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserMessage.decode = function decode(reader, length) { + AvailableModel.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChatMessage.UserMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AvailableModelsResponse.AvailableModel(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.content = reader.string(); + message.name = reader.string(); break; } case 2: { - message.role = reader.int32(); + message.defaultOn = reader.bool(); break; } - case 13: { - message.messageId = reader.string(); + case 3: { + message.isLongContextOnly = reader.bool(); + break; + } + case 4: { + message.isChatOnly = reader.bool(); break; } default: @@ -538,433 +435,1288 @@ $root.ChatMessage = (function() { }; /** - * Decodes a UserMessage message from the specified reader or buffer, length delimited. + * Decodes an AvailableModel message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ChatMessage.UserMessage} UserMessage + * @returns {AvailableModelsResponse.AvailableModel} AvailableModel * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserMessage.decodeDelimited = function decodeDelimited(reader) { + AvailableModel.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserMessage message. + * Verifies an AvailableModel message. * @function verify - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserMessage.verify = function verify(message) { + AvailableModel.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.role != null && message.hasOwnProperty("role")) - if (!$util.isInteger(message.role)) - return "role: integer expected"; - if (message.messageId != null && message.hasOwnProperty("messageId")) - if (!$util.isString(message.messageId)) - return "messageId: string expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.defaultOn != null && message.hasOwnProperty("defaultOn")) + if (typeof message.defaultOn !== "boolean") + return "defaultOn: boolean expected"; + if (message.isLongContextOnly != null && message.hasOwnProperty("isLongContextOnly")) { + properties._isLongContextOnly = 1; + if (typeof message.isLongContextOnly !== "boolean") + return "isLongContextOnly: boolean expected"; + } + if (message.isChatOnly != null && message.hasOwnProperty("isChatOnly")) { + properties._isChatOnly = 1; + if (typeof message.isChatOnly !== "boolean") + return "isChatOnly: boolean expected"; + } return null; }; /** - * Creates a UserMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AvailableModel message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static * @param {Object.} object Plain object - * @returns {ChatMessage.UserMessage} UserMessage + * @returns {AvailableModelsResponse.AvailableModel} AvailableModel */ - UserMessage.fromObject = function fromObject(object) { - if (object instanceof $root.ChatMessage.UserMessage) + AvailableModel.fromObject = function fromObject(object) { + if (object instanceof $root.AvailableModelsResponse.AvailableModel) return object; - var message = new $root.ChatMessage.UserMessage(); - if (object.content != null) - message.content = String(object.content); - if (object.role != null) - message.role = object.role | 0; - if (object.messageId != null) - message.messageId = String(object.messageId); + var message = new $root.AvailableModelsResponse.AvailableModel(); + if (object.name != null) + message.name = String(object.name); + if (object.defaultOn != null) + message.defaultOn = Boolean(object.defaultOn); + if (object.isLongContextOnly != null) + message.isLongContextOnly = Boolean(object.isLongContextOnly); + if (object.isChatOnly != null) + message.isChatOnly = Boolean(object.isChatOnly); return message; }; /** - * Creates a plain object from a UserMessage message. Also converts values to other types if specified. + * Creates a plain object from an AvailableModel message. Also converts values to other types if specified. * @function toObject - * @memberof ChatMessage.UserMessage + * @memberof AvailableModelsResponse.AvailableModel * @static - * @param {ChatMessage.UserMessage} message UserMessage + * @param {AvailableModelsResponse.AvailableModel} message AvailableModel * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserMessage.toObject = function toObject(message, options) { + AvailableModel.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.content = ""; - object.role = 0; - object.messageId = ""; + object.name = ""; + object.defaultOn = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.defaultOn != null && message.hasOwnProperty("defaultOn")) + object.defaultOn = message.defaultOn; + if (message.isLongContextOnly != null && message.hasOwnProperty("isLongContextOnly")) { + object.isLongContextOnly = message.isLongContextOnly; + if (options.oneofs) + object._isLongContextOnly = "isLongContextOnly"; + } + if (message.isChatOnly != null && message.hasOwnProperty("isChatOnly")) { + object.isChatOnly = message.isChatOnly; + if (options.oneofs) + object._isChatOnly = "isChatOnly"; } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.role != null && message.hasOwnProperty("role")) - object.role = message.role; - if (message.messageId != null && message.hasOwnProperty("messageId")) - object.messageId = message.messageId; return object; }; /** - * Converts this UserMessage to JSON. - * @function toJSON - * @memberof ChatMessage.UserMessage + * Converts this AvailableModel to JSON. + * @function toJSON + * @memberof AvailableModelsResponse.AvailableModel + * @instance + * @returns {Object.} JSON object + */ + AvailableModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AvailableModel + * @function getTypeUrl + * @memberof AvailableModelsResponse.AvailableModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AvailableModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/AvailableModelsResponse.AvailableModel"; + }; + + return AvailableModel; + })(); + + return AvailableModelsResponse; +})(); + +$root.MessageSummary = (function() { + + /** + * Properties of a MessageSummary. + * @exports IMessageSummary + * @interface IMessageSummary + * @property {string|null} [content] MessageSummary content + * @property {string|null} [summaryId1] MessageSummary summaryId1 + * @property {string|null} [summaryId2] MessageSummary summaryId2 + * @property {string|null} [previousSummaryId] MessageSummary previousSummaryId + */ + + /** + * Constructs a new MessageSummary. + * @exports MessageSummary + * @classdesc Represents a MessageSummary. + * @implements IMessageSummary + * @constructor + * @param {IMessageSummary=} [properties] Properties to set + */ + function MessageSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageSummary content. + * @member {string} content + * @memberof MessageSummary + * @instance + */ + MessageSummary.prototype.content = ""; + + /** + * MessageSummary summaryId1. + * @member {string} summaryId1 + * @memberof MessageSummary + * @instance + */ + MessageSummary.prototype.summaryId1 = ""; + + /** + * MessageSummary summaryId2. + * @member {string} summaryId2 + * @memberof MessageSummary + * @instance + */ + MessageSummary.prototype.summaryId2 = ""; + + /** + * MessageSummary previousSummaryId. + * @member {string} previousSummaryId + * @memberof MessageSummary + * @instance + */ + MessageSummary.prototype.previousSummaryId = ""; + + /** + * Creates a new MessageSummary instance using the specified properties. + * @function create + * @memberof MessageSummary + * @static + * @param {IMessageSummary=} [properties] Properties to set + * @returns {MessageSummary} MessageSummary instance + */ + MessageSummary.create = function create(properties) { + return new MessageSummary(properties); + }; + + /** + * Encodes the specified MessageSummary message. Does not implicitly {@link MessageSummary.verify|verify} messages. + * @function encode + * @memberof MessageSummary + * @static + * @param {IMessageSummary} message MessageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.summaryId1 != null && Object.hasOwnProperty.call(message, "summaryId1")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.summaryId1); + if (message.summaryId2 != null && Object.hasOwnProperty.call(message, "summaryId2")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.summaryId2); + if (message.previousSummaryId != null && Object.hasOwnProperty.call(message, "previousSummaryId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.previousSummaryId); + return writer; + }; + + /** + * Encodes the specified MessageSummary message, length delimited. Does not implicitly {@link MessageSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof MessageSummary + * @static + * @param {IMessageSummary} message MessageSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageSummary message from the specified reader or buffer. + * @function decode + * @memberof MessageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {MessageSummary} MessageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.summaryId1 = reader.string(); + break; + } + case 3: { + message.summaryId2 = reader.string(); + break; + } + case 4: { + message.previousSummaryId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof MessageSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {MessageSummary} MessageSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageSummary message. + * @function verify + * @memberof MessageSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.summaryId1 != null && message.hasOwnProperty("summaryId1")) + if (!$util.isString(message.summaryId1)) + return "summaryId1: string expected"; + if (message.summaryId2 != null && message.hasOwnProperty("summaryId2")) + if (!$util.isString(message.summaryId2)) + return "summaryId2: string expected"; + if (message.previousSummaryId != null && message.hasOwnProperty("previousSummaryId")) + if (!$util.isString(message.previousSummaryId)) + return "previousSummaryId: string expected"; + return null; + }; + + /** + * Creates a MessageSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof MessageSummary + * @static + * @param {Object.} object Plain object + * @returns {MessageSummary} MessageSummary + */ + MessageSummary.fromObject = function fromObject(object) { + if (object instanceof $root.MessageSummary) + return object; + var message = new $root.MessageSummary(); + if (object.content != null) + message.content = String(object.content); + if (object.summaryId1 != null) + message.summaryId1 = String(object.summaryId1); + if (object.summaryId2 != null) + message.summaryId2 = String(object.summaryId2); + if (object.previousSummaryId != null) + message.previousSummaryId = String(object.previousSummaryId); + return message; + }; + + /** + * Creates a plain object from a MessageSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof MessageSummary + * @static + * @param {MessageSummary} message MessageSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.summaryId1 = ""; + object.summaryId2 = ""; + object.previousSummaryId = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.summaryId1 != null && message.hasOwnProperty("summaryId1")) + object.summaryId1 = message.summaryId1; + if (message.summaryId2 != null && message.hasOwnProperty("summaryId2")) + object.summaryId2 = message.summaryId2; + if (message.previousSummaryId != null && message.hasOwnProperty("previousSummaryId")) + object.previousSummaryId = message.previousSummaryId; + return object; + }; + + /** + * Converts this MessageSummary to JSON. + * @function toJSON + * @memberof MessageSummary + * @instance + * @returns {Object.} JSON object + */ + MessageSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageSummary + * @function getTypeUrl + * @memberof MessageSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/MessageSummary"; + }; + + return MessageSummary; +})(); + +$root.MessageThinking = (function() { + + /** + * Properties of a MessageThinking. + * @exports IMessageThinking + * @interface IMessageThinking + * @property {string|null} [content] MessageThinking content + */ + + /** + * Constructs a new MessageThinking. + * @exports MessageThinking + * @classdesc Represents a MessageThinking. + * @implements IMessageThinking + * @constructor + * @param {IMessageThinking=} [properties] Properties to set + */ + function MessageThinking(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageThinking content. + * @member {string} content + * @memberof MessageThinking + * @instance + */ + MessageThinking.prototype.content = ""; + + /** + * Creates a new MessageThinking instance using the specified properties. + * @function create + * @memberof MessageThinking + * @static + * @param {IMessageThinking=} [properties] Properties to set + * @returns {MessageThinking} MessageThinking instance + */ + MessageThinking.create = function create(properties) { + return new MessageThinking(properties); + }; + + /** + * Encodes the specified MessageThinking message. Does not implicitly {@link MessageThinking.verify|verify} messages. + * @function encode + * @memberof MessageThinking + * @static + * @param {IMessageThinking} message MessageThinking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageThinking.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + return writer; + }; + + /** + * Encodes the specified MessageThinking message, length delimited. Does not implicitly {@link MessageThinking.verify|verify} messages. + * @function encodeDelimited + * @memberof MessageThinking + * @static + * @param {IMessageThinking} message MessageThinking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageThinking.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageThinking message from the specified reader or buffer. + * @function decode + * @memberof MessageThinking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {MessageThinking} MessageThinking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageThinking.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MessageThinking(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageThinking message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof MessageThinking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {MessageThinking} MessageThinking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageThinking.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageThinking message. + * @function verify + * @memberof MessageThinking + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageThinking.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a MessageThinking message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof MessageThinking + * @static + * @param {Object.} object Plain object + * @returns {MessageThinking} MessageThinking + */ + MessageThinking.fromObject = function fromObject(object) { + if (object instanceof $root.MessageThinking) + return object; + var message = new $root.MessageThinking(); + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a MessageThinking message. Also converts values to other types if specified. + * @function toObject + * @memberof MessageThinking + * @static + * @param {MessageThinking} message MessageThinking + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageThinking.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.content = ""; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this MessageThinking to JSON. + * @function toJSON + * @memberof MessageThinking + * @instance + * @returns {Object.} JSON object + */ + MessageThinking.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageThinking + * @function getTypeUrl + * @memberof MessageThinking + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageThinking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/MessageThinking"; + }; + + return MessageThinking; +})(); + +$root.StreamUnifiedChatWithToolsRequest = (function() { + + /** + * Properties of a StreamUnifiedChatWithToolsRequest. + * @exports IStreamUnifiedChatWithToolsRequest + * @interface IStreamUnifiedChatWithToolsRequest + * @property {StreamUnifiedChatWithToolsRequest.IRequest|null} [request] StreamUnifiedChatWithToolsRequest request + */ + + /** + * Constructs a new StreamUnifiedChatWithToolsRequest. + * @exports StreamUnifiedChatWithToolsRequest + * @classdesc Represents a StreamUnifiedChatWithToolsRequest. + * @implements IStreamUnifiedChatWithToolsRequest + * @constructor + * @param {IStreamUnifiedChatWithToolsRequest=} [properties] Properties to set + */ + function StreamUnifiedChatWithToolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamUnifiedChatWithToolsRequest request. + * @member {StreamUnifiedChatWithToolsRequest.IRequest|null|undefined} request + * @memberof StreamUnifiedChatWithToolsRequest + * @instance + */ + StreamUnifiedChatWithToolsRequest.prototype.request = null; + + /** + * Creates a new StreamUnifiedChatWithToolsRequest instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {IStreamUnifiedChatWithToolsRequest=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest} StreamUnifiedChatWithToolsRequest instance + */ + StreamUnifiedChatWithToolsRequest.create = function create(properties) { + return new StreamUnifiedChatWithToolsRequest(properties); + }; + + /** + * Encodes the specified StreamUnifiedChatWithToolsRequest message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {IStreamUnifiedChatWithToolsRequest} message StreamUnifiedChatWithToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamUnifiedChatWithToolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + $root.StreamUnifiedChatWithToolsRequest.Request.encode(message.request, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamUnifiedChatWithToolsRequest message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {IStreamUnifiedChatWithToolsRequest} message StreamUnifiedChatWithToolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamUnifiedChatWithToolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamUnifiedChatWithToolsRequest message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest} StreamUnifiedChatWithToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamUnifiedChatWithToolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.request = $root.StreamUnifiedChatWithToolsRequest.Request.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamUnifiedChatWithToolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest} StreamUnifiedChatWithToolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamUnifiedChatWithToolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamUnifiedChatWithToolsRequest message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamUnifiedChatWithToolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.request != null && message.hasOwnProperty("request")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.verify(message.request); + if (error) + return "request." + error; + } + return null; + }; + + /** + * Creates a StreamUnifiedChatWithToolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest} StreamUnifiedChatWithToolsRequest + */ + StreamUnifiedChatWithToolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest(); + if (object.request != null) { + if (typeof object.request !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.request: object expected"); + message.request = $root.StreamUnifiedChatWithToolsRequest.Request.fromObject(object.request); + } + return message; + }; + + /** + * Creates a plain object from a StreamUnifiedChatWithToolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {StreamUnifiedChatWithToolsRequest} message StreamUnifiedChatWithToolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamUnifiedChatWithToolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.request = null; + if (message.request != null && message.hasOwnProperty("request")) + object.request = $root.StreamUnifiedChatWithToolsRequest.Request.toObject(message.request, options); + return object; + }; + + /** + * Converts this StreamUnifiedChatWithToolsRequest to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest + * @instance + * @returns {Object.} JSON object + */ + StreamUnifiedChatWithToolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamUnifiedChatWithToolsRequest + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamUnifiedChatWithToolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest"; + }; + + StreamUnifiedChatWithToolsRequest.Request = (function() { + + /** + * Properties of a Request. + * @memberof StreamUnifiedChatWithToolsRequest + * @interface IRequest + * @property {Array.|null} [messages] Request messages + * @property {number|null} [unknown2] Request unknown2 + * @property {StreamUnifiedChatWithToolsRequest.Request.IInstruction|null} [instruction] Request instruction + * @property {number|null} [unknown4] Request unknown4 + * @property {StreamUnifiedChatWithToolsRequest.Request.IModel|null} [model] Request model + * @property {Array.|null} [wikiTool] Request wikiTool + * @property {string|null} [webTool] Request webTool + * @property {number|null} [unknown13] Request unknown13 + * @property {StreamUnifiedChatWithToolsRequest.Request.ICursorSetting|null} [cursorSetting] Request cursorSetting + * @property {number|null} [unknown19] Request unknown19 + * @property {number|null} [unknown22] Request unknown22 + * @property {string|null} [conversationId] Request conversationId + * @property {StreamUnifiedChatWithToolsRequest.Request.IMetadata|null} [metadata] Request metadata + * @property {number|null} [unknown27] Request unknown27 + * @property {string|null} [unknown29] Request unknown29 + * @property {Array.|null} [messageIds] Request messageIds + * @property {number|null} [largeContext] Request largeContext + * @property {number|null} [unknown38] Request unknown38 + * @property {number|null} [chatModeEnum] Request chatModeEnum + * @property {string|null} [unknown47] Request unknown47 + * @property {number|null} [unknown48] Request unknown48 + * @property {number|null} [unknown49] Request unknown49 + * @property {number|null} [unknown51] Request unknown51 + * @property {number|null} [unknown53] Request unknown53 + * @property {string|null} [chatMode] Request chatMode + */ + + /** + * Constructs a new Request. + * @memberof StreamUnifiedChatWithToolsRequest + * @classdesc Represents a Request. + * @implements IRequest + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.IRequest=} [properties] Properties to set + */ + function Request(properties) { + this.messages = []; + this.wikiTool = []; + this.messageIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Request messages. + * @member {Array.} messages + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance + */ + Request.prototype.messages = $util.emptyArray; + + /** + * Request unknown2. + * @member {number} unknown2 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance + */ + Request.prototype.unknown2 = 0; + + /** + * Request instruction. + * @member {StreamUnifiedChatWithToolsRequest.Request.IInstruction|null|undefined} instruction + * @memberof StreamUnifiedChatWithToolsRequest.Request * @instance - * @returns {Object.} JSON object */ - UserMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Request.prototype.instruction = null; /** - * Gets the default type url for UserMessage - * @function getTypeUrl - * @memberof ChatMessage.UserMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Request unknown4. + * @member {number} unknown4 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - UserMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/ChatMessage.UserMessage"; - }; + Request.prototype.unknown4 = 0; - return UserMessage; - })(); + /** + * Request model. + * @member {StreamUnifiedChatWithToolsRequest.Request.IModel|null|undefined} model + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance + */ + Request.prototype.model = null; - ChatMessage.Instructions = (function() { + /** + * Request wikiTool. + * @member {Array.} wikiTool + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance + */ + Request.prototype.wikiTool = $util.emptyArray; /** - * Properties of an Instructions. - * @memberof ChatMessage - * @interface IInstructions - * @property {string|null} [instruction] Instructions instruction + * Request webTool. + * @member {string} webTool + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ + Request.prototype.webTool = ""; /** - * Constructs a new Instructions. - * @memberof ChatMessage - * @classdesc Represents an Instructions. - * @implements IInstructions - * @constructor - * @param {ChatMessage.IInstructions=} [properties] Properties to set + * Request unknown13. + * @member {number} unknown13 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - function Instructions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Request.prototype.unknown13 = 0; /** - * Instructions instruction. - * @member {string} instruction - * @memberof ChatMessage.Instructions + * Request cursorSetting. + * @member {StreamUnifiedChatWithToolsRequest.Request.ICursorSetting|null|undefined} cursorSetting + * @memberof StreamUnifiedChatWithToolsRequest.Request * @instance */ - Instructions.prototype.instruction = ""; + Request.prototype.cursorSetting = null; /** - * Creates a new Instructions instance using the specified properties. - * @function create - * @memberof ChatMessage.Instructions - * @static - * @param {ChatMessage.IInstructions=} [properties] Properties to set - * @returns {ChatMessage.Instructions} Instructions instance + * Request unknown19. + * @member {number} unknown19 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.create = function create(properties) { - return new Instructions(properties); - }; + Request.prototype.unknown19 = 0; /** - * Encodes the specified Instructions message. Does not implicitly {@link ChatMessage.Instructions.verify|verify} messages. - * @function encode - * @memberof ChatMessage.Instructions - * @static - * @param {ChatMessage.IInstructions} message Instructions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Request unknown22. + * @member {number} unknown22 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instruction); - return writer; - }; + Request.prototype.unknown22 = 0; /** - * Encodes the specified Instructions message, length delimited. Does not implicitly {@link ChatMessage.Instructions.verify|verify} messages. - * @function encodeDelimited - * @memberof ChatMessage.Instructions - * @static - * @param {ChatMessage.IInstructions} message Instructions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Request conversationId. + * @member {string} conversationId + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Request.prototype.conversationId = ""; /** - * Decodes an Instructions message from the specified reader or buffer. - * @function decode - * @memberof ChatMessage.Instructions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ChatMessage.Instructions} Instructions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Request metadata. + * @member {StreamUnifiedChatWithToolsRequest.Request.IMetadata|null|undefined} metadata + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChatMessage.Instructions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.instruction = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Request.prototype.metadata = null; /** - * Decodes an Instructions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ChatMessage.Instructions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ChatMessage.Instructions} Instructions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Request unknown27. + * @member {number} unknown27 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Request.prototype.unknown27 = 0; /** - * Verifies an Instructions message. - * @function verify - * @memberof ChatMessage.Instructions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Request unknown29. + * @member {string} unknown29 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instruction != null && message.hasOwnProperty("instruction")) - if (!$util.isString(message.instruction)) - return "instruction: string expected"; - return null; - }; + Request.prototype.unknown29 = ""; /** - * Creates an Instructions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ChatMessage.Instructions - * @static - * @param {Object.} object Plain object - * @returns {ChatMessage.Instructions} Instructions + * Request messageIds. + * @member {Array.} messageIds + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.fromObject = function fromObject(object) { - if (object instanceof $root.ChatMessage.Instructions) - return object; - var message = new $root.ChatMessage.Instructions(); - if (object.instruction != null) - message.instruction = String(object.instruction); - return message; - }; + Request.prototype.messageIds = $util.emptyArray; /** - * Creates a plain object from an Instructions message. Also converts values to other types if specified. - * @function toObject - * @memberof ChatMessage.Instructions - * @static - * @param {ChatMessage.Instructions} message Instructions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Request largeContext. + * @member {number} largeContext + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.instruction = ""; - if (message.instruction != null && message.hasOwnProperty("instruction")) - object.instruction = message.instruction; - return object; - }; + Request.prototype.largeContext = 0; /** - * Converts this Instructions to JSON. - * @function toJSON - * @memberof ChatMessage.Instructions + * Request unknown38. + * @member {number} unknown38 + * @memberof StreamUnifiedChatWithToolsRequest.Request * @instance - * @returns {Object.} JSON object */ - Instructions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Request.prototype.unknown38 = 0; /** - * Gets the default type url for Instructions - * @function getTypeUrl - * @memberof ChatMessage.Instructions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Request chatModeEnum. + * @member {number} chatModeEnum + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - Instructions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/ChatMessage.Instructions"; - }; + Request.prototype.chatModeEnum = 0; - return Instructions; - })(); + /** + * Request unknown47. + * @member {string} unknown47 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance + */ + Request.prototype.unknown47 = ""; - ChatMessage.Model = (function() { + /** + * Request unknown48. + * @member {number} unknown48 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance + */ + Request.prototype.unknown48 = 0; /** - * Properties of a Model. - * @memberof ChatMessage - * @interface IModel - * @property {string|null} [name] Model name - * @property {Uint8Array|null} [empty] Model empty + * Request unknown49. + * @member {number} unknown49 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ + Request.prototype.unknown49 = 0; /** - * Constructs a new Model. - * @memberof ChatMessage - * @classdesc Represents a Model. - * @implements IModel - * @constructor - * @param {ChatMessage.IModel=} [properties] Properties to set + * Request unknown51. + * @member {number} unknown51 + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @instance */ - function Model(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Request.prototype.unknown51 = 0; /** - * Model name. - * @member {string} name - * @memberof ChatMessage.Model + * Request unknown53. + * @member {number} unknown53 + * @memberof StreamUnifiedChatWithToolsRequest.Request * @instance */ - Model.prototype.name = ""; + Request.prototype.unknown53 = 0; /** - * Model empty. - * @member {Uint8Array} empty - * @memberof ChatMessage.Model + * Request chatMode. + * @member {string} chatMode + * @memberof StreamUnifiedChatWithToolsRequest.Request * @instance */ - Model.prototype.empty = $util.newBuffer([]); + Request.prototype.chatMode = ""; /** - * Creates a new Model instance using the specified properties. + * Creates a new Request instance using the specified properties. * @function create - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static - * @param {ChatMessage.IModel=} [properties] Properties to set - * @returns {ChatMessage.Model} Model instance + * @param {StreamUnifiedChatWithToolsRequest.IRequest=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request} Request instance */ - Model.create = function create(properties) { - return new Model(properties); + Request.create = function create(properties) { + return new Request(properties); }; /** - * Encodes the specified Model message. Does not implicitly {@link ChatMessage.Model.verify|verify} messages. + * Encodes the specified Request message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.verify|verify} messages. * @function encode - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static - * @param {ChatMessage.IModel} message Model message or plain object to encode + * @param {StreamUnifiedChatWithToolsRequest.IRequest} message Request message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Model.encode = function encode(message, writer) { + Request.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.empty != null && Object.hasOwnProperty.call(message, "empty")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.empty); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.StreamUnifiedChatWithToolsRequest.Request.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unknown2 != null && Object.hasOwnProperty.call(message, "unknown2")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.unknown2); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + $root.StreamUnifiedChatWithToolsRequest.Request.Instruction.encode(message.instruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.unknown4 != null && Object.hasOwnProperty.call(message, "unknown4")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.unknown4); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.StreamUnifiedChatWithToolsRequest.Request.Model.encode(message.model, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.wikiTool != null && message.wikiTool.length) + for (var i = 0; i < message.wikiTool.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.wikiTool[i]); + if (message.webTool != null && Object.hasOwnProperty.call(message, "webTool")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.webTool); + if (message.unknown13 != null && Object.hasOwnProperty.call(message, "unknown13")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.unknown13); + if (message.cursorSetting != null && Object.hasOwnProperty.call(message, "cursorSetting")) + $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.encode(message.cursorSetting, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.unknown19 != null && Object.hasOwnProperty.call(message, "unknown19")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.unknown19); + if (message.unknown22 != null && Object.hasOwnProperty.call(message, "unknown22")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.unknown22); + if (message.conversationId != null && Object.hasOwnProperty.call(message, "conversationId")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.conversationId); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.StreamUnifiedChatWithToolsRequest.Request.Metadata.encode(message.metadata, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.unknown27 != null && Object.hasOwnProperty.call(message, "unknown27")) + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.unknown27); + if (message.unknown29 != null && Object.hasOwnProperty.call(message, "unknown29")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.unknown29); + if (message.messageIds != null && message.messageIds.length) + for (var i = 0; i < message.messageIds.length; ++i) + $root.StreamUnifiedChatWithToolsRequest.Request.MessageId.encode(message.messageIds[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.largeContext != null && Object.hasOwnProperty.call(message, "largeContext")) + writer.uint32(/* id 35, wireType 0 =*/280).int32(message.largeContext); + if (message.unknown38 != null && Object.hasOwnProperty.call(message, "unknown38")) + writer.uint32(/* id 38, wireType 0 =*/304).int32(message.unknown38); + if (message.chatModeEnum != null && Object.hasOwnProperty.call(message, "chatModeEnum")) + writer.uint32(/* id 46, wireType 0 =*/368).int32(message.chatModeEnum); + if (message.unknown47 != null && Object.hasOwnProperty.call(message, "unknown47")) + writer.uint32(/* id 47, wireType 2 =*/378).string(message.unknown47); + if (message.unknown48 != null && Object.hasOwnProperty.call(message, "unknown48")) + writer.uint32(/* id 48, wireType 0 =*/384).int32(message.unknown48); + if (message.unknown49 != null && Object.hasOwnProperty.call(message, "unknown49")) + writer.uint32(/* id 49, wireType 0 =*/392).int32(message.unknown49); + if (message.unknown51 != null && Object.hasOwnProperty.call(message, "unknown51")) + writer.uint32(/* id 51, wireType 0 =*/408).int32(message.unknown51); + if (message.unknown53 != null && Object.hasOwnProperty.call(message, "unknown53")) + writer.uint32(/* id 53, wireType 0 =*/424).int32(message.unknown53); + if (message.chatMode != null && Object.hasOwnProperty.call(message, "chatMode")) + writer.uint32(/* id 54, wireType 2 =*/434).string(message.chatMode); return writer; }; /** - * Encodes the specified Model message, length delimited. Does not implicitly {@link ChatMessage.Model.verify|verify} messages. + * Encodes the specified Request message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.verify|verify} messages. * @function encodeDelimited - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static - * @param {ChatMessage.IModel} message Model message or plain object to encode + * @param {StreamUnifiedChatWithToolsRequest.IRequest} message Request message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Model.encodeDelimited = function encodeDelimited(message, writer) { + Request.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Model message from the specified reader or buffer. + * Decodes a Request message from the specified reader or buffer. * @function decode - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {ChatMessage.Model} Model + * @returns {StreamUnifiedChatWithToolsRequest.Request} Request * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Model.decode = function decode(reader, length) { + Request.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ChatMessage.Model(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.StreamUnifiedChatWithToolsRequest.Request.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + message.unknown2 = reader.int32(); + break; + } + case 3: { + message.instruction = $root.StreamUnifiedChatWithToolsRequest.Request.Instruction.decode(reader, reader.uint32()); break; } case 4: { - message.empty = reader.bytes(); + message.unknown4 = reader.int32(); + break; + } + case 5: { + message.model = $root.StreamUnifiedChatWithToolsRequest.Request.Model.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.wikiTool && message.wikiTool.length)) + message.wikiTool = []; + message.wikiTool.push(reader.string()); + break; + } + case 8: { + message.webTool = reader.string(); + break; + } + case 13: { + message.unknown13 = reader.int32(); + break; + } + case 15: { + message.cursorSetting = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.decode(reader, reader.uint32()); + break; + } + case 19: { + message.unknown19 = reader.int32(); + break; + } + case 22: { + message.unknown22 = reader.int32(); + break; + } + case 23: { + message.conversationId = reader.string(); + break; + } + case 26: { + message.metadata = $root.StreamUnifiedChatWithToolsRequest.Request.Metadata.decode(reader, reader.uint32()); + break; + } + case 27: { + message.unknown27 = reader.int32(); + break; + } + case 29: { + message.unknown29 = reader.string(); + break; + } + case 30: { + if (!(message.messageIds && message.messageIds.length)) + message.messageIds = []; + message.messageIds.push($root.StreamUnifiedChatWithToolsRequest.Request.MessageId.decode(reader, reader.uint32())); + break; + } + case 35: { + message.largeContext = reader.int32(); + break; + } + case 38: { + message.unknown38 = reader.int32(); + break; + } + case 46: { + message.chatModeEnum = reader.int32(); + break; + } + case 47: { + message.unknown47 = reader.string(); + break; + } + case 48: { + message.unknown48 = reader.int32(); + break; + } + case 49: { + message.unknown49 = reader.int32(); + break; + } + case 51: { + message.unknown51 = reader.int32(); + break; + } + case 53: { + message.unknown53 = reader.int32(); + break; + } + case 54: { + message.chatMode = reader.string(); break; } default: @@ -976,405 +1728,2798 @@ $root.ChatMessage = (function() { }; /** - * Decodes a Model message from the specified reader or buffer, length delimited. + * Decodes a Request message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ChatMessage.Model} Model + * @returns {StreamUnifiedChatWithToolsRequest.Request} Request * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Model.decodeDelimited = function decodeDelimited(reader) { + Request.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Model message. + * Verifies a Request message. * @function verify - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Model.verify = function verify(message) { + Request.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.empty != null && message.hasOwnProperty("empty")) - if (!(message.empty && typeof message.empty.length === "number" || $util.isString(message.empty))) - return "empty: buffer expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.unknown2 != null && message.hasOwnProperty("unknown2")) + if (!$util.isInteger(message.unknown2)) + return "unknown2: integer expected"; + if (message.instruction != null && message.hasOwnProperty("instruction")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.Instruction.verify(message.instruction); + if (error) + return "instruction." + error; + } + if (message.unknown4 != null && message.hasOwnProperty("unknown4")) + if (!$util.isInteger(message.unknown4)) + return "unknown4: integer expected"; + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.Model.verify(message.model); + if (error) + return "model." + error; + } + if (message.wikiTool != null && message.hasOwnProperty("wikiTool")) { + if (!Array.isArray(message.wikiTool)) + return "wikiTool: array expected"; + for (var i = 0; i < message.wikiTool.length; ++i) + if (!$util.isString(message.wikiTool[i])) + return "wikiTool: string[] expected"; + } + if (message.webTool != null && message.hasOwnProperty("webTool")) + if (!$util.isString(message.webTool)) + return "webTool: string expected"; + if (message.unknown13 != null && message.hasOwnProperty("unknown13")) + if (!$util.isInteger(message.unknown13)) + return "unknown13: integer expected"; + if (message.cursorSetting != null && message.hasOwnProperty("cursorSetting")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.verify(message.cursorSetting); + if (error) + return "cursorSetting." + error; + } + if (message.unknown19 != null && message.hasOwnProperty("unknown19")) + if (!$util.isInteger(message.unknown19)) + return "unknown19: integer expected"; + if (message.unknown22 != null && message.hasOwnProperty("unknown22")) + if (!$util.isInteger(message.unknown22)) + return "unknown22: integer expected"; + if (message.conversationId != null && message.hasOwnProperty("conversationId")) + if (!$util.isString(message.conversationId)) + return "conversationId: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.unknown27 != null && message.hasOwnProperty("unknown27")) + if (!$util.isInteger(message.unknown27)) + return "unknown27: integer expected"; + if (message.unknown29 != null && message.hasOwnProperty("unknown29")) + if (!$util.isString(message.unknown29)) + return "unknown29: string expected"; + if (message.messageIds != null && message.hasOwnProperty("messageIds")) { + if (!Array.isArray(message.messageIds)) + return "messageIds: array expected"; + for (var i = 0; i < message.messageIds.length; ++i) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.MessageId.verify(message.messageIds[i]); + if (error) + return "messageIds." + error; + } + } + if (message.largeContext != null && message.hasOwnProperty("largeContext")) + if (!$util.isInteger(message.largeContext)) + return "largeContext: integer expected"; + if (message.unknown38 != null && message.hasOwnProperty("unknown38")) + if (!$util.isInteger(message.unknown38)) + return "unknown38: integer expected"; + if (message.chatModeEnum != null && message.hasOwnProperty("chatModeEnum")) + if (!$util.isInteger(message.chatModeEnum)) + return "chatModeEnum: integer expected"; + if (message.unknown47 != null && message.hasOwnProperty("unknown47")) + if (!$util.isString(message.unknown47)) + return "unknown47: string expected"; + if (message.unknown48 != null && message.hasOwnProperty("unknown48")) + if (!$util.isInteger(message.unknown48)) + return "unknown48: integer expected"; + if (message.unknown49 != null && message.hasOwnProperty("unknown49")) + if (!$util.isInteger(message.unknown49)) + return "unknown49: integer expected"; + if (message.unknown51 != null && message.hasOwnProperty("unknown51")) + if (!$util.isInteger(message.unknown51)) + return "unknown51: integer expected"; + if (message.unknown53 != null && message.hasOwnProperty("unknown53")) + if (!$util.isInteger(message.unknown53)) + return "unknown53: integer expected"; + if (message.chatMode != null && message.hasOwnProperty("chatMode")) + if (!$util.isString(message.chatMode)) + return "chatMode: string expected"; return null; }; /** - * Creates a Model message from a plain object. Also converts values to their respective internal types. + * Creates a Request message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static * @param {Object.} object Plain object - * @returns {ChatMessage.Model} Model + * @returns {StreamUnifiedChatWithToolsRequest.Request} Request */ - Model.fromObject = function fromObject(object) { - if (object instanceof $root.ChatMessage.Model) + Request.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request) return object; - var message = new $root.ChatMessage.Model(); - if (object.name != null) - message.name = String(object.name); - if (object.empty != null) - if (typeof object.empty === "string") - $util.base64.decode(object.empty, message.empty = $util.newBuffer($util.base64.length(object.empty)), 0); - else if (object.empty.length >= 0) - message.empty = object.empty; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.messages: object expected"); + message.messages[i] = $root.StreamUnifiedChatWithToolsRequest.Request.Message.fromObject(object.messages[i]); + } + } + if (object.unknown2 != null) + message.unknown2 = object.unknown2 | 0; + if (object.instruction != null) { + if (typeof object.instruction !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.instruction: object expected"); + message.instruction = $root.StreamUnifiedChatWithToolsRequest.Request.Instruction.fromObject(object.instruction); + } + if (object.unknown4 != null) + message.unknown4 = object.unknown4 | 0; + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.model: object expected"); + message.model = $root.StreamUnifiedChatWithToolsRequest.Request.Model.fromObject(object.model); + } + if (object.wikiTool) { + if (!Array.isArray(object.wikiTool)) + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.wikiTool: array expected"); + message.wikiTool = []; + for (var i = 0; i < object.wikiTool.length; ++i) + message.wikiTool[i] = String(object.wikiTool[i]); + } + if (object.webTool != null) + message.webTool = String(object.webTool); + if (object.unknown13 != null) + message.unknown13 = object.unknown13 | 0; + if (object.cursorSetting != null) { + if (typeof object.cursorSetting !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.cursorSetting: object expected"); + message.cursorSetting = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.fromObject(object.cursorSetting); + } + if (object.unknown19 != null) + message.unknown19 = object.unknown19 | 0; + if (object.unknown22 != null) + message.unknown22 = object.unknown22 | 0; + if (object.conversationId != null) + message.conversationId = String(object.conversationId); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.metadata: object expected"); + message.metadata = $root.StreamUnifiedChatWithToolsRequest.Request.Metadata.fromObject(object.metadata); + } + if (object.unknown27 != null) + message.unknown27 = object.unknown27 | 0; + if (object.unknown29 != null) + message.unknown29 = String(object.unknown29); + if (object.messageIds) { + if (!Array.isArray(object.messageIds)) + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.messageIds: array expected"); + message.messageIds = []; + for (var i = 0; i < object.messageIds.length; ++i) { + if (typeof object.messageIds[i] !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.messageIds: object expected"); + message.messageIds[i] = $root.StreamUnifiedChatWithToolsRequest.Request.MessageId.fromObject(object.messageIds[i]); + } + } + if (object.largeContext != null) + message.largeContext = object.largeContext | 0; + if (object.unknown38 != null) + message.unknown38 = object.unknown38 | 0; + if (object.chatModeEnum != null) + message.chatModeEnum = object.chatModeEnum | 0; + if (object.unknown47 != null) + message.unknown47 = String(object.unknown47); + if (object.unknown48 != null) + message.unknown48 = object.unknown48 | 0; + if (object.unknown49 != null) + message.unknown49 = object.unknown49 | 0; + if (object.unknown51 != null) + message.unknown51 = object.unknown51 | 0; + if (object.unknown53 != null) + message.unknown53 = object.unknown53 | 0; + if (object.chatMode != null) + message.chatMode = String(object.chatMode); return message; }; /** - * Creates a plain object from a Model message. Also converts values to other types if specified. + * Creates a plain object from a Request message. Also converts values to other types if specified. * @function toObject - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static - * @param {ChatMessage.Model} message Model + * @param {StreamUnifiedChatWithToolsRequest.Request} message Request * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Model.toObject = function toObject(message, options) { + Request.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.wikiTool = []; + object.messageIds = []; + } if (options.defaults) { - object.name = ""; - if (options.bytes === String) - object.empty = ""; - else { - object.empty = []; - if (options.bytes !== Array) - object.empty = $util.newBuffer(object.empty); - } + object.unknown2 = 0; + object.instruction = null; + object.unknown4 = 0; + object.model = null; + object.webTool = ""; + object.unknown13 = 0; + object.cursorSetting = null; + object.unknown19 = 0; + object.unknown22 = 0; + object.conversationId = ""; + object.metadata = null; + object.unknown27 = 0; + object.unknown29 = ""; + object.largeContext = 0; + object.unknown38 = 0; + object.chatModeEnum = 0; + object.unknown47 = ""; + object.unknown48 = 0; + object.unknown49 = 0; + object.unknown51 = 0; + object.unknown53 = 0; + object.chatMode = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.empty != null && message.hasOwnProperty("empty")) - object.empty = options.bytes === String ? $util.base64.encode(message.empty, 0, message.empty.length) : options.bytes === Array ? Array.prototype.slice.call(message.empty) : message.empty; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.StreamUnifiedChatWithToolsRequest.Request.Message.toObject(message.messages[j], options); + } + if (message.unknown2 != null && message.hasOwnProperty("unknown2")) + object.unknown2 = message.unknown2; + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = $root.StreamUnifiedChatWithToolsRequest.Request.Instruction.toObject(message.instruction, options); + if (message.unknown4 != null && message.hasOwnProperty("unknown4")) + object.unknown4 = message.unknown4; + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.StreamUnifiedChatWithToolsRequest.Request.Model.toObject(message.model, options); + if (message.wikiTool && message.wikiTool.length) { + object.wikiTool = []; + for (var j = 0; j < message.wikiTool.length; ++j) + object.wikiTool[j] = message.wikiTool[j]; + } + if (message.webTool != null && message.hasOwnProperty("webTool")) + object.webTool = message.webTool; + if (message.unknown13 != null && message.hasOwnProperty("unknown13")) + object.unknown13 = message.unknown13; + if (message.cursorSetting != null && message.hasOwnProperty("cursorSetting")) + object.cursorSetting = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.toObject(message.cursorSetting, options); + if (message.unknown19 != null && message.hasOwnProperty("unknown19")) + object.unknown19 = message.unknown19; + if (message.unknown22 != null && message.hasOwnProperty("unknown22")) + object.unknown22 = message.unknown22; + if (message.conversationId != null && message.hasOwnProperty("conversationId")) + object.conversationId = message.conversationId; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.StreamUnifiedChatWithToolsRequest.Request.Metadata.toObject(message.metadata, options); + if (message.unknown27 != null && message.hasOwnProperty("unknown27")) + object.unknown27 = message.unknown27; + if (message.unknown29 != null && message.hasOwnProperty("unknown29")) + object.unknown29 = message.unknown29; + if (message.messageIds && message.messageIds.length) { + object.messageIds = []; + for (var j = 0; j < message.messageIds.length; ++j) + object.messageIds[j] = $root.StreamUnifiedChatWithToolsRequest.Request.MessageId.toObject(message.messageIds[j], options); + } + if (message.largeContext != null && message.hasOwnProperty("largeContext")) + object.largeContext = message.largeContext; + if (message.unknown38 != null && message.hasOwnProperty("unknown38")) + object.unknown38 = message.unknown38; + if (message.chatModeEnum != null && message.hasOwnProperty("chatModeEnum")) + object.chatModeEnum = message.chatModeEnum; + if (message.unknown47 != null && message.hasOwnProperty("unknown47")) + object.unknown47 = message.unknown47; + if (message.unknown48 != null && message.hasOwnProperty("unknown48")) + object.unknown48 = message.unknown48; + if (message.unknown49 != null && message.hasOwnProperty("unknown49")) + object.unknown49 = message.unknown49; + if (message.unknown51 != null && message.hasOwnProperty("unknown51")) + object.unknown51 = message.unknown51; + if (message.unknown53 != null && message.hasOwnProperty("unknown53")) + object.unknown53 = message.unknown53; + if (message.chatMode != null && message.hasOwnProperty("chatMode")) + object.chatMode = message.chatMode; return object; }; /** - * Converts this Model to JSON. + * Converts this Request to JSON. * @function toJSON - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @instance * @returns {Object.} JSON object */ - Model.prototype.toJSON = function toJSON() { + Request.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Model + * Gets the default type url for Request * @function getTypeUrl - * @memberof ChatMessage.Model + * @memberof StreamUnifiedChatWithToolsRequest.Request * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Request.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/ChatMessage.Model"; + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request"; }; - return Model; - })(); - - return ChatMessage; -})(); - -$root.ResMessage = (function() { - - /** - * Properties of a ResMessage. - * @exports IResMessage - * @interface IResMessage - * @property {string|null} [content] ResMessage content - * @property {Uint8Array|null} [empty] ResMessage empty - * @property {string|null} [prompt] ResMessage prompt - */ - - /** - * Constructs a new ResMessage. - * @exports ResMessage - * @classdesc Represents a ResMessage. - * @implements IResMessage - * @constructor - * @param {IResMessage=} [properties] Properties to set - */ - function ResMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResMessage content. - * @member {string} content - * @memberof ResMessage - * @instance - */ - ResMessage.prototype.content = ""; - - /** - * ResMessage empty. - * @member {Uint8Array} empty - * @memberof ResMessage - * @instance - */ - ResMessage.prototype.empty = $util.newBuffer([]); + Request.Message = (function() { + + /** + * Properties of a Message. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @interface IMessage + * @property {string|null} [content] Message content + * @property {number|null} [role] Message role + * @property {StreamUnifiedChatWithToolsRequest.Request.Message.IImage|null} [image] Message image + * @property {string|null} [messageId] Message messageId + * @property {string|null} [unknown29] Message unknown29 + * @property {string|null} [summaryId] Message summaryId + * @property {IMessageSummary|null} [summary] Message summary + * @property {IMessageThinking|null} [thinking] Message thinking + * @property {number|null} [chatModeEnum] Message chatModeEnum + */ + + /** + * Constructs a new Message. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ResMessage prompt. - * @member {string} prompt - * @memberof ResMessage - * @instance - */ - ResMessage.prototype.prompt = ""; + /** + * Message content. + * @member {string} content + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.content = ""; + + /** + * Message role. + * @member {number} role + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.role = 0; + + /** + * Message image. + * @member {StreamUnifiedChatWithToolsRequest.Request.Message.IImage|null|undefined} image + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.image = null; + + /** + * Message messageId. + * @member {string} messageId + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.messageId = ""; + + /** + * Message unknown29. + * @member {string} unknown29 + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.unknown29 = ""; + + /** + * Message summaryId. + * @member {string} summaryId + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.summaryId = ""; + + /** + * Message summary. + * @member {IMessageSummary|null|undefined} summary + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.summary = null; + + /** + * Message thinking. + * @member {IMessageThinking|null|undefined} thinking + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.thinking = null; + + /** + * Message chatModeEnum. + * @member {number} chatModeEnum + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + */ + Message.prototype.chatModeEnum = 0; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessage=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Message.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.role); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.encode(message.image, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.messageId); + if (message.unknown29 != null && Object.hasOwnProperty.call(message, "unknown29")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.unknown29); + if (message.summaryId != null && Object.hasOwnProperty.call(message, "summaryId")) + writer.uint32(/* id 32, wireType 2 =*/258).string(message.summaryId); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + $root.MessageSummary.encode(message.summary, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.thinking != null && Object.hasOwnProperty.call(message, "thinking")) + $root.MessageThinking.encode(message.thinking, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.chatModeEnum != null && Object.hasOwnProperty.call(message, "chatModeEnum")) + writer.uint32(/* id 47, wireType 0 =*/376).int32(message.chatModeEnum); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.role = reader.int32(); + break; + } + case 10: { + message.image = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.decode(reader, reader.uint32()); + break; + } + case 13: { + message.messageId = reader.string(); + break; + } + case 29: { + message.unknown29 = reader.string(); + break; + } + case 32: { + message.summaryId = reader.string(); + break; + } + case 39: { + message.summary = $root.MessageSummary.decode(reader, reader.uint32()); + break; + } + case 45: { + message.thinking = $root.MessageThinking.decode(reader, reader.uint32()); + break; + } + case 47: { + message.chatModeEnum = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isInteger(message.role)) + return "role: integer expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + if (message.unknown29 != null && message.hasOwnProperty("unknown29")) + if (!$util.isString(message.unknown29)) + return "unknown29: string expected"; + if (message.summaryId != null && message.hasOwnProperty("summaryId")) + if (!$util.isString(message.summaryId)) + return "summaryId: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) { + var error = $root.MessageSummary.verify(message.summary); + if (error) + return "summary." + error; + } + if (message.thinking != null && message.hasOwnProperty("thinking")) { + var error = $root.MessageThinking.verify(message.thinking); + if (error) + return "thinking." + error; + } + if (message.chatModeEnum != null && message.hasOwnProperty("chatModeEnum")) + if (!$util.isInteger(message.chatModeEnum)) + return "chatModeEnum: integer expected"; + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.Message) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.Message(); + if (object.content != null) + message.content = String(object.content); + if (object.role != null) + message.role = object.role | 0; + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.Message.image: object expected"); + message.image = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.fromObject(object.image); + } + if (object.messageId != null) + message.messageId = String(object.messageId); + if (object.unknown29 != null) + message.unknown29 = String(object.unknown29); + if (object.summaryId != null) + message.summaryId = String(object.summaryId); + if (object.summary != null) { + if (typeof object.summary !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.Message.summary: object expected"); + message.summary = $root.MessageSummary.fromObject(object.summary); + } + if (object.thinking != null) { + if (typeof object.thinking !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.Message.thinking: object expected"); + message.thinking = $root.MessageThinking.fromObject(object.thinking); + } + if (object.chatModeEnum != null) + message.chatModeEnum = object.chatModeEnum | 0; + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.role = 0; + object.image = null; + object.messageId = ""; + object.unknown29 = ""; + object.summaryId = ""; + object.summary = null; + object.thinking = null; + object.chatModeEnum = 0; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.toObject(message.image, options); + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + if (message.unknown29 != null && message.hasOwnProperty("unknown29")) + object.unknown29 = message.unknown29; + if (message.summaryId != null && message.hasOwnProperty("summaryId")) + object.summaryId = message.summaryId; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = $root.MessageSummary.toObject(message.summary, options); + if (message.thinking != null && message.hasOwnProperty("thinking")) + object.thinking = $root.MessageThinking.toObject(message.thinking, options); + if (message.chatModeEnum != null && message.hasOwnProperty("chatModeEnum")) + object.chatModeEnum = message.chatModeEnum; + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.Message"; + }; + + Message.Image = (function() { + + /** + * Properties of an Image. + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @interface IImage + * @property {Uint8Array|null} [data] Image data + * @property {StreamUnifiedChatWithToolsRequest.Request.Message.Image.IMetadata|null} [metadata] Image metadata + */ + + /** + * Constructs a new Image. + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new ResMessage instance using the specified properties. - * @function create - * @memberof ResMessage - * @static - * @param {IResMessage=} [properties] Properties to set - * @returns {ResMessage} ResMessage instance - */ - ResMessage.create = function create(properties) { - return new ResMessage(properties); - }; + /** + * Image data. + * @member {Uint8Array} data + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @instance + */ + Image.prototype.data = $util.newBuffer([]); + + /** + * Image metadata. + * @member {StreamUnifiedChatWithToolsRequest.Request.Message.Image.IMetadata|null|undefined} metadata + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @instance + */ + Image.prototype.metadata = null; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.IImage=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Message.Image.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Message.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.data = reader.bytes(); + break; + } + case 2: { + message.metadata = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image(); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.Message.Image.metadata: object expected"); + message.metadata = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.metadata = null; + } + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.Message.Image"; + }; + + Image.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @interface IMetadata + * @property {number|null} [width] Metadata width + * @property {number|null} [height] Metadata height + */ + + /** + * Constructs a new Metadata. + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.Image.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ResMessage message. Does not implicitly {@link ResMessage.verify|verify} messages. - * @function encode - * @memberof ResMessage - * @static - * @param {IResMessage} message ResMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.empty != null && Object.hasOwnProperty.call(message, "empty")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.empty); - if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.prompt); - return writer; - }; + /** + * Metadata width. + * @member {number} width + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @instance + */ + Metadata.prototype.width = 0; + + /** + * Metadata height. + * @member {number} height + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @instance + */ + Metadata.prototype.height = 0; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.Image.IMetadata=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.Image.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.height); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.Image.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.width = reader.int32(); + break; + } + case 2: { + message.height = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata(); + if (object.width != null) + message.width = object.width | 0; + if (object.height != null) + message.height = object.height | 0; + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.width = 0; + object.height = 0; + } + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.Message.Image.Metadata"; + }; + + return Metadata; + })(); + + return Image; + })(); + + return Message; + })(); + + Request.Instruction = (function() { + + /** + * Properties of an Instruction. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @interface IInstruction + * @property {string|null} [instruction] Instruction instruction + */ + + /** + * Constructs a new Instruction. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @classdesc Represents an Instruction. + * @implements IInstruction + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.IInstruction=} [properties] Properties to set + */ + function Instruction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ResMessage message, length delimited. Does not implicitly {@link ResMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof ResMessage - * @static - * @param {IResMessage} message ResMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Instruction instruction. + * @member {string} instruction + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @instance + */ + Instruction.prototype.instruction = ""; + + /** + * Creates a new Instruction instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IInstruction=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.Instruction} Instruction instance + */ + Instruction.create = function create(properties) { + return new Instruction(properties); + }; + + /** + * Encodes the specified Instruction message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Instruction.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instruction != null && Object.hasOwnProperty.call(message, "instruction")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instruction); + return writer; + }; + + /** + * Encodes the specified Instruction message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Instruction.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IInstruction} message Instruction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instruction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instruction message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.Instruction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.instruction = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instruction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.Instruction} Instruction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instruction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instruction message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instruction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instruction != null && message.hasOwnProperty("instruction")) + if (!$util.isString(message.instruction)) + return "instruction: string expected"; + return null; + }; + + /** + * Creates an Instruction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.Instruction} Instruction + */ + Instruction.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.Instruction) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.Instruction(); + if (object.instruction != null) + message.instruction = String(object.instruction); + return message; + }; + + /** + * Creates a plain object from an Instruction message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Instruction} message Instruction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instruction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.instruction = ""; + if (message.instruction != null && message.hasOwnProperty("instruction")) + object.instruction = message.instruction; + return object; + }; + + /** + * Converts this Instruction to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @instance + * @returns {Object.} JSON object + */ + Instruction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Instruction + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.Instruction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instruction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.Instruction"; + }; + + return Instruction; + })(); + + Request.Model = (function() { + + /** + * Properties of a Model. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @interface IModel + * @property {string|null} [name] Model name + * @property {Uint8Array|null} [empty] Model empty + */ + + /** + * Constructs a new Model. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.IModel=} [properties] Properties to set + */ + function Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a ResMessage message from the specified reader or buffer. - * @function decode - * @memberof ResMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {ResMessage} ResMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.ResMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; + /** + * Model name. + * @member {string} name + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model empty. + * @member {Uint8Array} empty + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @instance + */ + Model.prototype.empty = $util.newBuffer([]); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IModel=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Model.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.empty != null && Object.hasOwnProperty.call(message, "empty")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.empty); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.empty = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - case 4: { - message.empty = reader.bytes(); - break; + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.empty != null && message.hasOwnProperty("empty")) + if (!(message.empty && typeof message.empty.length === "number" || $util.isString(message.empty))) + return "empty: buffer expected"; + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.Model) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.Model(); + if (object.name != null) + message.name = String(object.name); + if (object.empty != null) + if (typeof object.empty === "string") + $util.base64.decode(object.empty, message.empty = $util.newBuffer($util.base64.length(object.empty)), 0); + else if (object.empty.length >= 0) + message.empty = object.empty; + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.empty = ""; + else { + object.empty = []; + if (options.bytes !== Array) + object.empty = $util.newBuffer(object.empty); + } } - case 5: { - message.prompt = reader.string(); - break; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.empty != null && message.hasOwnProperty("empty")) + object.empty = options.bytes === String ? $util.base64.encode(message.empty, 0, message.empty.length) : options.bytes === Array ? Array.prototype.slice.call(message.empty) : message.empty; + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @instance + * @returns {Object.} JSON object + */ + Model.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Model + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - default: - reader.skipType(tag & 7); - break; + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.Model"; + }; + + return Model; + })(); + + Request.CursorSetting = (function() { + + /** + * Properties of a CursorSetting. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @interface ICursorSetting + * @property {string|null} [name] CursorSetting name + * @property {Uint8Array|null} [unknown3] CursorSetting unknown3 + * @property {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.IUnknown6|null} [unknown6] CursorSetting unknown6 + * @property {number|null} [unknown8] CursorSetting unknown8 + * @property {number|null} [unknown9] CursorSetting unknown9 + */ + + /** + * Constructs a new CursorSetting. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @classdesc Represents a CursorSetting. + * @implements ICursorSetting + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.ICursorSetting=} [properties] Properties to set + */ + function CursorSetting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - - /** - * Decodes a ResMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof ResMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {ResMessage} ResMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a ResMessage message. - * @function verify - * @memberof ResMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.empty != null && message.hasOwnProperty("empty")) - if (!(message.empty && typeof message.empty.length === "number" || $util.isString(message.empty))) - return "empty: buffer expected"; - if (message.prompt != null && message.hasOwnProperty("prompt")) - if (!$util.isString(message.prompt)) - return "prompt: string expected"; - return null; - }; + /** + * CursorSetting name. + * @member {string} name + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @instance + */ + CursorSetting.prototype.name = ""; + + /** + * CursorSetting unknown3. + * @member {Uint8Array} unknown3 + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @instance + */ + CursorSetting.prototype.unknown3 = $util.newBuffer([]); + + /** + * CursorSetting unknown6. + * @member {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.IUnknown6|null|undefined} unknown6 + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @instance + */ + CursorSetting.prototype.unknown6 = null; + + /** + * CursorSetting unknown8. + * @member {number} unknown8 + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @instance + */ + CursorSetting.prototype.unknown8 = 0; + + /** + * CursorSetting unknown9. + * @member {number} unknown9 + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @instance + */ + CursorSetting.prototype.unknown9 = 0; + + /** + * Creates a new CursorSetting instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.ICursorSetting=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting} CursorSetting instance + */ + CursorSetting.create = function create(properties) { + return new CursorSetting(properties); + }; + + /** + * Encodes the specified CursorSetting message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.CursorSetting.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.ICursorSetting} message CursorSetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CursorSetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.unknown3 != null && Object.hasOwnProperty.call(message, "unknown3")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.unknown3); + if (message.unknown6 != null && Object.hasOwnProperty.call(message, "unknown6")) + $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.encode(message.unknown6, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.unknown8 != null && Object.hasOwnProperty.call(message, "unknown8")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.unknown8); + if (message.unknown9 != null && Object.hasOwnProperty.call(message, "unknown9")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.unknown9); + return writer; + }; + + /** + * Encodes the specified CursorSetting message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.CursorSetting.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.ICursorSetting} message CursorSetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CursorSetting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CursorSetting message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting} CursorSetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CursorSetting.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.unknown3 = reader.bytes(); + break; + } + case 6: { + message.unknown6 = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.decode(reader, reader.uint32()); + break; + } + case 8: { + message.unknown8 = reader.int32(); + break; + } + case 9: { + message.unknown9 = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CursorSetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting} CursorSetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CursorSetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CursorSetting message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CursorSetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.unknown3 != null && message.hasOwnProperty("unknown3")) + if (!(message.unknown3 && typeof message.unknown3.length === "number" || $util.isString(message.unknown3))) + return "unknown3: buffer expected"; + if (message.unknown6 != null && message.hasOwnProperty("unknown6")) { + var error = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.verify(message.unknown6); + if (error) + return "unknown6." + error; + } + if (message.unknown8 != null && message.hasOwnProperty("unknown8")) + if (!$util.isInteger(message.unknown8)) + return "unknown8: integer expected"; + if (message.unknown9 != null && message.hasOwnProperty("unknown9")) + if (!$util.isInteger(message.unknown9)) + return "unknown9: integer expected"; + return null; + }; + + /** + * Creates a CursorSetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting} CursorSetting + */ + CursorSetting.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting(); + if (object.name != null) + message.name = String(object.name); + if (object.unknown3 != null) + if (typeof object.unknown3 === "string") + $util.base64.decode(object.unknown3, message.unknown3 = $util.newBuffer($util.base64.length(object.unknown3)), 0); + else if (object.unknown3.length >= 0) + message.unknown3 = object.unknown3; + if (object.unknown6 != null) { + if (typeof object.unknown6 !== "object") + throw TypeError(".StreamUnifiedChatWithToolsRequest.Request.CursorSetting.unknown6: object expected"); + message.unknown6 = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.fromObject(object.unknown6); + } + if (object.unknown8 != null) + message.unknown8 = object.unknown8 | 0; + if (object.unknown9 != null) + message.unknown9 = object.unknown9 | 0; + return message; + }; + + /** + * Creates a plain object from a CursorSetting message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.CursorSetting} message CursorSetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CursorSetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + if (options.bytes === String) + object.unknown3 = ""; + else { + object.unknown3 = []; + if (options.bytes !== Array) + object.unknown3 = $util.newBuffer(object.unknown3); + } + object.unknown6 = null; + object.unknown8 = 0; + object.unknown9 = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.unknown3 != null && message.hasOwnProperty("unknown3")) + object.unknown3 = options.bytes === String ? $util.base64.encode(message.unknown3, 0, message.unknown3.length) : options.bytes === Array ? Array.prototype.slice.call(message.unknown3) : message.unknown3; + if (message.unknown6 != null && message.hasOwnProperty("unknown6")) + object.unknown6 = $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.toObject(message.unknown6, options); + if (message.unknown8 != null && message.hasOwnProperty("unknown8")) + object.unknown8 = message.unknown8; + if (message.unknown9 != null && message.hasOwnProperty("unknown9")) + object.unknown9 = message.unknown9; + return object; + }; + + /** + * Converts this CursorSetting to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @instance + * @returns {Object.} JSON object + */ + CursorSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CursorSetting + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CursorSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.CursorSetting"; + }; + + CursorSetting.Unknown6 = (function() { + + /** + * Properties of an Unknown6. + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @interface IUnknown6 + * @property {Uint8Array|null} [unknown1] Unknown6 unknown1 + * @property {Uint8Array|null} [unknown2] Unknown6 unknown2 + */ + + /** + * Constructs a new Unknown6. + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting + * @classdesc Represents an Unknown6. + * @implements IUnknown6 + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.IUnknown6=} [properties] Properties to set + */ + function Unknown6(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a ResMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof ResMessage - * @static - * @param {Object.} object Plain object - * @returns {ResMessage} ResMessage - */ - ResMessage.fromObject = function fromObject(object) { - if (object instanceof $root.ResMessage) - return object; - var message = new $root.ResMessage(); - if (object.content != null) - message.content = String(object.content); - if (object.empty != null) - if (typeof object.empty === "string") - $util.base64.decode(object.empty, message.empty = $util.newBuffer($util.base64.length(object.empty)), 0); - else if (object.empty.length >= 0) - message.empty = object.empty; - if (object.prompt != null) - message.prompt = String(object.prompt); - return message; - }; + /** + * Unknown6 unknown1. + * @member {Uint8Array} unknown1 + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @instance + */ + Unknown6.prototype.unknown1 = $util.newBuffer([]); + + /** + * Unknown6 unknown2. + * @member {Uint8Array} unknown2 + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @instance + */ + Unknown6.prototype.unknown2 = $util.newBuffer([]); + + /** + * Creates a new Unknown6 instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.IUnknown6=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6} Unknown6 instance + */ + Unknown6.create = function create(properties) { + return new Unknown6(properties); + }; + + /** + * Encodes the specified Unknown6 message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.IUnknown6} message Unknown6 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Unknown6.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unknown1 != null && Object.hasOwnProperty.call(message, "unknown1")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.unknown1); + if (message.unknown2 != null && Object.hasOwnProperty.call(message, "unknown2")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.unknown2); + return writer; + }; + + /** + * Encodes the specified Unknown6 message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.IUnknown6} message Unknown6 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Unknown6.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Unknown6 message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6} Unknown6 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Unknown6.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unknown1 = reader.bytes(); + break; + } + case 2: { + message.unknown2 = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Unknown6 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6} Unknown6 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Unknown6.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Unknown6 message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Unknown6.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unknown1 != null && message.hasOwnProperty("unknown1")) + if (!(message.unknown1 && typeof message.unknown1.length === "number" || $util.isString(message.unknown1))) + return "unknown1: buffer expected"; + if (message.unknown2 != null && message.hasOwnProperty("unknown2")) + if (!(message.unknown2 && typeof message.unknown2.length === "number" || $util.isString(message.unknown2))) + return "unknown2: buffer expected"; + return null; + }; + + /** + * Creates an Unknown6 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6} Unknown6 + */ + Unknown6.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6(); + if (object.unknown1 != null) + if (typeof object.unknown1 === "string") + $util.base64.decode(object.unknown1, message.unknown1 = $util.newBuffer($util.base64.length(object.unknown1)), 0); + else if (object.unknown1.length >= 0) + message.unknown1 = object.unknown1; + if (object.unknown2 != null) + if (typeof object.unknown2 === "string") + $util.base64.decode(object.unknown2, message.unknown2 = $util.newBuffer($util.base64.length(object.unknown2)), 0); + else if (object.unknown2.length >= 0) + message.unknown2 = object.unknown2; + return message; + }; + + /** + * Creates a plain object from an Unknown6 message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6} message Unknown6 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Unknown6.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.unknown1 = ""; + else { + object.unknown1 = []; + if (options.bytes !== Array) + object.unknown1 = $util.newBuffer(object.unknown1); + } + if (options.bytes === String) + object.unknown2 = ""; + else { + object.unknown2 = []; + if (options.bytes !== Array) + object.unknown2 = $util.newBuffer(object.unknown2); + } + } + if (message.unknown1 != null && message.hasOwnProperty("unknown1")) + object.unknown1 = options.bytes === String ? $util.base64.encode(message.unknown1, 0, message.unknown1.length) : options.bytes === Array ? Array.prototype.slice.call(message.unknown1) : message.unknown1; + if (message.unknown2 != null && message.hasOwnProperty("unknown2")) + object.unknown2 = options.bytes === String ? $util.base64.encode(message.unknown2, 0, message.unknown2.length) : options.bytes === Array ? Array.prototype.slice.call(message.unknown2) : message.unknown2; + return object; + }; + + /** + * Converts this Unknown6 to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @instance + * @returns {Object.} JSON object + */ + Unknown6.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Unknown6 + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Unknown6.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.CursorSetting.Unknown6"; + }; + + return Unknown6; + })(); + + return CursorSetting; + })(); + + Request.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @interface IMetadata + * @property {string|null} [os] Metadata os + * @property {string|null} [arch] Metadata arch + * @property {string|null} [version] Metadata version + * @property {string|null} [path] Metadata path + * @property {string|null} [timestamp] Metadata timestamp + */ + + /** + * Constructs a new Metadata. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from a ResMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof ResMessage - * @static - * @param {ResMessage} message ResMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - if (options.bytes === String) - object.empty = ""; - else { - object.empty = []; - if (options.bytes !== Array) - object.empty = $util.newBuffer(object.empty); + /** + * Metadata os. + * @member {string} os + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @instance + */ + Metadata.prototype.os = ""; + + /** + * Metadata arch. + * @member {string} arch + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @instance + */ + Metadata.prototype.arch = ""; + + /** + * Metadata version. + * @member {string} version + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @instance + */ + Metadata.prototype.version = ""; + + /** + * Metadata path. + * @member {string} path + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @instance + */ + Metadata.prototype.path = ""; + + /** + * Metadata timestamp. + * @member {string} timestamp + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @instance + */ + Metadata.prototype.timestamp = ""; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMetadata=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Metadata.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.os != null && Object.hasOwnProperty.call(message, "os")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.os); + if (message.arch != null && Object.hasOwnProperty.call(message, "arch")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.arch); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.path); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timestamp); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.os = reader.string(); + break; + } + case 2: { + message.arch = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + case 4: { + message.path = reader.string(); + break; + } + case 5: { + message.timestamp = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.os != null && message.hasOwnProperty("os")) + if (!$util.isString(message.os)) + return "os: string expected"; + if (message.arch != null && message.hasOwnProperty("arch")) + if (!$util.isString(message.arch)) + return "arch: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isString(message.timestamp)) + return "timestamp: string expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.Metadata) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.Metadata(); + if (object.os != null) + message.os = String(object.os); + if (object.arch != null) + message.arch = String(object.arch); + if (object.version != null) + message.version = String(object.version); + if (object.path != null) + message.path = String(object.path); + if (object.timestamp != null) + message.timestamp = String(object.timestamp); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.os = ""; + object.arch = ""; + object.version = ""; + object.path = ""; + object.timestamp = ""; + } + if (message.os != null && message.hasOwnProperty("os")) + object.os = message.os; + if (message.arch != null && message.hasOwnProperty("arch")) + object.arch = message.arch; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + object.timestamp = message.timestamp; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.Metadata"; + }; + + return Metadata; + })(); + + Request.MessageId = (function() { + + /** + * Properties of a MessageId. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @interface IMessageId + * @property {string|null} [messageId] MessageId messageId + * @property {string|null} [summaryId] MessageId summaryId + * @property {number|null} [role] MessageId role + */ + + /** + * Constructs a new MessageId. + * @memberof StreamUnifiedChatWithToolsRequest.Request + * @classdesc Represents a MessageId. + * @implements IMessageId + * @constructor + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessageId=} [properties] Properties to set + */ + function MessageId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - object.prompt = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.empty != null && message.hasOwnProperty("empty")) - object.empty = options.bytes === String ? $util.base64.encode(message.empty, 0, message.empty.length) : options.bytes === Array ? Array.prototype.slice.call(message.empty) : message.empty; - if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = message.prompt; - return object; - }; - /** - * Converts this ResMessage to JSON. - * @function toJSON - * @memberof ResMessage - * @instance - * @returns {Object.} JSON object - */ - ResMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MessageId messageId. + * @member {string} messageId + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @instance + */ + MessageId.prototype.messageId = ""; + + /** + * MessageId summaryId. + * @member {string} summaryId + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @instance + */ + MessageId.prototype.summaryId = ""; + + /** + * MessageId role. + * @member {number} role + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @instance + */ + MessageId.prototype.role = 0; + + /** + * Creates a new MessageId instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessageId=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsRequest.Request.MessageId} MessageId instance + */ + MessageId.create = function create(properties) { + return new MessageId(properties); + }; + + /** + * Encodes the specified MessageId message. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.MessageId.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessageId} message MessageId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageId); + if (message.summaryId != null && Object.hasOwnProperty.call(message, "summaryId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.summaryId); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.role); + return writer; + }; + + /** + * Encodes the specified MessageId message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsRequest.Request.MessageId.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.IMessageId} message MessageId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageId message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsRequest.Request.MessageId} MessageId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsRequest.Request.MessageId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageId = reader.string(); + break; + } + case 2: { + message.summaryId = reader.string(); + break; + } + case 3: { + message.role = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsRequest.Request.MessageId} MessageId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageId message. + * @function verify + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + if (message.summaryId != null && message.hasOwnProperty("summaryId")) + if (!$util.isString(message.summaryId)) + return "summaryId: string expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isInteger(message.role)) + return "role: integer expected"; + return null; + }; + + /** + * Creates a MessageId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsRequest.Request.MessageId} MessageId + */ + MessageId.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsRequest.Request.MessageId) + return object; + var message = new $root.StreamUnifiedChatWithToolsRequest.Request.MessageId(); + if (object.messageId != null) + message.messageId = String(object.messageId); + if (object.summaryId != null) + message.summaryId = String(object.summaryId); + if (object.role != null) + message.role = object.role | 0; + return message; + }; + + /** + * Creates a plain object from a MessageId message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {StreamUnifiedChatWithToolsRequest.Request.MessageId} message MessageId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.messageId = ""; + object.summaryId = ""; + object.role = 0; + } + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + if (message.summaryId != null && message.hasOwnProperty("summaryId")) + object.summaryId = message.summaryId; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + return object; + }; + + /** + * Converts this MessageId to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @instance + * @returns {Object.} JSON object + */ + MessageId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageId + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsRequest.Request.MessageId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsRequest.Request.MessageId"; + }; - /** - * Gets the default type url for ResMessage - * @function getTypeUrl - * @memberof ResMessage - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/ResMessage"; - }; + return MessageId; + })(); + + return Request; + })(); - return ResMessage; + return StreamUnifiedChatWithToolsRequest; })(); -$root.AvailableModelsResponse = (function() { +$root.StreamUnifiedChatWithToolsResponse = (function() { /** - * Properties of an AvailableModelsResponse. - * @exports IAvailableModelsResponse - * @interface IAvailableModelsResponse - * @property {Array.|null} [models] AvailableModelsResponse models - * @property {Array.|null} [modelNames] AvailableModelsResponse modelNames + * Properties of a StreamUnifiedChatWithToolsResponse. + * @exports IStreamUnifiedChatWithToolsResponse + * @interface IStreamUnifiedChatWithToolsResponse + * @property {StreamUnifiedChatWithToolsResponse.IMessage|null} [message] StreamUnifiedChatWithToolsResponse message + * @property {IMessageSummary|null} [summary] StreamUnifiedChatWithToolsResponse summary */ /** - * Constructs a new AvailableModelsResponse. - * @exports AvailableModelsResponse - * @classdesc Represents an AvailableModelsResponse. - * @implements IAvailableModelsResponse + * Constructs a new StreamUnifiedChatWithToolsResponse. + * @exports StreamUnifiedChatWithToolsResponse + * @classdesc Represents a StreamUnifiedChatWithToolsResponse. + * @implements IStreamUnifiedChatWithToolsResponse * @constructor - * @param {IAvailableModelsResponse=} [properties] Properties to set + * @param {IStreamUnifiedChatWithToolsResponse=} [properties] Properties to set */ - function AvailableModelsResponse(properties) { - this.models = []; - this.modelNames = []; + function StreamUnifiedChatWithToolsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1382,95 +4527,89 @@ $root.AvailableModelsResponse = (function() { } /** - * AvailableModelsResponse models. - * @member {Array.} models - * @memberof AvailableModelsResponse + * StreamUnifiedChatWithToolsResponse message. + * @member {StreamUnifiedChatWithToolsResponse.IMessage|null|undefined} message + * @memberof StreamUnifiedChatWithToolsResponse * @instance */ - AvailableModelsResponse.prototype.models = $util.emptyArray; + StreamUnifiedChatWithToolsResponse.prototype.message = null; /** - * AvailableModelsResponse modelNames. - * @member {Array.} modelNames - * @memberof AvailableModelsResponse + * StreamUnifiedChatWithToolsResponse summary. + * @member {IMessageSummary|null|undefined} summary + * @memberof StreamUnifiedChatWithToolsResponse * @instance */ - AvailableModelsResponse.prototype.modelNames = $util.emptyArray; + StreamUnifiedChatWithToolsResponse.prototype.summary = null; /** - * Creates a new AvailableModelsResponse instance using the specified properties. + * Creates a new StreamUnifiedChatWithToolsResponse instance using the specified properties. * @function create - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static - * @param {IAvailableModelsResponse=} [properties] Properties to set - * @returns {AvailableModelsResponse} AvailableModelsResponse instance + * @param {IStreamUnifiedChatWithToolsResponse=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsResponse} StreamUnifiedChatWithToolsResponse instance */ - AvailableModelsResponse.create = function create(properties) { - return new AvailableModelsResponse(properties); + StreamUnifiedChatWithToolsResponse.create = function create(properties) { + return new StreamUnifiedChatWithToolsResponse(properties); }; /** - * Encodes the specified AvailableModelsResponse message. Does not implicitly {@link AvailableModelsResponse.verify|verify} messages. + * Encodes the specified StreamUnifiedChatWithToolsResponse message. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.verify|verify} messages. * @function encode - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static - * @param {IAvailableModelsResponse} message AvailableModelsResponse message or plain object to encode + * @param {IStreamUnifiedChatWithToolsResponse} message StreamUnifiedChatWithToolsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailableModelsResponse.encode = function encode(message, writer) { + StreamUnifiedChatWithToolsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.modelNames != null && message.modelNames.length) - for (var i = 0; i < message.modelNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelNames[i]); - if (message.models != null && message.models.length) - for (var i = 0; i < message.models.length; ++i) - $root.AvailableModelsResponse.AvailableModel.encode(message.models[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.StreamUnifiedChatWithToolsResponse.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + $root.MessageSummary.encode(message.summary, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified AvailableModelsResponse message, length delimited. Does not implicitly {@link AvailableModelsResponse.verify|verify} messages. + * Encodes the specified StreamUnifiedChatWithToolsResponse message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static - * @param {IAvailableModelsResponse} message AvailableModelsResponse message or plain object to encode + * @param {IStreamUnifiedChatWithToolsResponse} message StreamUnifiedChatWithToolsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailableModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + StreamUnifiedChatWithToolsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvailableModelsResponse message from the specified reader or buffer. + * Decodes a StreamUnifiedChatWithToolsResponse message from the specified reader or buffer. * @function decode - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {AvailableModelsResponse} AvailableModelsResponse + * @returns {StreamUnifiedChatWithToolsResponse} StreamUnifiedChatWithToolsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvailableModelsResponse.decode = function decode(reader, length) { + StreamUnifiedChatWithToolsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AvailableModelsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: { - if (!(message.models && message.models.length)) - message.models = []; - message.models.push($root.AvailableModelsResponse.AvailableModel.decode(reader, reader.uint32())); + message.message = $root.StreamUnifiedChatWithToolsResponse.Message.decode(reader, reader.uint32()); break; } - case 1: { - if (!(message.modelNames && message.modelNames.length)) - message.modelNames = []; - message.modelNames.push(reader.string()); + case 3: { + message.summary = $root.MessageSummary.decode(reader, reader.uint32()); break; } default: @@ -1482,160 +4621,144 @@ $root.AvailableModelsResponse = (function() { }; /** - * Decodes an AvailableModelsResponse message from the specified reader or buffer, length delimited. + * Decodes a StreamUnifiedChatWithToolsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {AvailableModelsResponse} AvailableModelsResponse + * @returns {StreamUnifiedChatWithToolsResponse} StreamUnifiedChatWithToolsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvailableModelsResponse.decodeDelimited = function decodeDelimited(reader) { + StreamUnifiedChatWithToolsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvailableModelsResponse message. + * Verifies a StreamUnifiedChatWithToolsResponse message. * @function verify - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AvailableModelsResponse.verify = function verify(message) { + StreamUnifiedChatWithToolsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.models != null && message.hasOwnProperty("models")) { - if (!Array.isArray(message.models)) - return "models: array expected"; - for (var i = 0; i < message.models.length; ++i) { - var error = $root.AvailableModelsResponse.AvailableModel.verify(message.models[i]); - if (error) - return "models." + error; - } - } - if (message.modelNames != null && message.hasOwnProperty("modelNames")) { - if (!Array.isArray(message.modelNames)) - return "modelNames: array expected"; - for (var i = 0; i < message.modelNames.length; ++i) - if (!$util.isString(message.modelNames[i])) - return "modelNames: string[] expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.StreamUnifiedChatWithToolsResponse.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + var error = $root.MessageSummary.verify(message.summary); + if (error) + return "summary." + error; } return null; }; /** - * Creates an AvailableModelsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a StreamUnifiedChatWithToolsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static * @param {Object.} object Plain object - * @returns {AvailableModelsResponse} AvailableModelsResponse + * @returns {StreamUnifiedChatWithToolsResponse} StreamUnifiedChatWithToolsResponse */ - AvailableModelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.AvailableModelsResponse) + StreamUnifiedChatWithToolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsResponse) return object; - var message = new $root.AvailableModelsResponse(); - if (object.models) { - if (!Array.isArray(object.models)) - throw TypeError(".AvailableModelsResponse.models: array expected"); - message.models = []; - for (var i = 0; i < object.models.length; ++i) { - if (typeof object.models[i] !== "object") - throw TypeError(".AvailableModelsResponse.models: object expected"); - message.models[i] = $root.AvailableModelsResponse.AvailableModel.fromObject(object.models[i]); - } + var message = new $root.StreamUnifiedChatWithToolsResponse(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.message: object expected"); + message.message = $root.StreamUnifiedChatWithToolsResponse.Message.fromObject(object.message); } - if (object.modelNames) { - if (!Array.isArray(object.modelNames)) - throw TypeError(".AvailableModelsResponse.modelNames: array expected"); - message.modelNames = []; - for (var i = 0; i < object.modelNames.length; ++i) - message.modelNames[i] = String(object.modelNames[i]); + if (object.summary != null) { + if (typeof object.summary !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.summary: object expected"); + message.summary = $root.MessageSummary.fromObject(object.summary); } return message; }; /** - * Creates a plain object from an AvailableModelsResponse message. Also converts values to other types if specified. + * Creates a plain object from a StreamUnifiedChatWithToolsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static - * @param {AvailableModelsResponse} message AvailableModelsResponse + * @param {StreamUnifiedChatWithToolsResponse} message StreamUnifiedChatWithToolsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvailableModelsResponse.toObject = function toObject(message, options) { + StreamUnifiedChatWithToolsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.modelNames = []; - object.models = []; - } - if (message.modelNames && message.modelNames.length) { - object.modelNames = []; - for (var j = 0; j < message.modelNames.length; ++j) - object.modelNames[j] = message.modelNames[j]; - } - if (message.models && message.models.length) { - object.models = []; - for (var j = 0; j < message.models.length; ++j) - object.models[j] = $root.AvailableModelsResponse.AvailableModel.toObject(message.models[j], options); + if (options.defaults) { + object.message = null; + object.summary = null; } + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.StreamUnifiedChatWithToolsResponse.Message.toObject(message.message, options); + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = $root.MessageSummary.toObject(message.summary, options); return object; }; /** - * Converts this AvailableModelsResponse to JSON. + * Converts this StreamUnifiedChatWithToolsResponse to JSON. * @function toJSON - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @instance * @returns {Object.} JSON object */ - AvailableModelsResponse.prototype.toJSON = function toJSON() { + StreamUnifiedChatWithToolsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AvailableModelsResponse + * Gets the default type url for StreamUnifiedChatWithToolsResponse * @function getTypeUrl - * @memberof AvailableModelsResponse + * @memberof StreamUnifiedChatWithToolsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AvailableModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StreamUnifiedChatWithToolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/AvailableModelsResponse"; + return typeUrlPrefix + "/StreamUnifiedChatWithToolsResponse"; }; - AvailableModelsResponse.AvailableModel = (function() { + StreamUnifiedChatWithToolsResponse.Message = (function() { /** - * Properties of an AvailableModel. - * @memberof AvailableModelsResponse - * @interface IAvailableModel - * @property {string|null} [name] AvailableModel name - * @property {boolean|null} [defaultOn] AvailableModel defaultOn - * @property {boolean|null} [isLongContextOnly] AvailableModel isLongContextOnly - * @property {boolean|null} [isChatOnly] AvailableModel isChatOnly + * Properties of a Message. + * @memberof StreamUnifiedChatWithToolsResponse + * @interface IMessage + * @property {string|null} [content] Message content + * @property {StreamUnifiedChatWithToolsResponse.Message.IWebTool|null} [webtool] Message webtool + * @property {StreamUnifiedChatWithToolsResponse.Message.IUnknown12|null} [unknown12] Message unknown12 + * @property {string|null} [unknown22] Message unknown22 + * @property {string|null} [unknown23] Message unknown23 + * @property {string|null} [unknown27] Message unknown27 + * @property {IMessageThinking|null} [thinking] Message thinking */ /** - * Constructs a new AvailableModel. - * @memberof AvailableModelsResponse - * @classdesc Represents an AvailableModel. - * @implements IAvailableModel + * Constructs a new Message. + * @memberof StreamUnifiedChatWithToolsResponse + * @classdesc Represents a Message. + * @implements IMessage * @constructor - * @param {AvailableModelsResponse.IAvailableModel=} [properties] Properties to set + * @param {StreamUnifiedChatWithToolsResponse.IMessage=} [properties] Properties to set */ - function AvailableModel(properties) { + function Message(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1643,132 +4766,159 @@ $root.AvailableModelsResponse = (function() { } /** - * AvailableModel name. - * @member {string} name - * @memberof AvailableModelsResponse.AvailableModel + * Message content. + * @member {string} content + * @memberof StreamUnifiedChatWithToolsResponse.Message * @instance */ - AvailableModel.prototype.name = ""; + Message.prototype.content = ""; /** - * AvailableModel defaultOn. - * @member {boolean} defaultOn - * @memberof AvailableModelsResponse.AvailableModel + * Message webtool. + * @member {StreamUnifiedChatWithToolsResponse.Message.IWebTool|null|undefined} webtool + * @memberof StreamUnifiedChatWithToolsResponse.Message * @instance */ - AvailableModel.prototype.defaultOn = false; + Message.prototype.webtool = null; /** - * AvailableModel isLongContextOnly. - * @member {boolean|null|undefined} isLongContextOnly - * @memberof AvailableModelsResponse.AvailableModel + * Message unknown12. + * @member {StreamUnifiedChatWithToolsResponse.Message.IUnknown12|null|undefined} unknown12 + * @memberof StreamUnifiedChatWithToolsResponse.Message * @instance */ - AvailableModel.prototype.isLongContextOnly = null; + Message.prototype.unknown12 = null; /** - * AvailableModel isChatOnly. - * @member {boolean|null|undefined} isChatOnly - * @memberof AvailableModelsResponse.AvailableModel + * Message unknown22. + * @member {string} unknown22 + * @memberof StreamUnifiedChatWithToolsResponse.Message * @instance */ - AvailableModel.prototype.isChatOnly = null; + Message.prototype.unknown22 = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Message unknown23. + * @member {string} unknown23 + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @instance + */ + Message.prototype.unknown23 = ""; - // Virtual OneOf for proto3 optional field - Object.defineProperty(AvailableModel.prototype, "_isLongContextOnly", { - get: $util.oneOfGetter($oneOfFields = ["isLongContextOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Message unknown27. + * @member {string} unknown27 + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @instance + */ + Message.prototype.unknown27 = ""; - // Virtual OneOf for proto3 optional field - Object.defineProperty(AvailableModel.prototype, "_isChatOnly", { - get: $util.oneOfGetter($oneOfFields = ["isChatOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Message thinking. + * @member {IMessageThinking|null|undefined} thinking + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @instance + */ + Message.prototype.thinking = null; /** - * Creates a new AvailableModel instance using the specified properties. + * Creates a new Message instance using the specified properties. * @function create - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static - * @param {AvailableModelsResponse.IAvailableModel=} [properties] Properties to set - * @returns {AvailableModelsResponse.AvailableModel} AvailableModel instance + * @param {StreamUnifiedChatWithToolsResponse.IMessage=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsResponse.Message} Message instance */ - AvailableModel.create = function create(properties) { - return new AvailableModel(properties); + Message.create = function create(properties) { + return new Message(properties); }; /** - * Encodes the specified AvailableModel message. Does not implicitly {@link AvailableModelsResponse.AvailableModel.verify|verify} messages. + * Encodes the specified Message message. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.verify|verify} messages. * @function encode - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static - * @param {AvailableModelsResponse.IAvailableModel} message AvailableModel message or plain object to encode + * @param {StreamUnifiedChatWithToolsResponse.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailableModel.encode = function encode(message, writer) { + Message.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.defaultOn != null && Object.hasOwnProperty.call(message, "defaultOn")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultOn); - if (message.isLongContextOnly != null && Object.hasOwnProperty.call(message, "isLongContextOnly")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isLongContextOnly); - if (message.isChatOnly != null && Object.hasOwnProperty.call(message, "isChatOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isChatOnly); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.webtool != null && Object.hasOwnProperty.call(message, "webtool")) + $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.encode(message.webtool, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.unknown12 != null && Object.hasOwnProperty.call(message, "unknown12")) + $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.encode(message.unknown12, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.unknown22 != null && Object.hasOwnProperty.call(message, "unknown22")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.unknown22); + if (message.unknown23 != null && Object.hasOwnProperty.call(message, "unknown23")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.unknown23); + if (message.thinking != null && Object.hasOwnProperty.call(message, "thinking")) + $root.MessageThinking.encode(message.thinking, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.unknown27 != null && Object.hasOwnProperty.call(message, "unknown27")) + writer.uint32(/* id 27, wireType 2 =*/218).string(message.unknown27); return writer; }; /** - * Encodes the specified AvailableModel message, length delimited. Does not implicitly {@link AvailableModelsResponse.AvailableModel.verify|verify} messages. + * Encodes the specified Message message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.verify|verify} messages. * @function encodeDelimited - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static - * @param {AvailableModelsResponse.IAvailableModel} message AvailableModel message or plain object to encode + * @param {StreamUnifiedChatWithToolsResponse.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AvailableModel.encodeDelimited = function encodeDelimited(message, writer) { + Message.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AvailableModel message from the specified reader or buffer. + * Decodes a Message message from the specified reader or buffer. * @function decode - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {AvailableModelsResponse.AvailableModel} AvailableModel + * @returns {StreamUnifiedChatWithToolsResponse.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvailableModel.decode = function decode(reader, length) { + Message.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.AvailableModelsResponse.AvailableModel(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsResponse.Message(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.content = reader.string(); break; } - case 2: { - message.defaultOn = reader.bool(); + case 11: { + message.webtool = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.decode(reader, reader.uint32()); break; } - case 3: { - message.isLongContextOnly = reader.bool(); + case 12: { + message.unknown12 = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.decode(reader, reader.uint32()); break; } - case 4: { - message.isChatOnly = reader.bool(); + case 22: { + message.unknown22 = reader.string(); + break; + } + case 23: { + message.unknown23 = reader.string(); + break; + } + case 27: { + message.unknown27 = reader.string(); + break; + } + case 25: { + message.thinking = $root.MessageThinking.decode(reader, reader.uint32()); break; } default: @@ -1780,139 +4930,1054 @@ $root.AvailableModelsResponse = (function() { }; /** - * Decodes an AvailableModel message from the specified reader or buffer, length delimited. + * Decodes a Message message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {AvailableModelsResponse.AvailableModel} AvailableModel + * @returns {StreamUnifiedChatWithToolsResponse.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AvailableModel.decodeDelimited = function decodeDelimited(reader) { + Message.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AvailableModel message. + * Verifies a Message message. * @function verify - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AvailableModel.verify = function verify(message) { + Message.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.defaultOn != null && message.hasOwnProperty("defaultOn")) - if (typeof message.defaultOn !== "boolean") - return "defaultOn: boolean expected"; - if (message.isLongContextOnly != null && message.hasOwnProperty("isLongContextOnly")) { - properties._isLongContextOnly = 1; - if (typeof message.isLongContextOnly !== "boolean") - return "isLongContextOnly: boolean expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.webtool != null && message.hasOwnProperty("webtool")) { + var error = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.verify(message.webtool); + if (error) + return "webtool." + error; } - if (message.isChatOnly != null && message.hasOwnProperty("isChatOnly")) { - properties._isChatOnly = 1; - if (typeof message.isChatOnly !== "boolean") - return "isChatOnly: boolean expected"; + if (message.unknown12 != null && message.hasOwnProperty("unknown12")) { + var error = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.verify(message.unknown12); + if (error) + return "unknown12." + error; + } + if (message.unknown22 != null && message.hasOwnProperty("unknown22")) + if (!$util.isString(message.unknown22)) + return "unknown22: string expected"; + if (message.unknown23 != null && message.hasOwnProperty("unknown23")) + if (!$util.isString(message.unknown23)) + return "unknown23: string expected"; + if (message.unknown27 != null && message.hasOwnProperty("unknown27")) + if (!$util.isString(message.unknown27)) + return "unknown27: string expected"; + if (message.thinking != null && message.hasOwnProperty("thinking")) { + var error = $root.MessageThinking.verify(message.thinking); + if (error) + return "thinking." + error; } return null; }; /** - * Creates an AvailableModel message from a plain object. Also converts values to their respective internal types. + * Creates a Message message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static * @param {Object.} object Plain object - * @returns {AvailableModelsResponse.AvailableModel} AvailableModel + * @returns {StreamUnifiedChatWithToolsResponse.Message} Message */ - AvailableModel.fromObject = function fromObject(object) { - if (object instanceof $root.AvailableModelsResponse.AvailableModel) + Message.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsResponse.Message) return object; - var message = new $root.AvailableModelsResponse.AvailableModel(); - if (object.name != null) - message.name = String(object.name); - if (object.defaultOn != null) - message.defaultOn = Boolean(object.defaultOn); - if (object.isLongContextOnly != null) - message.isLongContextOnly = Boolean(object.isLongContextOnly); - if (object.isChatOnly != null) - message.isChatOnly = Boolean(object.isChatOnly); + var message = new $root.StreamUnifiedChatWithToolsResponse.Message(); + if (object.content != null) + message.content = String(object.content); + if (object.webtool != null) { + if (typeof object.webtool !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.Message.webtool: object expected"); + message.webtool = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.fromObject(object.webtool); + } + if (object.unknown12 != null) { + if (typeof object.unknown12 !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.Message.unknown12: object expected"); + message.unknown12 = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.fromObject(object.unknown12); + } + if (object.unknown22 != null) + message.unknown22 = String(object.unknown22); + if (object.unknown23 != null) + message.unknown23 = String(object.unknown23); + if (object.unknown27 != null) + message.unknown27 = String(object.unknown27); + if (object.thinking != null) { + if (typeof object.thinking !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.Message.thinking: object expected"); + message.thinking = $root.MessageThinking.fromObject(object.thinking); + } return message; }; /** - * Creates a plain object from an AvailableModel message. Also converts values to other types if specified. + * Creates a plain object from a Message message. Also converts values to other types if specified. * @function toObject - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static - * @param {AvailableModelsResponse.AvailableModel} message AvailableModel + * @param {StreamUnifiedChatWithToolsResponse.Message} message Message * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AvailableModel.toObject = function toObject(message, options) { + Message.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.defaultOn = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.defaultOn != null && message.hasOwnProperty("defaultOn")) - object.defaultOn = message.defaultOn; - if (message.isLongContextOnly != null && message.hasOwnProperty("isLongContextOnly")) { - object.isLongContextOnly = message.isLongContextOnly; - if (options.oneofs) - object._isLongContextOnly = "isLongContextOnly"; - } - if (message.isChatOnly != null && message.hasOwnProperty("isChatOnly")) { - object.isChatOnly = message.isChatOnly; - if (options.oneofs) - object._isChatOnly = "isChatOnly"; + object.content = ""; + object.webtool = null; + object.unknown12 = null; + object.unknown22 = ""; + object.unknown23 = ""; + object.thinking = null; + object.unknown27 = ""; } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.webtool != null && message.hasOwnProperty("webtool")) + object.webtool = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.toObject(message.webtool, options); + if (message.unknown12 != null && message.hasOwnProperty("unknown12")) + object.unknown12 = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.toObject(message.unknown12, options); + if (message.unknown22 != null && message.hasOwnProperty("unknown22")) + object.unknown22 = message.unknown22; + if (message.unknown23 != null && message.hasOwnProperty("unknown23")) + object.unknown23 = message.unknown23; + if (message.thinking != null && message.hasOwnProperty("thinking")) + object.thinking = $root.MessageThinking.toObject(message.thinking, options); + if (message.unknown27 != null && message.hasOwnProperty("unknown27")) + object.unknown27 = message.unknown27; return object; }; /** - * Converts this AvailableModel to JSON. + * Converts this Message to JSON. * @function toJSON - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @instance * @returns {Object.} JSON object */ - AvailableModel.prototype.toJSON = function toJSON() { + Message.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AvailableModel + * Gets the default type url for Message * @function getTypeUrl - * @memberof AvailableModelsResponse.AvailableModel + * @memberof StreamUnifiedChatWithToolsResponse.Message * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AvailableModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/AvailableModelsResponse.AvailableModel"; + return typeUrlPrefix + "/StreamUnifiedChatWithToolsResponse.Message"; }; - return AvailableModel; + Message.WebTool = (function() { + + /** + * Properties of a WebTool. + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @interface IWebTool + * @property {Array.|null} [webPage] WebTool webPage + */ + + /** + * Constructs a new WebTool. + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @classdesc Represents a WebTool. + * @implements IWebTool + * @constructor + * @param {StreamUnifiedChatWithToolsResponse.Message.IWebTool=} [properties] Properties to set + */ + function WebTool(properties) { + this.webPage = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebTool webPage. + * @member {Array.} webPage + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @instance + */ + WebTool.prototype.webPage = $util.emptyArray; + + /** + * Creates a new WebTool instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.IWebTool=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool} WebTool instance + */ + WebTool.create = function create(properties) { + return new WebTool(properties); + }; + + /** + * Encodes the specified WebTool message. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.WebTool.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.IWebTool} message WebTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebTool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webPage != null && message.webPage.length) + for (var i = 0; i < message.webPage.length; ++i) + $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.encode(message.webPage[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebTool message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.WebTool.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.IWebTool} message WebTool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebTool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebTool message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool} WebTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebTool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsResponse.Message.WebTool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.webPage && message.webPage.length)) + message.webPage = []; + message.webPage.push($root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebTool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool} WebTool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebTool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebTool message. + * @function verify + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebTool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webPage != null && message.hasOwnProperty("webPage")) { + if (!Array.isArray(message.webPage)) + return "webPage: array expected"; + for (var i = 0; i < message.webPage.length; ++i) { + var error = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.verify(message.webPage[i]); + if (error) + return "webPage." + error; + } + } + return null; + }; + + /** + * Creates a WebTool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool} WebTool + */ + WebTool.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsResponse.Message.WebTool) + return object; + var message = new $root.StreamUnifiedChatWithToolsResponse.Message.WebTool(); + if (object.webPage) { + if (!Array.isArray(object.webPage)) + throw TypeError(".StreamUnifiedChatWithToolsResponse.Message.WebTool.webPage: array expected"); + message.webPage = []; + for (var i = 0; i < object.webPage.length; ++i) { + if (typeof object.webPage[i] !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.Message.WebTool.webPage: object expected"); + message.webPage[i] = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.fromObject(object.webPage[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebTool message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.WebTool} message WebTool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebTool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.webPage = []; + if (message.webPage && message.webPage.length) { + object.webPage = []; + for (var j = 0; j < message.webPage.length; ++j) + object.webPage[j] = $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.toObject(message.webPage[j], options); + } + return object; + }; + + /** + * Converts this WebTool to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @instance + * @returns {Object.} JSON object + */ + WebTool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebTool + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebTool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsResponse.Message.WebTool"; + }; + + WebTool.WebPage = (function() { + + /** + * Properties of a WebPage. + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @interface IWebPage + * @property {string|null} [url] WebPage url + * @property {string|null} [title] WebPage title + * @property {string|null} [content] WebPage content + */ + + /** + * Constructs a new WebPage. + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool + * @classdesc Represents a WebPage. + * @implements IWebPage + * @constructor + * @param {StreamUnifiedChatWithToolsResponse.Message.WebTool.IWebPage=} [properties] Properties to set + */ + function WebPage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebPage url. + * @member {string} url + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @instance + */ + WebPage.prototype.url = ""; + + /** + * WebPage title. + * @member {string} title + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @instance + */ + WebPage.prototype.title = ""; + + /** + * WebPage content. + * @member {string} content + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @instance + */ + WebPage.prototype.content = ""; + + /** + * Creates a new WebPage instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.WebTool.IWebPage=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage} WebPage instance + */ + WebPage.create = function create(properties) { + return new WebPage(properties); + }; + + /** + * Encodes the specified WebPage message. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.WebTool.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.content); + return writer; + }; + + /** + * Encodes the specified WebPage message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.WebTool.IWebPage} message WebPage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebPage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebPage message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebPage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage} WebPage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebPage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebPage message. + * @function verify + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebPage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a WebPage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage} WebPage + */ + WebPage.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage) + return object; + var message = new $root.StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage(); + if (object.url != null) + message.url = String(object.url); + if (object.title != null) + message.title = String(object.title); + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a WebPage message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage} message WebPage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebPage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.title = ""; + object.content = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this WebPage to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @instance + * @returns {Object.} JSON object + */ + WebPage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WebPage + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WebPage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsResponse.Message.WebTool.WebPage"; + }; + + return WebPage; + })(); + + return WebTool; + })(); + + Message.Unknown12 = (function() { + + /** + * Properties of an Unknown12. + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @interface IUnknown12 + * @property {StreamUnifiedChatWithToolsResponse.Message.Unknown12.IContent|null} [content] Unknown12 content + */ + + /** + * Constructs a new Unknown12. + * @memberof StreamUnifiedChatWithToolsResponse.Message + * @classdesc Represents an Unknown12. + * @implements IUnknown12 + * @constructor + * @param {StreamUnifiedChatWithToolsResponse.Message.IUnknown12=} [properties] Properties to set + */ + function Unknown12(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Unknown12 content. + * @member {StreamUnifiedChatWithToolsResponse.Message.Unknown12.IContent|null|undefined} content + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @instance + */ + Unknown12.prototype.content = null; + + /** + * Creates a new Unknown12 instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.IUnknown12=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12} Unknown12 instance + */ + Unknown12.create = function create(properties) { + return new Unknown12(properties); + }; + + /** + * Encodes the specified Unknown12 message. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.Unknown12.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.IUnknown12} message Unknown12 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Unknown12.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Unknown12 message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.Unknown12.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.IUnknown12} message Unknown12 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Unknown12.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Unknown12 message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12} Unknown12 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Unknown12.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Unknown12 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12} Unknown12 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Unknown12.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Unknown12 message. + * @function verify + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Unknown12.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.verify(message.content); + if (error) + return "content." + error; + } + return null; + }; + + /** + * Creates an Unknown12 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12} Unknown12 + */ + Unknown12.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12) + return object; + var message = new $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12(); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".StreamUnifiedChatWithToolsResponse.Message.Unknown12.content: object expected"); + message.content = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.fromObject(object.content); + } + return message; + }; + + /** + * Creates a plain object from an Unknown12 message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.Unknown12} message Unknown12 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Unknown12.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.content = null; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.toObject(message.content, options); + return object; + }; + + /** + * Converts this Unknown12 to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @instance + * @returns {Object.} JSON object + */ + Unknown12.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Unknown12 + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Unknown12.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsResponse.Message.Unknown12"; + }; + + Unknown12.Content = (function() { + + /** + * Properties of a Content. + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @interface IContent + * @property {string|null} [content] Content content + */ + + /** + * Constructs a new Content. + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12 + * @classdesc Represents a Content. + * @implements IContent + * @constructor + * @param {StreamUnifiedChatWithToolsResponse.Message.Unknown12.IContent=} [properties] Properties to set + */ + function Content(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Content content. + * @member {string} content + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @instance + */ + Content.prototype.content = ""; + + /** + * Creates a new Content instance using the specified properties. + * @function create + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.Unknown12.IContent=} [properties] Properties to set + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content} Content instance + */ + Content.create = function create(properties) { + return new Content(properties); + }; + + /** + * Encodes the specified Content message. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.verify|verify} messages. + * @function encode + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.Unknown12.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + return writer; + }; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content.verify|verify} messages. + * @function encodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.Unknown12.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Content message from the specified reader or buffer. + * @function decode + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Content message. + * @function verify + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Content.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + return null; + }; + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {Object.} object Plain object + * @returns {StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content} Content + */ + Content.fromObject = function fromObject(object) { + if (object instanceof $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content) + return object; + var message = new $root.StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content(); + if (object.content != null) + message.content = String(object.content); + return message; + }; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @function toObject + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content} message Content + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Content.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.content = ""; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + return object; + }; + + /** + * Converts this Content to JSON. + * @function toJSON + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @instance + * @returns {Object.} JSON object + */ + Content.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Content + * @function getTypeUrl + * @memberof StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/StreamUnifiedChatWithToolsResponse.Message.Unknown12.Content"; + }; + + return Content; + })(); + + return Unknown12; + })(); + + return Message; })(); - return AvailableModelsResponse; + return StreamUnifiedChatWithToolsResponse; })(); module.exports = $root;