diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/content.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/content.proto index a4e9a9751921..14ea1b7dd7ce 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/content.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/content.proto @@ -118,6 +118,13 @@ message Part { // the model. FunctionResponse function_response = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Code generated by the model that is meant to be executed. + ExecutableCode executable_code = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Result of executing the [ExecutableCode]. + CodeExecutionResult code_execution_result = 9 + [(google.api.field_behavior) = OPTIONAL]; } oneof metadata { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tool.proto b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tool.proto index 263c5c38e954..ffdf83bb57af 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tool.proto +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/google/cloud/aiplatform/v1/tool.proto @@ -38,6 +38,13 @@ option ruby_package = "Google::Cloud::AIPlatform::V1"; // one type of Tool (e.g FunctionDeclaration, Retrieval or // GoogleSearchRetrieval). message Tool { + // Tool that executes code generated by the model, and automatically returns + // the result to the model. + // + // See also [ExecutableCode]and [CodeExecutionResult] which are input and + // output to this tool. + message CodeExecution {} + // Optional. Function tool type. // One or more function declarations to be passed to the model along with the // current user query. Model may decide to call a subset of these functions @@ -59,6 +66,11 @@ message Tool { // Specialized retrieval tool that is powered by Google search. GoogleSearchRetrieval google_search_retrieval = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CodeExecution tool type. + // Enables the model to execute code as part of generation. + // This field is only used by the Gemini Developer API services. + CodeExecution code_execution = 4 [(google.api.field_behavior) = OPTIONAL]; } // Structured representation of a function declaration as defined by the @@ -128,6 +140,57 @@ message FunctionResponse { google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; } +// Code generated by the model that is meant to be executed, and the result +// returned to the model. +// +// Generated when using the [FunctionDeclaration] tool and +// [FunctionCallingConfig] mode is set to [Mode.CODE]. +message ExecutableCode { + // Supported programming languages for the generated code. + enum Language { + // Unspecified language. This value should not be used. + LANGUAGE_UNSPECIFIED = 0; + + // Python >= 3.10, with numpy and simpy available. + PYTHON = 1; + } + + // Required. Programming language of the `code`. + Language language = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The code to be executed. + string code = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Result of executing the [ExecutableCode]. +// +// Always follows a `part` containing the [ExecutableCode]. +message CodeExecutionResult { + // Enumeration of possible outcomes of the code execution. + enum Outcome { + // Unspecified status. This value should not be used. + OUTCOME_UNSPECIFIED = 0; + + // Code execution completed successfully. + OUTCOME_OK = 1; + + // Code execution finished but with a failure. `stderr` should contain the + // reason. + OUTCOME_FAILED = 2; + + // Code execution ran for too long, and was cancelled. There may or may not + // be a partial output present. + OUTCOME_DEADLINE_EXCEEDED = 3; + } + + // Required. Outcome of the code execution. + Outcome outcome = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Contains stdout when code execution is successful, stderr or + // other description otherwise. + string output = 2 [(google.api.field_behavior) = OPTIONAL]; +} + // Defines a retrieval tool that model can call to access external knowledge. message Retrieval { // The source of the retrieval. diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.d.ts index 857d7096669a..04b4b30a111a 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.d.ts +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.d.ts @@ -10457,6 +10457,12 @@ export namespace google { /** Part functionResponse */ functionResponse?: (google.cloud.aiplatform.v1.IFunctionResponse|null); + /** Part executableCode */ + executableCode?: (google.cloud.aiplatform.v1.IExecutableCode|null); + + /** Part codeExecutionResult */ + codeExecutionResult?: (google.cloud.aiplatform.v1.ICodeExecutionResult|null); + /** Part videoMetadata */ videoMetadata?: (google.cloud.aiplatform.v1.IVideoMetadata|null); } @@ -10485,11 +10491,17 @@ export namespace google { /** Part functionResponse. */ public functionResponse?: (google.cloud.aiplatform.v1.IFunctionResponse|null); + /** Part executableCode. */ + public executableCode?: (google.cloud.aiplatform.v1.IExecutableCode|null); + + /** Part codeExecutionResult. */ + public codeExecutionResult?: (google.cloud.aiplatform.v1.ICodeExecutionResult|null); + /** Part videoMetadata. */ public videoMetadata?: (google.cloud.aiplatform.v1.IVideoMetadata|null); /** Part data. */ - public data?: ("text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"); + public data?: ("text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|"executableCode"|"codeExecutionResult"); /** Part metadata. */ public metadata?: "videoMetadata"; @@ -13646,6 +13658,9 @@ export namespace google { /** Tool googleSearchRetrieval */ googleSearchRetrieval?: (google.cloud.aiplatform.v1.IGoogleSearchRetrieval|null); + + /** Tool codeExecution */ + codeExecution?: (google.cloud.aiplatform.v1.Tool.ICodeExecution|null); } /** Represents a Tool. */ @@ -13666,6 +13681,9 @@ export namespace google { /** Tool googleSearchRetrieval. */ public googleSearchRetrieval?: (google.cloud.aiplatform.v1.IGoogleSearchRetrieval|null); + /** Tool codeExecution. */ + public codeExecution?: (google.cloud.aiplatform.v1.Tool.ICodeExecution|null); + /** * Creates a new Tool instance using the specified properties. * @param [properties] Properties to set @@ -13744,6 +13762,100 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Tool { + + /** Properties of a CodeExecution. */ + interface ICodeExecution { + } + + /** Represents a CodeExecution. */ + class CodeExecution implements ICodeExecution { + + /** + * Constructs a new CodeExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Tool.ICodeExecution); + + /** + * Creates a new CodeExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeExecution instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Tool.ICodeExecution): google.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * Encodes the specified CodeExecution message. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.CodeExecution.verify|verify} messages. + * @param message CodeExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.Tool.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.CodeExecution.verify|verify} messages. + * @param message CodeExecution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.Tool.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeExecution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * Decodes a CodeExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * Verifies a CodeExecution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeExecution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * Creates a plain object from a CodeExecution message. Also converts values to other types if specified. + * @param message CodeExecution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Tool.CodeExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a FunctionDeclaration. */ interface IFunctionDeclaration { @@ -14065,6 +14177,232 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ExecutableCode. */ + interface IExecutableCode { + + /** ExecutableCode language */ + language?: (google.cloud.aiplatform.v1.ExecutableCode.Language|keyof typeof google.cloud.aiplatform.v1.ExecutableCode.Language|null); + + /** ExecutableCode code */ + code?: (string|null); + } + + /** Represents an ExecutableCode. */ + class ExecutableCode implements IExecutableCode { + + /** + * Constructs a new ExecutableCode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IExecutableCode); + + /** ExecutableCode language. */ + public language: (google.cloud.aiplatform.v1.ExecutableCode.Language|keyof typeof google.cloud.aiplatform.v1.ExecutableCode.Language); + + /** ExecutableCode code. */ + public code: string; + + /** + * Creates a new ExecutableCode instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutableCode instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IExecutableCode): google.cloud.aiplatform.v1.ExecutableCode; + + /** + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.cloud.aiplatform.v1.ExecutableCode.verify|verify} messages. + * @param message ExecutableCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IExecutableCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExecutableCode.verify|verify} messages. + * @param message ExecutableCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IExecutableCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ExecutableCode; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ExecutableCode; + + /** + * Verifies an ExecutableCode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutableCode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ExecutableCode; + + /** + * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified. + * @param message ExecutableCode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ExecutableCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutableCode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutableCode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExecutableCode { + + /** Language enum. */ + enum Language { + LANGUAGE_UNSPECIFIED = 0, + PYTHON = 1 + } + } + + /** Properties of a CodeExecutionResult. */ + interface ICodeExecutionResult { + + /** CodeExecutionResult outcome */ + outcome?: (google.cloud.aiplatform.v1.CodeExecutionResult.Outcome|keyof typeof google.cloud.aiplatform.v1.CodeExecutionResult.Outcome|null); + + /** CodeExecutionResult output */ + output?: (string|null); + } + + /** Represents a CodeExecutionResult. */ + class CodeExecutionResult implements ICodeExecutionResult { + + /** + * Constructs a new CodeExecutionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICodeExecutionResult); + + /** CodeExecutionResult outcome. */ + public outcome: (google.cloud.aiplatform.v1.CodeExecutionResult.Outcome|keyof typeof google.cloud.aiplatform.v1.CodeExecutionResult.Outcome); + + /** CodeExecutionResult output. */ + public output: string; + + /** + * Creates a new CodeExecutionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeExecutionResult instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICodeExecutionResult): google.cloud.aiplatform.v1.CodeExecutionResult; + + /** + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.CodeExecutionResult.verify|verify} messages. + * @param message CodeExecutionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ICodeExecutionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CodeExecutionResult.verify|verify} messages. + * @param message CodeExecutionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICodeExecutionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CodeExecutionResult; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CodeExecutionResult; + + /** + * Verifies a CodeExecutionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeExecutionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CodeExecutionResult; + + /** + * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified. + * @param message CodeExecutionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CodeExecutionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeExecutionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeExecutionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CodeExecutionResult { + + /** Outcome enum. */ + enum Outcome { + OUTCOME_UNSPECIFIED = 0, + OUTCOME_OK = 1, + OUTCOME_FAILED = 2, + OUTCOME_DEADLINE_EXCEEDED = 3 + } + } + /** Properties of a Retrieval. */ interface IRetrieval { diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.js b/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.js index f5980a518864..1d17f612132b 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.js +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.js @@ -26813,6 +26813,8 @@ * @property {google.cloud.aiplatform.v1.IFileData|null} [fileData] Part fileData * @property {google.cloud.aiplatform.v1.IFunctionCall|null} [functionCall] Part functionCall * @property {google.cloud.aiplatform.v1.IFunctionResponse|null} [functionResponse] Part functionResponse + * @property {google.cloud.aiplatform.v1.IExecutableCode|null} [executableCode] Part executableCode + * @property {google.cloud.aiplatform.v1.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult * @property {google.cloud.aiplatform.v1.IVideoMetadata|null} [videoMetadata] Part videoMetadata */ @@ -26871,6 +26873,22 @@ */ Part.prototype.functionResponse = null; + /** + * Part executableCode. + * @member {google.cloud.aiplatform.v1.IExecutableCode|null|undefined} executableCode + * @memberof google.cloud.aiplatform.v1.Part + * @instance + */ + Part.prototype.executableCode = null; + + /** + * Part codeExecutionResult. + * @member {google.cloud.aiplatform.v1.ICodeExecutionResult|null|undefined} codeExecutionResult + * @memberof google.cloud.aiplatform.v1.Part + * @instance + */ + Part.prototype.codeExecutionResult = null; + /** * Part videoMetadata. * @member {google.cloud.aiplatform.v1.IVideoMetadata|null|undefined} videoMetadata @@ -26884,12 +26902,12 @@ /** * Part data. - * @member {"text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|undefined} data + * @member {"text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|"executableCode"|"codeExecutionResult"|undefined} data * @memberof google.cloud.aiplatform.v1.Part * @instance */ Object.defineProperty(Part.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "fileData", "functionCall", "functionResponse"]), + get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "fileData", "functionCall", "functionResponse", "executableCode", "codeExecutionResult"]), set: $util.oneOfSetter($oneOfFields) }); @@ -26940,6 +26958,10 @@ $root.google.cloud.aiplatform.v1.FunctionCall.encode(message.functionCall, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.functionResponse != null && Object.hasOwnProperty.call(message, "functionResponse")) $root.google.cloud.aiplatform.v1.FunctionResponse.encode(message.functionResponse, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executableCode != null && Object.hasOwnProperty.call(message, "executableCode")) + $root.google.cloud.aiplatform.v1.ExecutableCode.encode(message.executableCode, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.codeExecutionResult != null && Object.hasOwnProperty.call(message, "codeExecutionResult")) + $root.google.cloud.aiplatform.v1.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -26994,6 +27016,14 @@ message.functionResponse = $root.google.cloud.aiplatform.v1.FunctionResponse.decode(reader, reader.uint32()); break; } + case 8: { + message.executableCode = $root.google.cloud.aiplatform.v1.ExecutableCode.decode(reader, reader.uint32()); + break; + } + case 9: { + message.codeExecutionResult = $root.google.cloud.aiplatform.v1.CodeExecutionResult.decode(reader, reader.uint32()); + break; + } case 4: { message.videoMetadata = $root.google.cloud.aiplatform.v1.VideoMetadata.decode(reader, reader.uint32()); break; @@ -27079,6 +27109,26 @@ return "functionResponse." + error; } } + if (message.executableCode != null && message.hasOwnProperty("executableCode")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.aiplatform.v1.ExecutableCode.verify(message.executableCode); + if (error) + return "executableCode." + error; + } + } + if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.aiplatform.v1.CodeExecutionResult.verify(message.codeExecutionResult); + if (error) + return "codeExecutionResult." + error; + } + } if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { properties.metadata = 1; { @@ -27124,6 +27174,16 @@ throw TypeError(".google.cloud.aiplatform.v1.Part.functionResponse: object expected"); message.functionResponse = $root.google.cloud.aiplatform.v1.FunctionResponse.fromObject(object.functionResponse); } + if (object.executableCode != null) { + if (typeof object.executableCode !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Part.executableCode: object expected"); + message.executableCode = $root.google.cloud.aiplatform.v1.ExecutableCode.fromObject(object.executableCode); + } + if (object.codeExecutionResult != null) { + if (typeof object.codeExecutionResult !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Part.codeExecutionResult: object expected"); + message.codeExecutionResult = $root.google.cloud.aiplatform.v1.CodeExecutionResult.fromObject(object.codeExecutionResult); + } if (object.videoMetadata != null) { if (typeof object.videoMetadata !== "object") throw TypeError(".google.cloud.aiplatform.v1.Part.videoMetadata: object expected"); @@ -27175,6 +27235,16 @@ if (options.oneofs) object.data = "functionResponse"; } + if (message.executableCode != null && message.hasOwnProperty("executableCode")) { + object.executableCode = $root.google.cloud.aiplatform.v1.ExecutableCode.toObject(message.executableCode, options); + if (options.oneofs) + object.data = "executableCode"; + } + if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) { + object.codeExecutionResult = $root.google.cloud.aiplatform.v1.CodeExecutionResult.toObject(message.codeExecutionResult, options); + if (options.oneofs) + object.data = "codeExecutionResult"; + } return object; }; @@ -35624,6 +35694,7 @@ * @property {Array.|null} [functionDeclarations] Tool functionDeclarations * @property {google.cloud.aiplatform.v1.IRetrieval|null} [retrieval] Tool retrieval * @property {google.cloud.aiplatform.v1.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval + * @property {google.cloud.aiplatform.v1.Tool.ICodeExecution|null} [codeExecution] Tool codeExecution */ /** @@ -35666,6 +35737,14 @@ */ Tool.prototype.googleSearchRetrieval = null; + /** + * Tool codeExecution. + * @member {google.cloud.aiplatform.v1.Tool.ICodeExecution|null|undefined} codeExecution + * @memberof google.cloud.aiplatform.v1.Tool + * @instance + */ + Tool.prototype.codeExecution = null; + /** * Creates a new Tool instance using the specified properties. * @function create @@ -35697,6 +35776,8 @@ $root.google.cloud.aiplatform.v1.Retrieval.encode(message.retrieval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.googleSearchRetrieval != null && Object.hasOwnProperty.call(message, "googleSearchRetrieval")) $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.codeExecution != null && Object.hasOwnProperty.call(message, "codeExecution")) + $root.google.cloud.aiplatform.v1.Tool.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -35745,6 +35826,10 @@ message.googleSearchRetrieval = $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.decode(reader, reader.uint32()); break; } + case 4: { + message.codeExecution = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -35799,6 +35884,11 @@ if (error) return "googleSearchRetrieval." + error; } + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) { + var error = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.verify(message.codeExecution); + if (error) + return "codeExecution." + error; + } return null; }; @@ -35834,6 +35924,11 @@ throw TypeError(".google.cloud.aiplatform.v1.Tool.googleSearchRetrieval: object expected"); message.googleSearchRetrieval = $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval); } + if (object.codeExecution != null) { + if (typeof object.codeExecution !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Tool.codeExecution: object expected"); + message.codeExecution = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.fromObject(object.codeExecution); + } return message; }; @@ -35855,6 +35950,7 @@ if (options.defaults) { object.retrieval = null; object.googleSearchRetrieval = null; + object.codeExecution = null; } if (message.functionDeclarations && message.functionDeclarations.length) { object.functionDeclarations = []; @@ -35865,6 +35961,8 @@ object.retrieval = $root.google.cloud.aiplatform.v1.Retrieval.toObject(message.retrieval, options); if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) object.googleSearchRetrieval = $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options); + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) + object.codeExecution = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.toObject(message.codeExecution, options); return object; }; @@ -35894,6 +35992,181 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1.Tool"; }; + Tool.CodeExecution = (function() { + + /** + * Properties of a CodeExecution. + * @memberof google.cloud.aiplatform.v1.Tool + * @interface ICodeExecution + */ + + /** + * Constructs a new CodeExecution. + * @memberof google.cloud.aiplatform.v1.Tool + * @classdesc Represents a CodeExecution. + * @implements ICodeExecution + * @constructor + * @param {google.cloud.aiplatform.v1.Tool.ICodeExecution=} [properties] Properties to set + */ + function CodeExecution(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 CodeExecution instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.ICodeExecution=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Tool.CodeExecution} CodeExecution instance + */ + CodeExecution.create = function create(properties) { + return new CodeExecution(properties); + }; + + /** + * Encodes the specified CodeExecution message. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.CodeExecution.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.ICodeExecution} message CodeExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.CodeExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.ICodeExecution} message CodeExecution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeExecution message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Tool.CodeExecution} CodeExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecution.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.google.cloud.aiplatform.v1.Tool.CodeExecution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeExecution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Tool.CodeExecution} CodeExecution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeExecution message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeExecution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Tool.CodeExecution} CodeExecution + */ + CodeExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Tool.CodeExecution) + return object; + return new $root.google.cloud.aiplatform.v1.Tool.CodeExecution(); + }; + + /** + * Creates a plain object from a CodeExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.CodeExecution} message CodeExecution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeExecution.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CodeExecution to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @instance + * @returns {Object.} JSON object + */ + CodeExecution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeExecution + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeExecution.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Tool.CodeExecution"; + }; + + return CodeExecution; + })(); + return Tool; })(); @@ -36644,6 +36917,540 @@ return FunctionResponse; })(); + v1.ExecutableCode = (function() { + + /** + * Properties of an ExecutableCode. + * @memberof google.cloud.aiplatform.v1 + * @interface IExecutableCode + * @property {google.cloud.aiplatform.v1.ExecutableCode.Language|null} [language] ExecutableCode language + * @property {string|null} [code] ExecutableCode code + */ + + /** + * Constructs a new ExecutableCode. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an ExecutableCode. + * @implements IExecutableCode + * @constructor + * @param {google.cloud.aiplatform.v1.IExecutableCode=} [properties] Properties to set + */ + function ExecutableCode(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]]; + } + + /** + * ExecutableCode language. + * @member {google.cloud.aiplatform.v1.ExecutableCode.Language} language + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @instance + */ + ExecutableCode.prototype.language = 0; + + /** + * ExecutableCode code. + * @member {string} code + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @instance + */ + ExecutableCode.prototype.code = ""; + + /** + * Creates a new ExecutableCode instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.IExecutableCode=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ExecutableCode} ExecutableCode instance + */ + ExecutableCode.create = function create(properties) { + return new ExecutableCode(properties); + }; + + /** + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.cloud.aiplatform.v1.ExecutableCode.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.IExecutableCode} message ExecutableCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutableCode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.language != null && Object.hasOwnProperty.call(message, "language")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.language); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.code); + return writer; + }; + + /** + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExecutableCode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.IExecutableCode} message ExecutableCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutableCode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ExecutableCode} ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutableCode.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.google.cloud.aiplatform.v1.ExecutableCode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.language = reader.int32(); + break; + } + case 2: { + message.code = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutableCode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ExecutableCode} ExecutableCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutableCode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutableCode message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutableCode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.language != null && message.hasOwnProperty("language")) + switch (message.language) { + default: + return "language: enum value expected"; + case 0: + case 1: + break; + } + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isString(message.code)) + return "code: string expected"; + return null; + }; + + /** + * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ExecutableCode} ExecutableCode + */ + ExecutableCode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ExecutableCode) + return object; + var message = new $root.google.cloud.aiplatform.v1.ExecutableCode(); + switch (object.language) { + default: + if (typeof object.language === "number") { + message.language = object.language; + break; + } + break; + case "LANGUAGE_UNSPECIFIED": + case 0: + message.language = 0; + break; + case "PYTHON": + case 1: + message.language = 1; + break; + } + if (object.code != null) + message.code = String(object.code); + return message; + }; + + /** + * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.ExecutableCode} message ExecutableCode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutableCode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.language = options.enums === String ? "LANGUAGE_UNSPECIFIED" : 0; + object.code = ""; + } + if (message.language != null && message.hasOwnProperty("language")) + object.language = options.enums === String ? $root.google.cloud.aiplatform.v1.ExecutableCode.Language[message.language] === undefined ? message.language : $root.google.cloud.aiplatform.v1.ExecutableCode.Language[message.language] : message.language; + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + return object; + }; + + /** + * Converts this ExecutableCode to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @instance + * @returns {Object.} JSON object + */ + ExecutableCode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutableCode + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutableCode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ExecutableCode"; + }; + + /** + * Language enum. + * @name google.cloud.aiplatform.v1.ExecutableCode.Language + * @enum {number} + * @property {number} LANGUAGE_UNSPECIFIED=0 LANGUAGE_UNSPECIFIED value + * @property {number} PYTHON=1 PYTHON value + */ + ExecutableCode.Language = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LANGUAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PYTHON"] = 1; + return values; + })(); + + return ExecutableCode; + })(); + + v1.CodeExecutionResult = (function() { + + /** + * Properties of a CodeExecutionResult. + * @memberof google.cloud.aiplatform.v1 + * @interface ICodeExecutionResult + * @property {google.cloud.aiplatform.v1.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome + * @property {string|null} [output] CodeExecutionResult output + */ + + /** + * Constructs a new CodeExecutionResult. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CodeExecutionResult. + * @implements ICodeExecutionResult + * @constructor + * @param {google.cloud.aiplatform.v1.ICodeExecutionResult=} [properties] Properties to set + */ + function CodeExecutionResult(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]]; + } + + /** + * CodeExecutionResult outcome. + * @member {google.cloud.aiplatform.v1.CodeExecutionResult.Outcome} outcome + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @instance + */ + CodeExecutionResult.prototype.outcome = 0; + + /** + * CodeExecutionResult output. + * @member {string} output + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @instance + */ + CodeExecutionResult.prototype.output = ""; + + /** + * Creates a new CodeExecutionResult instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.ICodeExecutionResult=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CodeExecutionResult} CodeExecutionResult instance + */ + CodeExecutionResult.create = function create(properties) { + return new CodeExecutionResult(properties); + }; + + /** + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.CodeExecutionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecutionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outcome != null && Object.hasOwnProperty.call(message, "outcome")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.outcome); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.output); + return writer; + }; + + /** + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CodeExecutionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CodeExecutionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CodeExecutionResult} CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecutionResult.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.google.cloud.aiplatform.v1.CodeExecutionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.outcome = reader.int32(); + break; + } + case 2: { + message.output = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CodeExecutionResult} CodeExecutionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CodeExecutionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CodeExecutionResult message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CodeExecutionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outcome != null && message.hasOwnProperty("outcome")) + switch (message.outcome) { + default: + return "outcome: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CodeExecutionResult} CodeExecutionResult + */ + CodeExecutionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CodeExecutionResult) + return object; + var message = new $root.google.cloud.aiplatform.v1.CodeExecutionResult(); + switch (object.outcome) { + default: + if (typeof object.outcome === "number") { + message.outcome = object.outcome; + break; + } + break; + case "OUTCOME_UNSPECIFIED": + case 0: + message.outcome = 0; + break; + case "OUTCOME_OK": + case 1: + message.outcome = 1; + break; + case "OUTCOME_FAILED": + case 2: + message.outcome = 2; + break; + case "OUTCOME_DEADLINE_EXCEEDED": + case 3: + message.outcome = 3; + break; + } + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.CodeExecutionResult} message CodeExecutionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CodeExecutionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.outcome = options.enums === String ? "OUTCOME_UNSPECIFIED" : 0; + object.output = ""; + } + if (message.outcome != null && message.hasOwnProperty("outcome")) + object.outcome = options.enums === String ? $root.google.cloud.aiplatform.v1.CodeExecutionResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.aiplatform.v1.CodeExecutionResult.Outcome[message.outcome] : message.outcome; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this CodeExecutionResult to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @instance + * @returns {Object.} JSON object + */ + CodeExecutionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CodeExecutionResult + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CodeExecutionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CodeExecutionResult"; + }; + + /** + * Outcome enum. + * @name google.cloud.aiplatform.v1.CodeExecutionResult.Outcome + * @enum {number} + * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value + * @property {number} OUTCOME_OK=1 OUTCOME_OK value + * @property {number} OUTCOME_FAILED=2 OUTCOME_FAILED value + * @property {number} OUTCOME_DEADLINE_EXCEEDED=3 OUTCOME_DEADLINE_EXCEEDED value + */ + CodeExecutionResult.Outcome = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTCOME_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTCOME_OK"] = 1; + values[valuesById[2] = "OUTCOME_FAILED"] = 2; + values[valuesById[3] = "OUTCOME_DEADLINE_EXCEEDED"] = 3; + return values; + })(); + + return CodeExecutionResult; + })(); + v1.Retrieval = (function() { /** diff --git a/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.json b/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.json index 05c4019f4a7c..c7e0b2bb535e 100644 --- a/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.json +++ b/owl-bot-staging/google-cloud-aiplatform/v1/protos/protos.json @@ -2630,7 +2630,9 @@ "inlineData", "fileData", "functionCall", - "functionResponse" + "functionResponse", + "executableCode", + "codeExecutionResult" ] }, "metadata": { @@ -2675,6 +2677,20 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "executableCode": { + "type": "ExecutableCode", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "codeExecutionResult": { + "type": "CodeExecutionResult", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "videoMetadata": { "type": "VideoMetadata", "id": 4, @@ -3764,6 +3780,18 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "codeExecution": { + "type": "CodeExecution", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CodeExecution": { + "fields": {} } } }, @@ -3835,6 +3863,60 @@ } } }, + "ExecutableCode": { + "fields": { + "language": { + "type": "Language", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "code": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Language": { + "values": { + "LANGUAGE_UNSPECIFIED": 0, + "PYTHON": 1 + } + } + } + }, + "CodeExecutionResult": { + "fields": { + "outcome": { + "type": "Outcome", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "output": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Outcome": { + "values": { + "OUTCOME_UNSPECIFIED": 0, + "OUTCOME_OK": 1, + "OUTCOME_FAILED": 2, + "OUTCOME_DEADLINE_EXCEEDED": 3 + } + } + } + }, "Retrieval": { "oneofs": { "source": {