From a3b8c21a2bb54de8707e4919834a9ef40984f574 Mon Sep 17 00:00:00 2001 From: Ayush Agrawal Date: Fri, 21 Nov 2025 10:39:30 -0800 Subject: [PATCH] feat: Add support for models.embed_content(), models.get(), models.update(), and models.delete() in C# SDK PiperOrigin-RevId: 835278403 --- .../EmbedContent/EmbedContentTest.cs | 146 ++ .../Models/DeleteModelTest.cs | 90 + Google.GenAI.E2E.Tests/Models/GetModelTest.cs | 94 + .../Models/UpdateModelTest.cs | 91 + ...DeleteModelTest.DeleteModelGeminiTest.json | 39 + ...DeleteModelTest.DeleteModelVertexTest.json | 51 + ...tTest.EmbedContentMultiTextGeminiTest.json | 101 + ...tTest.EmbedContentMultiTextVertexTest.json | 102 + ...Test.EmbedContentSimpleTextGeminiTest.json | 829 ++++++ ...Test.EmbedContentSimpleTextVertexTest.json | 830 ++++++ ...st.EmbedContentSingleStringGeminiTest.json | 830 ++++++ ...st.EmbedContentSingleStringVertexTest.json | 830 ++++++ .../GetModelTest.GetModelTunedGeminiTest.json | 2308 +++++++++++++++++ .../GetModelTest.GetModelTunedVertexTest.json | 140 + ...UpdateModelTest.UpdateModelGeminiTest.json | 55 + ...UpdateModelTest.UpdateModelVertexTest.json | 59 + Google.GenAI/Common.cs | 2 +- Google.GenAI/HttpApiClient.cs | 2 +- Google.GenAI/Models.cs | 909 ++++++- Google.GenAI/README.md | 80 + Google.GenAI/Transformers.cs | 72 +- Google.GenAI/types/Checkpoint.cs | 74 + Google.GenAI/types/DeleteModelConfig.cs | 54 + Google.GenAI/types/DeleteModelParameters.cs | 64 + Google.GenAI/types/DeleteModelResponse.cs | 51 + Google.GenAI/types/EmbedContentMetadata.cs | 54 + Google.GenAI/types/EmbedContentParameters.cs | 75 + Google.GenAI/types/EmbedContentResponse.cs | 74 + Google.GenAI/types/Endpoint.cs | 62 + Google.GenAI/types/GetModelConfig.cs | 53 + Google.GenAI/types/GetModelParameters.cs | 61 + Google.GenAI/types/Model.cs | 225 ++ Google.GenAI/types/TunedModelInfo.cs | 73 + Google.GenAI/types/UpdateModelConfig.cs | 84 + Google.GenAI/types/UpdateModelParameters.cs | 64 + README.md | 80 + 36 files changed, 8726 insertions(+), 82 deletions(-) create mode 100644 Google.GenAI.E2E.Tests/EmbedContent/EmbedContentTest.cs create mode 100644 Google.GenAI.E2E.Tests/Models/DeleteModelTest.cs create mode 100644 Google.GenAI.E2E.Tests/Models/GetModelTest.cs create mode 100644 Google.GenAI.E2E.Tests/Models/UpdateModelTest.cs create mode 100644 Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelGeminiTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelVertexTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextGeminiTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextVertexTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextGeminiTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextVertexTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringGeminiTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringVertexTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedGeminiTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedVertexTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelGeminiTest.json create mode 100644 Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelVertexTest.json create mode 100644 Google.GenAI/types/Checkpoint.cs create mode 100644 Google.GenAI/types/DeleteModelConfig.cs create mode 100644 Google.GenAI/types/DeleteModelParameters.cs create mode 100644 Google.GenAI/types/DeleteModelResponse.cs create mode 100644 Google.GenAI/types/EmbedContentMetadata.cs create mode 100644 Google.GenAI/types/EmbedContentParameters.cs create mode 100644 Google.GenAI/types/EmbedContentResponse.cs create mode 100644 Google.GenAI/types/Endpoint.cs create mode 100644 Google.GenAI/types/GetModelConfig.cs create mode 100644 Google.GenAI/types/GetModelParameters.cs create mode 100644 Google.GenAI/types/Model.cs create mode 100644 Google.GenAI/types/TunedModelInfo.cs create mode 100644 Google.GenAI/types/UpdateModelConfig.cs create mode 100644 Google.GenAI/types/UpdateModelParameters.cs diff --git a/Google.GenAI.E2E.Tests/EmbedContent/EmbedContentTest.cs b/Google.GenAI.E2E.Tests/EmbedContent/EmbedContentTest.cs new file mode 100644 index 00000000..d0750680 --- /dev/null +++ b/Google.GenAI.E2E.Tests/EmbedContent/EmbedContentTest.cs @@ -0,0 +1,146 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using Google.GenAI; +using Google.GenAI.Types; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using TestServerSdk; + +[TestClass] +public class EmbedContentTest { + private static TestServerProcess? _server; + private Client vertexClient; + private Client geminiClient; + private string modelName; + public TestContext TestContext { get; set; } + + [ClassInitialize] + public static void ClassInit(TestContext _) { + _server = TestServer.StartTestServer(); + } + + [ClassCleanup] + public static void ClassCleanup() { + TestServer.StopTestServer(_server); + } + + [TestInitialize] + public void TestInit() { + // Test server specific setup. + if (_server == null) { + throw new InvalidOperationException("Test server is not initialized."); + } + var geminiClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1453" + }; + var vertexClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1454" + }; + + // Common setup for both clients. + string project = System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_PROJECT"); + string location = + System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_LOCATION") ?? "us-central1"; + string apiKey = System.Environment.GetEnvironmentVariable("GOOGLE_API_KEY"); + vertexClient = new Client(project: project, location: location, vertexAI: true, + credential: TestServer.GetCredentialForTestMode(), + httpOptions: vertexClientHttpOptions); + geminiClient = + new Client(apiKey: apiKey, vertexAI: false, httpOptions: geminiClientHttpOptions); + + // Specific setup for this test class + modelName = "text-embedding-004"; + } + + [TestMethod] + public async Task EmbedContentSimpleTextVertexTest() { + var contents = new List { + new Content { Parts = new List { new Part { Text = "What is your name?" } } } + }; + var vertexResponse = await vertexClient.Models.EmbedContentAsync( + model: modelName, contents: contents, config: null); + + Assert.IsNotNull(vertexResponse.Embeddings); + } + + [TestMethod] + public async Task EmbedContentSimpleTextGeminiTest() { + var contents = new List { + new Content { Parts = new List { new Part { Text = "What is your name?" } } } + }; + var geminiResponse = await geminiClient.Models.EmbedContentAsync( + model: modelName, contents: contents, config: null); + + Assert.IsNotNull(geminiResponse.Embeddings); + } + + [TestMethod] + public async Task EmbedContentSingleStringVertexTest() { + var vertexResponse = await vertexClient.Models.EmbedContentAsync( + model: modelName, contents: "What is your name?", config: null); + + Assert.IsNotNull(vertexResponse.Embeddings); + } + + [TestMethod] + public async Task EmbedContentSingleStringGeminiTest() { + var geminiResponse = await geminiClient.Models.EmbedContentAsync( + model: modelName, contents: "What is your name?", config: null); + + Assert.IsNotNull(geminiResponse.Embeddings); + } + + [TestMethod] + public async Task EmbedContentMultiTextVertexTest() { + var contents = new List { + new Content { Parts = new List { new Part { Text = "What is your name?" } } }, + new Content { Parts = new List { new Part { Text = "I am a model." } } } + }; + var config = new EmbedContentConfig { OutputDimensionality = 10, Title = "test_title", + TaskType = "RETRIEVAL_DOCUMENT" }; + var vertexResponse = + await vertexClient.Models.EmbedContentAsync(model: modelName, contents: contents, config: config); + + Assert.IsNotNull(vertexResponse.Embeddings); + Assert.AreEqual(2, vertexResponse.Embeddings.Count); + } + + [TestMethod] + public async Task EmbedContentMultiTextGeminiTest() { + var contents = new List { + new Content { Parts = new List { new Part { Text = "What is your name?" } } }, + new Content { Parts = new List { new Part { Text = "I am a model." } } } + }; + var config = new EmbedContentConfig { OutputDimensionality = 10, Title = "test_title", + TaskType = "RETRIEVAL_DOCUMENT" }; + var geminiResponse = + await geminiClient.Models.EmbedContentAsync(model: modelName, contents: contents, config: config); + + Assert.IsNotNull(geminiResponse.Embeddings); + Assert.AreEqual(2, geminiResponse.Embeddings.Count); + } +} diff --git a/Google.GenAI.E2E.Tests/Models/DeleteModelTest.cs b/Google.GenAI.E2E.Tests/Models/DeleteModelTest.cs new file mode 100644 index 00000000..fffc7879 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Models/DeleteModelTest.cs @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using Google.GenAI; +using Google.GenAI.Types; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using TestServerSdk; + +[TestClass] +public class DeleteModelTest { + private static TestServerProcess? _server; + private Client vertexClient; + private Client geminiClient; + public TestContext TestContext { get; set; } + + [ClassInitialize] + public static void ClassInit(TestContext _) { + _server = TestServer.StartTestServer(); + } + + [ClassCleanup] + public static void ClassCleanup() { + TestServer.StopTestServer(_server); + } + + [TestInitialize] + public void TestInit() { + // Test server specific setup. + if (_server == null) { + throw new InvalidOperationException("Test server is not initialized."); + } + var geminiClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1453" + }; + var vertexClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1454" + }; + + // Common setup for both clients. + string project = System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_PROJECT"); + string location = + System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_LOCATION") ?? "us-central1"; + string apiKey = System.Environment.GetEnvironmentVariable("GOOGLE_API_KEY"); + vertexClient = new Client(project: project, location: location, vertexAI: true, + credential: TestServer.GetCredentialForTestMode(), + httpOptions: vertexClientHttpOptions); + geminiClient = + new Client(apiKey: apiKey, vertexAI: false, httpOptions: geminiClientHttpOptions); + } + + [TestMethod] + public async Task DeleteModelVertexTest() { + var vertexResponse = + await vertexClient.Models.DeleteAsync(model: "models/89657476663738368", config: null); + + Assert.IsNotNull(vertexResponse); + } + + [TestMethod] + public async Task DeleteModelGeminiTest() { + var geminiResponse = + await geminiClient.Models.DeleteAsync(model: "tunedModels/generate-num-1896", config: null); + + Assert.IsNotNull(geminiResponse); + } +} diff --git a/Google.GenAI.E2E.Tests/Models/GetModelTest.cs b/Google.GenAI.E2E.Tests/Models/GetModelTest.cs new file mode 100644 index 00000000..57035851 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Models/GetModelTest.cs @@ -0,0 +1,94 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using Google.GenAI; +using Google.GenAI.Types; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using TestServerSdk; + +[TestClass] +public class GetModelTest { + private static TestServerProcess? _server; + private Client vertexClient; + private Client geminiClient; + private string modelName; + public TestContext TestContext { get; set; } + + [ClassInitialize] + public static void ClassInit(TestContext _) { + _server = TestServer.StartTestServer(); + } + + [ClassCleanup] + public static void ClassCleanup() { + TestServer.StopTestServer(_server); + } + + [TestInitialize] + public void TestInit() { + // Test server specific setup. + if (_server == null) { + throw new InvalidOperationException("Test server is not initialized."); + } + var geminiClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1453" + }; + var vertexClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1454" + }; + + // Common setup for both clients. + string project = System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_PROJECT"); + string location = + System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_LOCATION") ?? "us-central1"; + string apiKey = System.Environment.GetEnvironmentVariable("GOOGLE_API_KEY"); + vertexClient = new Client(project: project, location: location, vertexAI: true, + credential: TestServer.GetCredentialForTestMode(), + httpOptions: vertexClientHttpOptions); + geminiClient = + new Client(apiKey: apiKey, vertexAI: false, httpOptions: geminiClientHttpOptions); + + // Specific setup for this test class + modelName = "gemini-2.5-flash"; + } + + [TestMethod] + public async Task GetModelTunedVertexTest() { + string tunedModel = "models/8611312396578848768"; + var vertexResponse = await vertexClient.Models.GetAsync(model: tunedModel, config: null); + + Assert.IsNotNull(vertexResponse); + } + + [TestMethod] + public async Task GetModelTunedGeminiTest() { + string tunedModel = "tunedModels/generate-num-8498"; + var geminiResponse = await geminiClient.Models.GetAsync(model: tunedModel, config: null); + + Assert.IsNotNull(geminiResponse); + } +} diff --git a/Google.GenAI.E2E.Tests/Models/UpdateModelTest.cs b/Google.GenAI.E2E.Tests/Models/UpdateModelTest.cs new file mode 100644 index 00000000..3fce887f --- /dev/null +++ b/Google.GenAI.E2E.Tests/Models/UpdateModelTest.cs @@ -0,0 +1,91 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +using Google.GenAI; +using Google.GenAI.Types; + +using Microsoft.VisualStudio.TestTools.UnitTesting; + +using TestServerSdk; + +[TestClass] +public class UpdateModelTest { + private static TestServerProcess? _server; + private Client vertexClient; + private Client geminiClient; + public TestContext TestContext { get; set; } + + [ClassInitialize] + public static void ClassInit(TestContext _) { + _server = TestServer.StartTestServer(); + } + + [ClassCleanup] + public static void ClassCleanup() { + TestServer.StopTestServer(_server); + } + + [TestInitialize] + public void TestInit() { + // Test server specific setup. + if (_server == null) { + throw new InvalidOperationException("Test server is not initialized."); + } + var geminiClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1453" + }; + var vertexClientHttpOptions = new HttpOptions { + Headers = new Dictionary { { "Test-Name", + $"{GetType().Name}.{TestContext.TestName}" } }, + BaseUrl = "http://localhost:1454" + }; + + // Common setup for both clients. + string project = System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_PROJECT"); + string location = + System.Environment.GetEnvironmentVariable("GOOGLE_CLOUD_LOCATION") ?? "us-central1"; + string apiKey = System.Environment.GetEnvironmentVariable("GOOGLE_API_KEY"); + vertexClient = new Client(project: project, location: location, vertexAI: true, + credential: TestServer.GetCredentialForTestMode(), + httpOptions: vertexClientHttpOptions); + geminiClient = + new Client(apiKey: apiKey, vertexAI: false, httpOptions: geminiClientHttpOptions); + } + + [TestMethod] + public async Task UpdateModelVertexTest() { + var config = new UpdateModelConfig { Description = "Updated model config" }; + var vertexResponse = + await vertexClient.Models.UpdateAsync(model: "models/4705847094718496768", config: config); + + Assert.IsNotNull(vertexResponse); + } + + [TestMethod] + public async Task UpdateModelGeminiTest() { + var config = new UpdateModelConfig { Description = "Updated model config" }; + var ex = await Assert.ThrowsExceptionAsync(async () => { + await geminiClient.Models.UpdateAsync(model: "tunedModels/generate-num-9131", config: config); + }); + } +} diff --git a/Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelGeminiTest.json b/Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelGeminiTest.json new file mode 100644 index 00000000..f6391688 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelGeminiTest.json @@ -0,0 +1,39 @@ +{ + "recordID": "DeleteModelTest.DeleteModelGeminiTest", + "interactions": [ + { + "request": { + "method": "DELETE", + "url": "/v1beta/tunedModels/generate-num-1896", + "request": "DELETE /v1beta/tunedModels/generate-num-1896 HTTP/1.1", + "headers": { + "Test-Name": "DeleteModelTest.DeleteModelGeminiTest" + }, + "bodySegments": [ + null + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "generativelanguage.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "109e107c0ee8f3ae7e6f1e6f98fc813b2d6f0b40a65e20a91408d7cee10ae1f8", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Wed, 19 Nov 2025 22:21:13 GMT", + "Server": "scaffolding on HTTPServer2", + "Server-Timing": "gfet4t7; dur=482", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + {} + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelVertexTest.json b/Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelVertexTest.json new file mode 100644 index 00000000..740c4566 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/DeleteModelTest.DeleteModelVertexTest.json @@ -0,0 +1,51 @@ +{ + "recordID": "DeleteModelTest.DeleteModelVertexTest", + "interactions": [ + { + "request": { + "method": "DELETE", + "url": "/v1beta1/projects/REDACTED/locations/us-central1/models/89657476663738368", + "request": "DELETE /v1beta1/projects/REDACTED/locations/us-central1/models/89657476663738368 HTTP/1.1", + "headers": { + "Test-Name": "DeleteModelTest.DeleteModelVertexTest" + }, + "bodySegments": [ + null + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "us-central1-aiplatform.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "5ace686eca63d6db94c39f3ee2f8e3767dfdb1fee48ed50510eeec1fbf90e00d", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Wed, 19 Nov 2025 23:08:18 GMT", + "Server": "ESF", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "done": true, + "metadata": { + "@type": "type.googleapis.com/google.cloud.aiplatform.v1beta1.DeleteOperationMetadata", + "genericMetadata": { + "createTime": "2025-11-19T23:08:18.190240Z", + "updateTime": "2025-11-19T23:08:18.190240Z" + } + }, + "name": "projects/REDACTED/locations/us-central1/models/89657476663738368/operations/5208994112488865792", + "response": { + "@type": "type.googleapis.com/google.protobuf.Empty" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextGeminiTest.json b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextGeminiTest.json new file mode 100644 index 00000000..794eeadc --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextGeminiTest.json @@ -0,0 +1,101 @@ +{ + "recordID": "EmbedContentTest.EmbedContentMultiTextGeminiTest", + "interactions": [ + { + "request": { + "method": "POST", + "url": "/v1beta/models/text-embedding-004:batchEmbedContents", + "request": "POST /v1beta/models/text-embedding-004:batchEmbedContents HTTP/1.1", + "headers": { + "Content-Length": "347", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "EmbedContentTest.EmbedContentMultiTextGeminiTest" + }, + "bodySegments": [ + { + "requests": [ + { + "content": { + "parts": [ + { + "text": "What is your name?" + } + ] + }, + "model": "models/text-embedding-004", + "outputDimensionality": 10, + "taskType": "RETRIEVAL_DOCUMENT", + "title": "test_title" + }, + { + "content": { + "parts": [ + { + "text": "I am a model." + } + ] + }, + "model": "models/text-embedding-004", + "outputDimensionality": 10, + "taskType": "RETRIEVAL_DOCUMENT", + "title": "test_title" + } + ] + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "generativelanguage.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "50128cd8a28c44e38af1b0551cc25ebf7c7af1c59953d49db45899a450dbb1bc", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Thu, 20 Nov 2025 00:35:10 GMT", + "Server": "scaffolding on HTTPServer2", + "Server-Timing": "gfet4t7; dur=193", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "embeddings": [ + { + "values": [ + 0.0062209684, + -0.00016352482, + -0.04497254, + -0.024360893, + 0.024183987, + 0.027219841, + 0.036644667, + 0.028461628, + -0.04021491, + 0.03328241 + ] + }, + { + "values": [ + -0.02997993, + -0.031975683, + -0.041643385, + -0.01656822, + 0.031309083, + 0.025444405, + 0.0028291983, + 0.05965454, + -0.014440891, + 0.024713816 + ] + } + ] + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextVertexTest.json b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextVertexTest.json new file mode 100644 index 00000000..fb8742af --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentMultiTextVertexTest.json @@ -0,0 +1,102 @@ +{ + "recordID": "EmbedContentTest.EmbedContentMultiTextVertexTest", + "interactions": [ + { + "request": { + "method": "POST", + "url": "/v1beta1/projects/REDACTED/locations/us-central1/publishers/google/models/text-embedding-004:predict", + "request": "POST /v1beta1/projects/REDACTED/locations/us-central1/publishers/google/models/text-embedding-004:predict HTTP/1.1", + "headers": { + "Content-Length": "225", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "EmbedContentTest.EmbedContentMultiTextVertexTest" + }, + "bodySegments": [ + { + "instances": [ + { + "content": "What is your name?", + "task_type": "RETRIEVAL_DOCUMENT", + "title": "test_title" + }, + { + "content": "I am a model.", + "task_type": "RETRIEVAL_DOCUMENT", + "title": "test_title" + } + ], + "parameters": { + "outputDimensionality": 10 + } + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "us-central1-aiplatform.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "86f5b7b26792f125ee6d51aa663d1db2af3aafc2d8efd9ecec9087267c0d497b", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Thu, 20 Nov 2025 00:35:10 GMT", + "Server": "scaffolding on HTTPServer2", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "metadata": { + "billableCharacterCount": 45 + }, + "predictions": [ + { + "embeddings": { + "statistics": { + "token_count": 8, + "truncated": false + }, + "values": [ + 0.006119785830378532, + -0.00011146893666591495, + -0.045173149555921555, + -0.024283207952976227, + 0.0239418875426054, + 0.027390720322728157, + 0.036817517131567, + 0.02857659012079239, + -0.04041007533669472, + 0.03310540318489075 + ] + } + }, + { + "embeddings": { + "statistics": { + "token_count": 9, + "truncated": false + }, + "values": [ + -0.030047545209527016, + -0.03195396438241005, + -0.04135684669017792, + -0.01663077436387539, + 0.03134505823254585, + 0.025405501946806908, + 0.002644096966832876, + 0.05973745882511139, + -0.014495864510536194, + 0.024711130186915398 + ] + } + } + ] + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextGeminiTest.json b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextGeminiTest.json new file mode 100644 index 00000000..6782743f --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextGeminiTest.json @@ -0,0 +1,829 @@ +{ + "recordID": "EmbedContentTest.EmbedContentSimpleTextGeminiTest", + "interactions": [ + { + "request": { + "method": "POST", + "url": "/v1beta/models/text-embedding-004:batchEmbedContents", + "request": "POST /v1beta/models/text-embedding-004:batchEmbedContents HTTP/1.1", + "headers": { + "Content-Length": "104", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "EmbedContentTest.EmbedContentSimpleTextGeminiTest" + }, + "bodySegments": [ + { + "requests": [ + { + "content": { + "parts": [ + { + "text": "What is your name?" + } + ] + }, + "model": "models/text-embedding-004" + } + ] + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "generativelanguage.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "0a6e003c27c40f39f9bb12fb99d44523ab7d2b5ed10a2d7ff072d67a91123baf", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Thu, 20 Nov 2025 00:35:09 GMT", + "Server": "scaffolding on HTTPServer2", + "Server-Timing": "gfet4t7; dur=367", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "embeddings": [ + { + "values": [ + 0.021732023, + -0.005427982, + -0.01701328, + 0.02430373, + 0.013187526, + 0.057707485, + 0.028726421, + 0.0115679605, + -0.006673027, + 0.02951852, + -0.065773904, + 0.006512121, + 0.06202991, + -0.041853856, + -0.070919365, + 0.014113805, + -0.032625366, + -0.020559896, + -0.05590399, + -0.064535275, + 0.015795678, + -0.04487683, + 0.014454995, + -0.07018945, + -0.003921109, + -0.037335303, + -0.0019505617, + -0.042179246, + -0.04839255, + -0.048437532, + 0.023158008, + 0.044043574, + -0.028138345, + 0.004748051, + 0.049392708, + 0.054424796, + -0.02518876, + -0.020597808, + 0.026315931, + -0.067800686, + -0.07013981, + 0.07700788, + -0.04559307, + 0.02775326, + -0.0027906934, + -0.010075191, + 0.04463516, + 0.029150054, + -0.04134455, + 0.068995364, + 0.05047888, + -0.012715973, + -0.05104324, + 0.01565891, + 0.04721188, + -0.014199643, + -0.028556028, + -0.017631317, + 0.046491437, + 0.0078040794, + -0.039787453, + -0.011537996, + -0.05668377, + -0.0017825877, + 0.051781815, + 0.02939808, + 0.0077320687, + 0.035731204, + -0.023526808, + 0.06269574, + 0.0012985622, + 0.015149391, + -0.07904071, + 0.040479586, + -0.031503964, + 0.0040280814, + -0.0054447693, + -0.012071941, + 0.031841204, + 0.01990303, + 0.019138258, + 0.019604903, + 0.040595856, + 0.06658458, + 0.010618229, + 0.011111334, + 0.018468456, + -0.027970614, + -0.0094481595, + -0.01795139, + 0.083042696, + 0.034492366, + -0.032865304, + -0.018975737, + 0.025752187, + -0.046107627, + -0.086650506, + -0.091901645, + 0.03759866, + 0.05411619, + 0.0072942916, + 0.017192867, + -0.007640952, + -0.034948424, + 0.043175504, + 0.0023262291, + -0.036720708, + -0.008202913, + -0.04055865, + -0.048558176, + 0.020139972, + -0.05105226, + 0.05310882, + -0.025666693, + 0.005313517, + -0.04791561, + -0.021382187, + 0.0073072053, + -0.043664213, + 0.01779283, + -0.043429546, + 0.015419766, + -0.028060539, + 0.08211297, + 0.038712554, + 0.045185514, + 0.05094181, + -0.06497028, + -0.026023604, + -0.047003623, + 0.095147274, + -0.01768276, + 0.02028647, + 0.06441857, + -0.03168662, + 0.0028985208, + 0.087957025, + 0.021767767, + -0.00439769, + -0.08913329, + 0.016554622, + -0.027870024, + -0.06505592, + -0.01863668, + 0.025063451, + -0.005407604, + -0.026613016, + 0.02080014, + -0.018563172, + -0.010264666, + -0.013438265, + 0.07488961, + 0.06566093, + -0.0061225863, + -0.026820945, + 0.03175545, + 0.06477917, + 0.011307347, + -0.003086155, + -0.062736325, + -0.04284983, + -0.022861594, + -0.03401332, + 0.026865706, + -0.073508866, + 0.033875328, + 0.028457234, + -0.0128714945, + 0.007999089, + -0.00015508205, + -0.018102331, + -0.0005202144, + -0.0372271, + -0.053822625, + 0.015279704, + -0.012511828, + 0.022307146, + -0.030724283, + 0.036848143, + -0.0033739507, + -0.009714464, + 0.06169807, + -0.06319587, + -0.013927568, + -0.03612881, + 0.025824402, + -0.02500134, + 0.07412934, + -0.0003537176, + 0.03824628, + -0.049187887, + 0.028985638, + 0.029823536, + -0.03427824, + 0.00043551248, + 0.017849268, + 0.025572207, + -0.055592805, + -0.0008958806, + 0.012244622, + 0.03514161, + 0.006128201, + -0.014223764, + -0.034149714, + -0.0010793366, + 0.014671598, + -0.0017118206, + -0.086871594, + 0.0689741, + 0.013167657, + -0.016082553, + -0.032350346, + 0.01850987, + -0.063346915, + 0.014290179, + -0.021259954, + 0.04425871, + 0.011059084, + 0.074194655, + -0.04258757, + 0.028936448, + 0.0018465539, + 0.012163382, + 0.0219103, + -0.022598108, + 0.0039217602, + -0.03695365, + -0.0041201613, + -0.01571833, + -0.07364755, + -0.024847534, + 0.009151082, + -0.016215255, + 0.023441585, + -0.016521703, + 0.02837979, + 0.030763665, + 0.023492493, + 0.014166916, + -0.0288686, + 0.011056216, + -0.0009931327, + -0.011042509, + 0.017762605, + -0.012461449, + 0.014276804, + 0.047914837, + 0.04684253, + 0.048720326, + -0.04800321, + -0.035621695, + 0.00918018, + -0.008930229, + 0.048836164, + -0.06673736, + -0.029404191, + 0.015204164, + -0.038902648, + 0.028021071, + -0.0089533385, + 0.055070255, + -0.05017493, + -0.028786048, + -0.08817404, + -0.029183188, + 0.0072104936, + -0.060777586, + -0.0036320605, + 0.054837786, + -0.048155326, + 0.00032331812, + -0.0021828704, + 0.026372949, + 0.0032336547, + -0.0001215726, + -0.027724884, + -0.03255122, + 0.011677186, + -0.080120124, + 0.007469913, + 0.06820577, + -0.012906102, + -0.028967457, + 0.023897767, + -0.02687246, + -0.051146414, + 0.01996493, + 0.0232165, + -0.026917802, + -0.0025074985, + 0.021924254, + 0.03674799, + -0.039655026, + 0.031109927, + 0.0013627073, + 0.012972641, + 0.0033493587, + -0.013672427, + 0.023478772, + 0.010855056, + 0.07252118, + 0.06641578, + -0.0458096, + -0.008709587, + 0.015178798, + 0.024758935, + -0.037923276, + -0.004971566, + -0.022823673, + -0.014705508, + -0.021376865, + 0.0004951399, + -0.044138975, + -0.015801622, + -0.05028487, + -0.033774324, + -0.062429715, + -0.024937047, + -0.014561467, + -0.0078024445, + 0.014095472, + 0.0065130047, + 0.00011388763, + 0.004937366, + 0.03312744, + -0.009198156, + 0.03003049, + -0.005171963, + 0.023728061, + 0.022158967, + 0.0048903353, + -0.017343545, + 0.040393982, + -0.060654435, + 0.05794729, + 0.0474465, + -0.059573006, + 0.070875145, + 0.03519408, + 0.027417405, + -0.0009910526, + 0.008779711, + 0.068335116, + 0.020527631, + -0.0049977037, + -0.051168382, + 0.08418298, + -0.04326717, + -0.048250232, + -0.040528286, + 0.018352972, + 0.044325255, + 0.043977063, + -0.075352326, + -0.04420792, + -0.025577545, + 0.025746621, + 0.0077310055, + 0.009725111, + 0.014291654, + 0.015161767, + 0.057375338, + -0.024882685, + 0.037921574, + -0.0031116833, + 0.005875485, + 0.024005413, + 0.024842788, + 0.018666634, + -0.00070016074, + 0.016103651, + 0.023904258, + 0.017784713, + -0.021084066, + 0.026901806, + -0.02530135, + -0.050290965, + 0.04153818, + 0.017961971, + -0.09331208, + -0.0061010513, + -0.062682465, + -0.03150989, + -0.032891862, + -0.04606956, + 0.079529606, + -0.016813986, + 0.016080689, + -0.0036578986, + 0.048146825, + 0.011964877, + 0.042866077, + 0.011102674, + 0.035849433, + -0.028622726, + -0.01135784, + 0.0103660785, + -0.023125472, + -0.030768517, + 0.0032658037, + 0.030869648, + -0.00016968095, + 0.058609642, + -0.06740337, + 0.01777014, + -0.02731725, + 0.06483008, + 0.01600025, + 0.021474589, + -0.05818128, + 0.009907066, + 0.056136426, + 0.04706602, + -0.041637212, + -0.03714074, + -0.049108487, + 0.0016345484, + -0.019232506, + 0.030971756, + 0.029338887, + -0.053715847, + 0.018526014, + -0.012505863, + -0.03545443, + 0.039897077, + -0.064882375, + -0.0129608335, + 0.007973985, + 0.015395275, + 0.04940776, + 0.012882792, + 0.0032966181, + -0.03997977, + -0.006467839, + -0.020111116, + -0.0010222138, + 0.038869478, + 0.025669875, + 0.009226892, + -0.0087065, + -0.014253337, + -0.005986784, + 0.02627052, + 0.04010542, + -0.057972465, + 0.028121144, + 0.012687158, + 0.014692529, + 0.00138856, + -0.020912336, + 0.011917243, + -0.016168779, + 0.008572726, + -0.0043006605, + -0.0027227388, + 0.004042753, + 0.039051224, + 0.015979048, + -0.035146788, + -0.004715289, + -0.07063991, + 0.017212009, + 0.12757415, + 0.036007263, + -0.015175765, + 0.007571235, + -0.054939095, + 0.008883072, + -0.0057537467, + -0.028391968, + 0.0008537393, + -0.0028022863, + -0.001849641, + -0.044249125, + -0.021250686, + -0.042766757, + 0.030110149, + 0.045934536, + -0.043373402, + 0.022158602, + -0.02657093, + 0.0287476, + -0.01929913, + 0.05214999, + 0.05056057, + -0.028526358, + -0.03519996, + -0.01386718, + -0.035907086, + -0.022574408, + 0.0019659542, + 0.05966947, + -0.0020215933, + 0.027899528, + -0.019791396, + -0.06576608, + 0.039979335, + 0.0022787002, + -0.008656878, + -0.004085453, + 0.053450048, + 0.041672274, + -0.022824306, + 0.0023114537, + -0.07511918, + -0.012216688, + -0.012177739, + -0.042105895, + 0.042723283, + 0.014980786, + 0.028324781, + 0.017931126, + 0.071089424, + 0.015353811, + 0.022265911, + 0.029940642, + -0.04537605, + 0.021293657, + 0.013327408, + 0.04640396, + -0.03101765, + -0.020290984, + -0.023704778, + -0.013542706, + -0.006656219, + -0.032945726, + 0.012337845, + 0.055753943, + 0.05275453, + 0.040945727, + -0.01434174, + 0.030551367, + 0.042950153, + 0.028337905, + -0.019184321, + 0.060790967, + 0.007948735, + 0.05227727, + -0.028676575, + 0.065153785, + -0.007268671, + 0.004590255, + 0.03687554, + 0.020140577, + -0.018629551, + 0.024465326, + 0.00797017, + -0.014205899, + -0.036797658, + 0.07176319, + -0.014265327, + -0.05478396, + -0.05184108, + -0.03301546, + 0.014929797, + -0.028599994, + 0.014946195, + -0.0009782586, + -0.045367755, + -0.043870185, + 0.0005148074, + -0.049717274, + 0.041212887, + -0.005940272, + -0.020473542, + -0.012702243, + -0.0063222763, + -0.01015335, + -0.008595781, + 0.011666455, + 0.060426325, + 0.0046639154, + 0.011105114, + -0.029272262, + 0.038317457, + -0.009651271, + -0.008651311, + -0.026746567, + 0.048916854, + -0.05385514, + -0.033032287, + -0.014459559, + -0.0112643195, + 0.053167485, + -0.023299599, + 0.018084802, + 0.06802071, + -0.014761364, + 0.03627573, + -0.0074563012, + -0.021095054, + 0.04584932, + -0.01101446, + -0.011260906, + -0.021476647, + 0.016765757, + -0.05683144, + 0.023100277, + -0.030728871, + 0.044724926, + -0.027596502, + 0.0044694333, + 0.020120855, + -0.0538814, + -0.0506869, + -0.019163864, + -0.012962558, + -0.037282612, + 0.014974521, + 0.038997736, + 0.0019971314, + 0.022850448, + -0.001232746, + 0.017249607, + -0.06399885, + -0.06411625, + -0.06488422, + -0.028379094, + -0.007468766, + -0.027646014, + 0.0074430197, + 0.07539032, + 0.054979626, + -0.038174536, + -0.06002654, + 0.008941892, + -0.02963719, + -0.009472218, + -0.0025154725, + -0.025877867, + 0.0048244237, + -0.019133395, + 0.0067171385, + -0.043682333, + -0.016353559, + 0.0115020005, + -0.056191448, + -0.03422215, + -0.0040672235, + -0.040476836, + -0.03131491, + -0.0019601472, + 0.015060794, + 0.07604932, + -0.053201057, + 0.030762864, + 0.008180191, + -0.0657994, + 0.0484927, + 0.034822624, + -0.03507979, + -0.004888684, + -0.055713218, + -0.02127549, + 0.022850065, + 0.014464012, + -0.042600404, + 0.016209306, + 0.022103056, + -0.013177287, + 0.034419924, + -0.04585367, + -0.058879104, + 0.009181555, + 0.0070055784, + 0.0035586532, + -0.020379882, + 0.04145162, + 0.034101978, + -0.018064423, + -0.0012888993, + -0.004689197, + 0.0109357005, + -0.014617613, + -0.005186308, + -0.029723963, + 0.021603268, + -0.0014754526, + 0.010380154, + -0.047426764, + -0.015981246, + -0.046953265, + 0.044089496, + -0.028411813, + -0.012775297, + -0.005816417, + 0.052139927, + -0.018612517, + 0.07371406, + -0.018997138, + 0.017415436, + -0.011070157, + -0.035656452, + 0.048961405, + -0.048083518, + 0.06907546, + -0.04624489, + 0.022027653, + -0.0019987, + -0.021423373, + -0.006276124, + -0.03141525, + -0.08152749, + 0.015939724, + 0.048909925, + -0.027961198, + 0.056896906, + 0.018740157, + 0.028924676, + 0.0065314677, + -0.020309204, + -0.05717529, + 0.05316093, + -0.0063474686, + -0.024302784, + 0.025907952, + 0.008029035, + -0.055261355, + -0.009198551, + -0.0015154663, + 0.013299544, + -0.04790821, + 0.030572522, + 0.048798006, + 0.0665314, + 0.0018343765, + 0.004501543, + -0.016081218, + -0.027529601, + 0.03398698, + 0.04964241, + 0.0067964853, + -0.019521303, + 0.019564042, + 0.017308172, + 0.038052287, + 0.053164627, + 0.014857851, + -0.0016251518, + -0.08076403, + 0.034556214, + 0.0004833621, + 0.011365417, + -0.068415076, + -0.0042743282, + 0.030445311, + -0.067525476, + -0.03302983, + -0.054259263, + -0.026307182, + -0.024360968, + -0.024735259, + -0.00056397833, + -0.011796876, + 0.023660615, + -0.030753233, + 0.010003241, + -0.039316658, + 0.025120739, + -0.012940403, + -0.028495843, + 0.07411172, + -0.03561696, + 0.0064676674, + -0.037032407, + -0.029247785, + 0.017187377, + -0.026557919 + ] + } + ] + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextVertexTest.json b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextVertexTest.json new file mode 100644 index 00000000..d9640249 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSimpleTextVertexTest.json @@ -0,0 +1,830 @@ +{ + "recordID": "EmbedContentTest.EmbedContentSimpleTextVertexTest", + "interactions": [ + { + "request": { + "method": "POST", + "url": "/v1beta1/projects/REDACTED/locations/us-central1/publishers/google/models/text-embedding-004:predict", + "request": "POST /v1beta1/projects/REDACTED/locations/us-central1/publishers/google/models/text-embedding-004:predict HTTP/1.1", + "headers": { + "Content-Length": "48", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "EmbedContentTest.EmbedContentSimpleTextVertexTest" + }, + "bodySegments": [ + { + "instances": [ + { + "content": "What is your name?" + } + ] + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "us-central1-aiplatform.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "52e975d2e41b13a8ed6491d47cd333ba079db016d721ac6f99f94f84207b5733", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Thu, 20 Nov 2025 00:35:09 GMT", + "Server": "scaffolding on HTTPServer2", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "metadata": { + "billableCharacterCount": 15 + }, + "predictions": [ + { + "embeddings": { + "statistics": { + "token_count": 5, + "truncated": false + }, + "values": [ + 0.02191467583179474, + -0.005375662352889776, + -0.017126262187957764, + 0.02436019666492939, + 0.013047702610492706, + 0.057812709361314774, + 0.028640445321798325, + 0.011477270163595676, + -0.006714188493788242, + 0.02943362295627594, + -0.06577935814857483, + 0.006328667048364878, + 0.06190791353583336, + -0.041980549693107605, + -0.07129119336605072, + 0.013936841860413551, + -0.03303055465221405, + -0.020750362426042557, + -0.05600179359316826, + -0.06443746387958527, + 0.015810616314411163, + -0.0450187548995018, + 0.0142097482457757, + -0.06995121389627457, + -0.003983344882726669, + -0.037046972662210464, + -0.0021527165081351995, + -0.042551882565021515, + -0.04837816208600998, + -0.04867112636566162, + 0.023109082132577896, + 0.043841805309057236, + -0.02798762544989586, + 0.004672285169363022, + 0.049226004630327225, + 0.054410096257925034, + -0.02552333101630211, + -0.020402073860168457, + 0.026488689705729485, + -0.06786046922206879, + -0.0701357051730156, + 0.07654319703578949, + -0.04566756263375282, + 0.0274858046323061, + -0.0026797910686582327, + -0.009870409965515137, + 0.044678691774606705, + 0.029297087341547012, + -0.0410812608897686, + 0.06905873864889145, + 0.050521258264780045, + -0.01254947204142809, + -0.05097421631217003, + 0.015482486225664616, + 0.047183066606521606, + -0.01422051154077053, + -0.028319042176008224, + -0.017806529998779297, + 0.04670654609799385, + 0.007968416437506676, + -0.039873555302619934, + -0.011817448772490025, + -0.05669791251420975, + -0.0017165997996926308, + 0.05183912068605423, + 0.029032427817583084, + 0.007664937991648912, + 0.035931289196014404, + -0.023554900661110878, + 0.06322957575321198, + 0.0009985790820792317, + 0.015462295152246952, + -0.07874314486980438, + 0.04048033803701401, + -0.03157108277082443, + 0.004067446570843458, + -0.005662224255502224, + -0.011977564543485641, + 0.03169484809041023, + 0.020089799538254738, + 0.019109876826405525, + 0.01976454071700573, + 0.04042389988899231, + 0.06654180586338043, + 0.010684515349566936, + 0.011097312904894352, + 0.018535001203417778, + -0.028012026101350784, + -0.009333133697509766, + -0.01806136593222618, + 0.08294727653265, + 0.034502554684877396, + -0.03282937780022621, + -0.018723372370004654, + 0.025715427473187447, + -0.045961469411849976, + -0.08626145124435425, + -0.09200649708509445, + 0.03765988349914551, + 0.05396872013807297, + 0.007464696187525988, + 0.01741752400994301, + -0.007591143250465393, + -0.034974873065948486, + 0.042996928095817566, + 0.002628590678796172, + -0.03627432510256767, + -0.008292313665151596, + -0.04088747501373291, + -0.04826778173446655, + 0.020012345165014267, + -0.051125362515449524, + 0.052583735436201096, + -0.025491753593087196, + 0.005355607718229294, + -0.048058412969112396, + -0.021139446645975113, + 0.007148019969463348, + -0.04351223632693291, + 0.017901994287967682, + -0.043479811400175095, + 0.015374517068266869, + -0.02796998992562294, + 0.08216500282287598, + 0.0385577492415905, + 0.04523114114999771, + 0.05102241784334183, + -0.06517123430967331, + -0.026211468502879143, + -0.04753038287162781, + 0.09503993391990662, + -0.017820041626691818, + 0.020161526277661324, + 0.06453297287225723, + -0.03186536952853203, + 0.0028199423104524612, + 0.08753232657909393, + 0.022204184904694557, + -0.0046211970038712025, + -0.08923111110925674, + 0.016467973589897156, + -0.02773600071668625, + -0.06496598571538925, + -0.018676571547985077, + 0.024945924058556557, + -0.005324262659996748, + -0.0264165960252285, + 0.020861119031906128, + -0.018219755962491035, + -0.010250424034893513, + -0.013288149610161781, + 0.07496076822280884, + 0.06583354622125626, + -0.006147997919470072, + -0.026791710406541824, + 0.031568143516778946, + 0.06491973996162415, + 0.011463453993201256, + -0.0030693556182086468, + -0.06271496415138245, + -0.04288629814982414, + -0.02308020181953907, + -0.03446440026164055, + 0.02690156176686287, + -0.07374061644077301, + 0.033821430057287216, + 0.028715718537569046, + -0.012852726504206657, + 0.007933908142149448, + 0.0001657039683777839, + -0.01805940270423889, + -0.0007495938334614038, + -0.03690396621823311, + -0.05373769626021385, + 0.01503095030784607, + -0.012704755179584026, + 0.02236936055123806, + -0.030758671462535858, + 0.03672901913523674, + -0.003278525546193123, + -0.00994566548615694, + 0.061773158609867096, + -0.06340005248785019, + -0.01387645211070776, + -0.03648504242300987, + 0.02578301727771759, + -0.02501736767590046, + 0.07406442612409592, + -0.0003103716589976102, + 0.03796118125319481, + -0.049105674028396606, + 0.029097052291035652, + 0.030081935226917267, + -0.03432599827647209, + 0.0003734667261596769, + 0.01784430257976055, + 0.025448186323046684, + -0.05563183128833771, + -0.001006615930236876, + 0.012209201231598854, + 0.035354889929294586, + 0.005952359642833471, + -0.014054520055651665, + -0.034404680132865906, + -0.001159191015176475, + 0.014578981325030327, + -0.0015602193307131529, + -0.08669233322143555, + 0.0689886286854744, + 0.013376818038523197, + -0.016040271148085594, + -0.032342202961444855, + 0.018484599888324738, + -0.06335530430078506, + 0.01424500998109579, + -0.021511591970920563, + 0.04434873163700104, + 0.011166363954544067, + 0.07412409037351608, + -0.04271319508552551, + 0.028773780912160873, + 0.001773450174368918, + 0.012246144004166126, + 0.02176092378795147, + -0.02232058160007, + 0.003990938421338797, + -0.036765024065971375, + -0.004432495217770338, + -0.015791242942214012, + -0.0737270936369896, + -0.02488739788532257, + 0.008995487354695797, + -0.016183633357286453, + 0.023430241271853447, + -0.01661158725619316, + 0.028724433854222298, + 0.030969148501753807, + 0.02371246926486492, + 0.013921246863901615, + -0.028931334614753723, + 0.011242881417274475, + -0.00105689512565732, + -0.010574218817055225, + 0.018262026831507683, + -0.012447363696992397, + 0.014152003452181816, + 0.04794358089566231, + 0.046464547514915466, + 0.0488271526992321, + -0.04764255881309509, + -0.035664159804582596, + 0.009265505708754063, + -0.008771565742790699, + 0.048707153648138046, + -0.06692487746477127, + -0.02959105558693409, + 0.015313539654016495, + -0.038833536207675934, + 0.02816462703049183, + -0.008738221600651741, + 0.05495430901646614, + -0.04996863380074501, + -0.028620444238185883, + -0.08828423917293549, + -0.029385706409811974, + 0.007438374683260918, + -0.060841962695121765, + -0.0038528055883944035, + 0.054627519100904465, + -0.04789957031607628, + 0.0006318801897577941, + -0.001871264772489667, + 0.02649794891476631, + 0.0032661668956279755, + 0.00009672534361016005, + -0.02783897891640663, + -0.03259721025824547, + 0.011480639688670635, + -0.08014679700136185, + 0.007716733030974865, + 0.06792054325342178, + -0.012709974311292171, + -0.029126854613423347, + 0.024129651486873627, + -0.027213212102651596, + -0.05118342116475105, + 0.02024710550904274, + 0.023398887366056442, + -0.026866355910897255, + -0.0023911953903734684, + 0.02161281183362007, + 0.03676353394985199, + -0.03937196359038353, + 0.030888264998793602, + 0.001085786847397685, + 0.012805832549929619, + 0.0035912382882088423, + -0.013487495481967926, + 0.023255567997694016, + 0.01094580814242363, + 0.07211597263813019, + 0.06635834276676178, + -0.04578062519431114, + -0.008742721751332283, + 0.015196166932582855, + 0.02477053552865982, + -0.03767270967364311, + -0.004941184539347887, + -0.022991230711340904, + -0.014623144641518593, + -0.021738912910223007, + 0.0004978319630026817, + -0.04402419179677963, + -0.016015686094760895, + -0.04984444007277489, + -0.033859021961688995, + -0.06193063035607338, + -0.024885468184947968, + -0.014492817223072052, + -0.00777471624314785, + 0.0140109583735466, + 0.006411806680262089, + 0.00020509317982941866, + 0.0049156369641423225, + 0.03310377150774002, + -0.009215550497174263, + 0.030054306611418724, + -0.00488352682441473, + 0.023593753576278687, + 0.022362446412444115, + 0.005098273511976004, + -0.01709109917283058, + 0.040728792548179626, + -0.06043768674135208, + 0.057996466755867004, + 0.047297339886426926, + -0.05948658660054207, + 0.07101988047361374, + 0.03522071987390518, + 0.027591776102781296, + -0.0008590957731939852, + 0.009041606448590755, + 0.06813155859708786, + 0.020701205357909203, + -0.005096039269119501, + -0.0512864775955677, + 0.08414465934038162, + -0.04309631139039993, + -0.04794631525874138, + -0.04099157825112343, + 0.01830362156033516, + 0.0447906032204628, + 0.04389907792210579, + -0.07537507265806198, + -0.04408467561006546, + -0.025669483467936516, + 0.025553733110427856, + 0.007470926269888878, + 0.00961330533027649, + 0.014587015844881535, + 0.015057752840220928, + 0.05702519044280052, + -0.024880899116396904, + 0.038034889847040176, + -0.003278210759162903, + 0.0061341882683336735, + 0.024219488725066185, + 0.024731319397687912, + 0.018565086647868156, + -0.000867554743308574, + 0.015858300030231476, + 0.0239179115742445, + 0.01802726462483406, + -0.021079406142234802, + 0.026475200429558754, + -0.025301534682512283, + -0.050079744309186935, + 0.04159168154001236, + 0.017966004088521004, + -0.09342556446790695, + -0.00604909285902977, + -0.0627245083451271, + -0.03158983960747719, + -0.03260250389575958, + -0.04601069167256355, + 0.07970498502254486, + -0.016719479113817215, + 0.015865210443735123, + -0.003912380896508694, + 0.04825029522180557, + 0.012103811837732792, + 0.04264876991510391, + 0.010969320312142372, + 0.03572453558444977, + -0.02866789884865284, + -0.011157035827636719, + 0.010303262621164322, + -0.02316342666745186, + -0.030725056305527687, + 0.003250312525779009, + 0.030837692320346832, + -0.000044238851842237636, + 0.0585087426006794, + -0.06758221238851547, + 0.017678428441286087, + -0.02749842405319214, + 0.0650908499956131, + 0.01642517000436783, + 0.021325184032320976, + -0.05800101161003113, + 0.010178187862038612, + 0.05605687201023102, + 0.047045402228832245, + -0.04160941019654274, + -0.036981046199798584, + -0.049232251942157745, + 0.0017084302380681038, + -0.01927061937749386, + 0.03130889683961868, + 0.029332751408219337, + -0.05383957177400589, + 0.018522268161177635, + -0.012613418512046337, + -0.03559495508670807, + 0.04001833498477936, + -0.06445033848285675, + -0.012886453419923782, + 0.007960272021591663, + 0.015162055380642414, + 0.04947225749492645, + 0.012653318233788013, + 0.0033582099713385105, + -0.040082454681396484, + -0.006329271476715803, + -0.02013859711587429, + -0.0010933137964457273, + 0.0391286201775074, + 0.02581361122429371, + 0.009145757183432579, + -0.008476438000798225, + -0.013968796469271183, + -0.006294840015470982, + 0.025998245924711227, + 0.04027516394853592, + -0.05789496749639511, + 0.02823607251048088, + 0.012667701579630375, + 0.014668923802673817, + 0.0011884175473824143, + -0.02087756060063839, + 0.011980045586824417, + -0.016232535243034363, + 0.008744405582547188, + -0.004319068975746632, + -0.0028511960990726948, + 0.004092392046004534, + 0.03918279707431793, + 0.01614716835319996, + -0.035176414996385574, + -0.004968687891960144, + -0.07087896019220352, + 0.016983086243271828, + 0.12767021358013153, + 0.03583855926990509, + -0.014925802126526833, + 0.00769092608243227, + -0.055039528757333755, + 0.009122423827648163, + -0.0058362907730042934, + -0.028255537152290344, + 0.0005659337621182203, + -0.0028052967973053455, + -0.0018308012513443828, + -0.04430292174220085, + -0.021424653008580208, + -0.04285275563597679, + 0.030162720009684563, + 0.046057261526584625, + -0.042997781187295914, + 0.022494617849588394, + -0.026338685303926468, + 0.028608374297618866, + -0.019603440538048744, + 0.051890525966882706, + 0.050424471497535706, + -0.028561560437083244, + -0.035150691866874695, + -0.013873049058020115, + -0.03595273941755295, + -0.022301647812128067, + 0.0018776955548673868, + 0.059333059936761856, + -0.0023016617633402348, + 0.02771897241473198, + -0.019763948395848274, + -0.06571770459413528, + 0.04013008624315262, + 0.0022016155999153852, + -0.008628707379102707, + -0.004178460221737623, + 0.05334506556391716, + 0.04185163974761963, + -0.022866038605570793, + 0.002377495402470231, + -0.07506084442138672, + -0.012211451306939125, + -0.01224511954933405, + -0.0422467403113842, + 0.04260328784584999, + 0.014954379759728909, + 0.028194494545459747, + 0.018222235143184662, + 0.07092265784740448, + 0.015252997167408466, + 0.02233051136136055, + 0.029700912535190582, + -0.04542897641658783, + 0.021539974957704544, + 0.013014222495257854, + 0.0462556853890419, + -0.030964568257331848, + -0.019989941269159317, + -0.02363288402557373, + -0.013730700127780437, + -0.0066538588143885136, + -0.03316468372941017, + 0.012285794131457806, + 0.05539320409297943, + 0.0528317354619503, + 0.040991898626089096, + -0.014214767143130302, + 0.030394649133086205, + 0.04296719282865524, + 0.028466014191508293, + -0.019148608669638634, + 0.06060706079006195, + 0.008194002322852612, + 0.0519818477332592, + -0.028827263042330742, + 0.06501372158527374, + -0.007089383900165558, + 0.004593307618051767, + 0.036783672869205475, + 0.020347997546195984, + -0.01891440711915493, + 0.024651989340782166, + 0.008216982707381248, + -0.014283686876296997, + -0.03680012375116348, + 0.07185515016317368, + -0.014085646718740463, + -0.054729390889406204, + -0.05175693333148956, + -0.033140428364276886, + 0.014978989027440548, + -0.028585294261574745, + 0.014868294820189476, + -0.0009755154605954885, + -0.045300621539354324, + -0.04402726888656616, + 0.0004004614893347025, + -0.04966990649700165, + 0.04139050096273422, + -0.0057714530266821384, + -0.020481552928686142, + -0.012488295324146748, + -0.006574901286512613, + -0.010517316870391369, + -0.008989199064671993, + 0.011585038155317307, + 0.06023993343114853, + 0.00448524160310626, + 0.01088039856404066, + -0.029117189347743988, + 0.03834669291973114, + -0.00975235365331173, + -0.008536692708730698, + -0.02684057503938675, + 0.048732466995716095, + -0.05406339839100838, + -0.033410780131816864, + -0.014283313415944576, + -0.011546117253601551, + 0.05304519832134247, + -0.023353448137640953, + 0.018020741641521454, + 0.0682036429643631, + -0.014728601090610027, + 0.03610438108444214, + -0.007281638216227293, + -0.02099430561065674, + 0.045871686190366745, + -0.010921822860836983, + -0.011201693676412106, + -0.02132478915154934, + 0.01679741032421589, + -0.05681009590625763, + 0.022773336619138718, + -0.030883317813277245, + 0.04460291191935539, + -0.027888840064406395, + 0.004814655985683203, + 0.020167561247944832, + -0.05373602733016014, + -0.05105379968881607, + -0.019060643389821053, + -0.012701629661023617, + -0.0372864231467247, + 0.015188687480986118, + 0.03896869719028473, + 0.001956311520189047, + 0.02276485227048397, + -0.0011526296148076653, + 0.017354203388094902, + -0.06422004103660583, + -0.0644431933760643, + -0.0648014172911644, + -0.028815079480409622, + -0.007624851539731026, + -0.028117451816797256, + 0.007507665082812309, + 0.07547393441200256, + 0.05499254912137985, + -0.03819407895207405, + -0.06035035476088524, + 0.009037286043167114, + -0.029614770784974098, + -0.009691713377833366, + -0.0025090263225138187, + -0.025472985580563545, + 0.005090372636914253, + -0.01898542419075966, + 0.006853458471596241, + -0.04378918185830116, + -0.016609761863946915, + 0.01155804842710495, + -0.05629916116595268, + -0.03429161384701729, + -0.004304806236177683, + -0.040659163147211075, + -0.03133564814925194, + -0.0022064305376261473, + 0.015080428682267666, + 0.07632002234458923, + -0.05326807126402855, + 0.030744139105081558, + 0.008302881382405758, + -0.06570707261562347, + 0.048501692712306976, + 0.034659914672374725, + -0.035095471888780594, + -0.005165049806237221, + -0.055603254586458206, + -0.021192826330661774, + 0.022730527445673943, + 0.014607615768909454, + -0.0426994152367115, + 0.016557713970541954, + 0.022108182311058044, + -0.013454240746796131, + 0.03432025387883186, + -0.04634029418230057, + -0.05901316925883293, + 0.009274017997086048, + 0.006870052311569452, + 0.0036789809819310904, + -0.020034056156873703, + 0.04162808507680893, + 0.03416291996836662, + -0.01805955357849598, + -0.000977828400209546, + -0.004798010922968388, + 0.010859864763915539, + -0.014778133481740952, + -0.00529101537540555, + -0.029868070036172867, + 0.021942060440778732, + -0.0013025213265791535, + 0.010480746626853943, + -0.047470662742853165, + -0.01585027389228344, + -0.04689106345176697, + 0.04397595673799515, + -0.028347989544272423, + -0.012565996497869492, + -0.005692906677722931, + 0.052168164402246475, + -0.018355369567871094, + 0.07390446960926056, + -0.01871008425951004, + 0.017274361103773117, + -0.011059156619012356, + -0.035504214465618134, + 0.049215517938137054, + -0.048129498958587646, + 0.06892205029726028, + -0.046266961842775345, + 0.02197258546948433, + -0.0020027458667755127, + -0.021148083731532097, + -0.006229306571185589, + -0.03165286406874657, + -0.08150651305913925, + 0.01601426675915718, + 0.04902094230055809, + -0.02794867940247059, + 0.05690855532884598, + 0.018739905208349228, + 0.029227394610643387, + 0.006465272046625614, + -0.020602518692612648, + -0.05716253072023392, + 0.05311451107263565, + -0.006407602224498987, + -0.0243686456233263, + 0.02566416934132576, + 0.008096356876194477, + -0.055141381919384, + -0.009396945126354694, + -0.0012241379590705037, + 0.013284377753734589, + -0.047882791608572006, + 0.030743718147277832, + 0.04883703216910362, + 0.066514752805233, + 0.0017948453314602375, + 0.0044357567094266415, + -0.01611628569662571, + -0.027637965977191925, + 0.033804140985012054, + 0.04977351799607277, + 0.006761862896382809, + -0.019579298794269562, + 0.019470933824777603, + 0.01719452254474163, + 0.03818729147315025, + 0.05320286005735397, + 0.014689194038510323, + -0.0018116346327587962, + -0.08101537078619003, + 0.0344974584877491, + 0.0003159473999403417, + 0.011623978614807129, + -0.06837049871683121, + -0.004467540420591831, + 0.030559740960597992, + -0.06766505539417267, + -0.03334945812821388, + -0.05410384759306908, + -0.025884341448545456, + -0.024469265714287758, + -0.024729641154408455, + -0.0005382020026445389, + -0.011704366654157639, + 0.023576386272907257, + -0.030916554853320122, + 0.010395214892923832, + -0.039300188422203064, + 0.024920444935560226, + -0.013096856884658337, + -0.028153318911790848, + 0.07416229695081711, + -0.0353594571352005, + 0.006645023822784424, + -0.0370262935757637, + -0.02939070202410221, + 0.017032137140631676, + -0.026637757197022438 + ] + } + } + ] + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringGeminiTest.json b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringGeminiTest.json new file mode 100644 index 00000000..13ff0ac0 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringGeminiTest.json @@ -0,0 +1,830 @@ +{ + "recordID": "EmbedContentTest.EmbedContentSingleStringGeminiTest", + "interactions": [ + { + "request": { + "method": "POST", + "url": "/v1beta/models/text-embedding-004:batchEmbedContents", + "request": "POST /v1beta/models/text-embedding-004:batchEmbedContents HTTP/1.1", + "headers": { + "Content-Length": "118", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "EmbedContentTest.EmbedContentSingleStringGeminiTest" + }, + "bodySegments": [ + { + "requests": [ + { + "content": { + "parts": [ + { + "text": "What is your name?" + } + ], + "role": "user" + }, + "model": "models/text-embedding-004" + } + ] + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "generativelanguage.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "c683a06536684e0898af72334a10fd81e588faa5c14c504222743d7f9da36e68", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Thu, 20 Nov 2025 00:35:10 GMT", + "Server": "scaffolding on HTTPServer2", + "Server-Timing": "gfet4t7; dur=186", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "embeddings": [ + { + "values": [ + 0.021732023, + -0.005427982, + -0.01701328, + 0.02430373, + 0.013187526, + 0.057707485, + 0.028726421, + 0.0115679605, + -0.006673027, + 0.02951852, + -0.065773904, + 0.006512121, + 0.06202991, + -0.041853856, + -0.070919365, + 0.014113805, + -0.032625366, + -0.020559896, + -0.05590399, + -0.064535275, + 0.015795678, + -0.04487683, + 0.014454995, + -0.07018945, + -0.003921109, + -0.037335303, + -0.0019505617, + -0.042179246, + -0.04839255, + -0.048437532, + 0.023158008, + 0.044043574, + -0.028138345, + 0.004748051, + 0.049392708, + 0.054424796, + -0.02518876, + -0.020597808, + 0.026315931, + -0.067800686, + -0.07013981, + 0.07700788, + -0.04559307, + 0.02775326, + -0.0027906934, + -0.010075191, + 0.04463516, + 0.029150054, + -0.04134455, + 0.068995364, + 0.05047888, + -0.012715973, + -0.05104324, + 0.01565891, + 0.04721188, + -0.014199643, + -0.028556028, + -0.017631317, + 0.046491437, + 0.0078040794, + -0.039787453, + -0.011537996, + -0.05668377, + -0.0017825877, + 0.051781815, + 0.02939808, + 0.0077320687, + 0.035731204, + -0.023526808, + 0.06269574, + 0.0012985622, + 0.015149391, + -0.07904071, + 0.040479586, + -0.031503964, + 0.0040280814, + -0.0054447693, + -0.012071941, + 0.031841204, + 0.01990303, + 0.019138258, + 0.019604903, + 0.040595856, + 0.06658458, + 0.010618229, + 0.011111334, + 0.018468456, + -0.027970614, + -0.0094481595, + -0.01795139, + 0.083042696, + 0.034492366, + -0.032865304, + -0.018975737, + 0.025752187, + -0.046107627, + -0.086650506, + -0.091901645, + 0.03759866, + 0.05411619, + 0.0072942916, + 0.017192867, + -0.007640952, + -0.034948424, + 0.043175504, + 0.0023262291, + -0.036720708, + -0.008202913, + -0.04055865, + -0.048558176, + 0.020139972, + -0.05105226, + 0.05310882, + -0.025666693, + 0.005313517, + -0.04791561, + -0.021382187, + 0.0073072053, + -0.043664213, + 0.01779283, + -0.043429546, + 0.015419766, + -0.028060539, + 0.08211297, + 0.038712554, + 0.045185514, + 0.05094181, + -0.06497028, + -0.026023604, + -0.047003623, + 0.095147274, + -0.01768276, + 0.02028647, + 0.06441857, + -0.03168662, + 0.0028985208, + 0.087957025, + 0.021767767, + -0.00439769, + -0.08913329, + 0.016554622, + -0.027870024, + -0.06505592, + -0.01863668, + 0.025063451, + -0.005407604, + -0.026613016, + 0.02080014, + -0.018563172, + -0.010264666, + -0.013438265, + 0.07488961, + 0.06566093, + -0.0061225863, + -0.026820945, + 0.03175545, + 0.06477917, + 0.011307347, + -0.003086155, + -0.062736325, + -0.04284983, + -0.022861594, + -0.03401332, + 0.026865706, + -0.073508866, + 0.033875328, + 0.028457234, + -0.0128714945, + 0.007999089, + -0.00015508205, + -0.018102331, + -0.0005202144, + -0.0372271, + -0.053822625, + 0.015279704, + -0.012511828, + 0.022307146, + -0.030724283, + 0.036848143, + -0.0033739507, + -0.009714464, + 0.06169807, + -0.06319587, + -0.013927568, + -0.03612881, + 0.025824402, + -0.02500134, + 0.07412934, + -0.0003537176, + 0.03824628, + -0.049187887, + 0.028985638, + 0.029823536, + -0.03427824, + 0.00043551248, + 0.017849268, + 0.025572207, + -0.055592805, + -0.0008958806, + 0.012244622, + 0.03514161, + 0.006128201, + -0.014223764, + -0.034149714, + -0.0010793366, + 0.014671598, + -0.0017118206, + -0.086871594, + 0.0689741, + 0.013167657, + -0.016082553, + -0.032350346, + 0.01850987, + -0.063346915, + 0.014290179, + -0.021259954, + 0.04425871, + 0.011059084, + 0.074194655, + -0.04258757, + 0.028936448, + 0.0018465539, + 0.012163382, + 0.0219103, + -0.022598108, + 0.0039217602, + -0.03695365, + -0.0041201613, + -0.01571833, + -0.07364755, + -0.024847534, + 0.009151082, + -0.016215255, + 0.023441585, + -0.016521703, + 0.02837979, + 0.030763665, + 0.023492493, + 0.014166916, + -0.0288686, + 0.011056216, + -0.0009931327, + -0.011042509, + 0.017762605, + -0.012461449, + 0.014276804, + 0.047914837, + 0.04684253, + 0.048720326, + -0.04800321, + -0.035621695, + 0.00918018, + -0.008930229, + 0.048836164, + -0.06673736, + -0.029404191, + 0.015204164, + -0.038902648, + 0.028021071, + -0.0089533385, + 0.055070255, + -0.05017493, + -0.028786048, + -0.08817404, + -0.029183188, + 0.0072104936, + -0.060777586, + -0.0036320605, + 0.054837786, + -0.048155326, + 0.00032331812, + -0.0021828704, + 0.026372949, + 0.0032336547, + -0.0001215726, + -0.027724884, + -0.03255122, + 0.011677186, + -0.080120124, + 0.007469913, + 0.06820577, + -0.012906102, + -0.028967457, + 0.023897767, + -0.02687246, + -0.051146414, + 0.01996493, + 0.0232165, + -0.026917802, + -0.0025074985, + 0.021924254, + 0.03674799, + -0.039655026, + 0.031109927, + 0.0013627073, + 0.012972641, + 0.0033493587, + -0.013672427, + 0.023478772, + 0.010855056, + 0.07252118, + 0.06641578, + -0.0458096, + -0.008709587, + 0.015178798, + 0.024758935, + -0.037923276, + -0.004971566, + -0.022823673, + -0.014705508, + -0.021376865, + 0.0004951399, + -0.044138975, + -0.015801622, + -0.05028487, + -0.033774324, + -0.062429715, + -0.024937047, + -0.014561467, + -0.0078024445, + 0.014095472, + 0.0065130047, + 0.00011388763, + 0.004937366, + 0.03312744, + -0.009198156, + 0.03003049, + -0.005171963, + 0.023728061, + 0.022158967, + 0.0048903353, + -0.017343545, + 0.040393982, + -0.060654435, + 0.05794729, + 0.0474465, + -0.059573006, + 0.070875145, + 0.03519408, + 0.027417405, + -0.0009910526, + 0.008779711, + 0.068335116, + 0.020527631, + -0.0049977037, + -0.051168382, + 0.08418298, + -0.04326717, + -0.048250232, + -0.040528286, + 0.018352972, + 0.044325255, + 0.043977063, + -0.075352326, + -0.04420792, + -0.025577545, + 0.025746621, + 0.0077310055, + 0.009725111, + 0.014291654, + 0.015161767, + 0.057375338, + -0.024882685, + 0.037921574, + -0.0031116833, + 0.005875485, + 0.024005413, + 0.024842788, + 0.018666634, + -0.00070016074, + 0.016103651, + 0.023904258, + 0.017784713, + -0.021084066, + 0.026901806, + -0.02530135, + -0.050290965, + 0.04153818, + 0.017961971, + -0.09331208, + -0.0061010513, + -0.062682465, + -0.03150989, + -0.032891862, + -0.04606956, + 0.079529606, + -0.016813986, + 0.016080689, + -0.0036578986, + 0.048146825, + 0.011964877, + 0.042866077, + 0.011102674, + 0.035849433, + -0.028622726, + -0.01135784, + 0.0103660785, + -0.023125472, + -0.030768517, + 0.0032658037, + 0.030869648, + -0.00016968095, + 0.058609642, + -0.06740337, + 0.01777014, + -0.02731725, + 0.06483008, + 0.01600025, + 0.021474589, + -0.05818128, + 0.009907066, + 0.056136426, + 0.04706602, + -0.041637212, + -0.03714074, + -0.049108487, + 0.0016345484, + -0.019232506, + 0.030971756, + 0.029338887, + -0.053715847, + 0.018526014, + -0.012505863, + -0.03545443, + 0.039897077, + -0.064882375, + -0.0129608335, + 0.007973985, + 0.015395275, + 0.04940776, + 0.012882792, + 0.0032966181, + -0.03997977, + -0.006467839, + -0.020111116, + -0.0010222138, + 0.038869478, + 0.025669875, + 0.009226892, + -0.0087065, + -0.014253337, + -0.005986784, + 0.02627052, + 0.04010542, + -0.057972465, + 0.028121144, + 0.012687158, + 0.014692529, + 0.00138856, + -0.020912336, + 0.011917243, + -0.016168779, + 0.008572726, + -0.0043006605, + -0.0027227388, + 0.004042753, + 0.039051224, + 0.015979048, + -0.035146788, + -0.004715289, + -0.07063991, + 0.017212009, + 0.12757415, + 0.036007263, + -0.015175765, + 0.007571235, + -0.054939095, + 0.008883072, + -0.0057537467, + -0.028391968, + 0.0008537393, + -0.0028022863, + -0.001849641, + -0.044249125, + -0.021250686, + -0.042766757, + 0.030110149, + 0.045934536, + -0.043373402, + 0.022158602, + -0.02657093, + 0.0287476, + -0.01929913, + 0.05214999, + 0.05056057, + -0.028526358, + -0.03519996, + -0.01386718, + -0.035907086, + -0.022574408, + 0.0019659542, + 0.05966947, + -0.0020215933, + 0.027899528, + -0.019791396, + -0.06576608, + 0.039979335, + 0.0022787002, + -0.008656878, + -0.004085453, + 0.053450048, + 0.041672274, + -0.022824306, + 0.0023114537, + -0.07511918, + -0.012216688, + -0.012177739, + -0.042105895, + 0.042723283, + 0.014980786, + 0.028324781, + 0.017931126, + 0.071089424, + 0.015353811, + 0.022265911, + 0.029940642, + -0.04537605, + 0.021293657, + 0.013327408, + 0.04640396, + -0.03101765, + -0.020290984, + -0.023704778, + -0.013542706, + -0.006656219, + -0.032945726, + 0.012337845, + 0.055753943, + 0.05275453, + 0.040945727, + -0.01434174, + 0.030551367, + 0.042950153, + 0.028337905, + -0.019184321, + 0.060790967, + 0.007948735, + 0.05227727, + -0.028676575, + 0.065153785, + -0.007268671, + 0.004590255, + 0.03687554, + 0.020140577, + -0.018629551, + 0.024465326, + 0.00797017, + -0.014205899, + -0.036797658, + 0.07176319, + -0.014265327, + -0.05478396, + -0.05184108, + -0.03301546, + 0.014929797, + -0.028599994, + 0.014946195, + -0.0009782586, + -0.045367755, + -0.043870185, + 0.0005148074, + -0.049717274, + 0.041212887, + -0.005940272, + -0.020473542, + -0.012702243, + -0.0063222763, + -0.01015335, + -0.008595781, + 0.011666455, + 0.060426325, + 0.0046639154, + 0.011105114, + -0.029272262, + 0.038317457, + -0.009651271, + -0.008651311, + -0.026746567, + 0.048916854, + -0.05385514, + -0.033032287, + -0.014459559, + -0.0112643195, + 0.053167485, + -0.023299599, + 0.018084802, + 0.06802071, + -0.014761364, + 0.03627573, + -0.0074563012, + -0.021095054, + 0.04584932, + -0.01101446, + -0.011260906, + -0.021476647, + 0.016765757, + -0.05683144, + 0.023100277, + -0.030728871, + 0.044724926, + -0.027596502, + 0.0044694333, + 0.020120855, + -0.0538814, + -0.0506869, + -0.019163864, + -0.012962558, + -0.037282612, + 0.014974521, + 0.038997736, + 0.0019971314, + 0.022850448, + -0.001232746, + 0.017249607, + -0.06399885, + -0.06411625, + -0.06488422, + -0.028379094, + -0.007468766, + -0.027646014, + 0.0074430197, + 0.07539032, + 0.054979626, + -0.038174536, + -0.06002654, + 0.008941892, + -0.02963719, + -0.009472218, + -0.0025154725, + -0.025877867, + 0.0048244237, + -0.019133395, + 0.0067171385, + -0.043682333, + -0.016353559, + 0.0115020005, + -0.056191448, + -0.03422215, + -0.0040672235, + -0.040476836, + -0.03131491, + -0.0019601472, + 0.015060794, + 0.07604932, + -0.053201057, + 0.030762864, + 0.008180191, + -0.0657994, + 0.0484927, + 0.034822624, + -0.03507979, + -0.004888684, + -0.055713218, + -0.02127549, + 0.022850065, + 0.014464012, + -0.042600404, + 0.016209306, + 0.022103056, + -0.013177287, + 0.034419924, + -0.04585367, + -0.058879104, + 0.009181555, + 0.0070055784, + 0.0035586532, + -0.020379882, + 0.04145162, + 0.034101978, + -0.018064423, + -0.0012888993, + -0.004689197, + 0.0109357005, + -0.014617613, + -0.005186308, + -0.029723963, + 0.021603268, + -0.0014754526, + 0.010380154, + -0.047426764, + -0.015981246, + -0.046953265, + 0.044089496, + -0.028411813, + -0.012775297, + -0.005816417, + 0.052139927, + -0.018612517, + 0.07371406, + -0.018997138, + 0.017415436, + -0.011070157, + -0.035656452, + 0.048961405, + -0.048083518, + 0.06907546, + -0.04624489, + 0.022027653, + -0.0019987, + -0.021423373, + -0.006276124, + -0.03141525, + -0.08152749, + 0.015939724, + 0.048909925, + -0.027961198, + 0.056896906, + 0.018740157, + 0.028924676, + 0.0065314677, + -0.020309204, + -0.05717529, + 0.05316093, + -0.0063474686, + -0.024302784, + 0.025907952, + 0.008029035, + -0.055261355, + -0.009198551, + -0.0015154663, + 0.013299544, + -0.04790821, + 0.030572522, + 0.048798006, + 0.0665314, + 0.0018343765, + 0.004501543, + -0.016081218, + -0.027529601, + 0.03398698, + 0.04964241, + 0.0067964853, + -0.019521303, + 0.019564042, + 0.017308172, + 0.038052287, + 0.053164627, + 0.014857851, + -0.0016251518, + -0.08076403, + 0.034556214, + 0.0004833621, + 0.011365417, + -0.068415076, + -0.0042743282, + 0.030445311, + -0.067525476, + -0.03302983, + -0.054259263, + -0.026307182, + -0.024360968, + -0.024735259, + -0.00056397833, + -0.011796876, + 0.023660615, + -0.030753233, + 0.010003241, + -0.039316658, + 0.025120739, + -0.012940403, + -0.028495843, + 0.07411172, + -0.03561696, + 0.0064676674, + -0.037032407, + -0.029247785, + 0.017187377, + -0.026557919 + ] + } + ] + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringVertexTest.json b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringVertexTest.json new file mode 100644 index 00000000..6540bf51 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/EmbedContentTest.EmbedContentSingleStringVertexTest.json @@ -0,0 +1,830 @@ +{ + "recordID": "EmbedContentTest.EmbedContentSingleStringVertexTest", + "interactions": [ + { + "request": { + "method": "POST", + "url": "/v1beta1/projects/REDACTED/locations/us-central1/publishers/google/models/text-embedding-004:predict", + "request": "POST /v1beta1/projects/REDACTED/locations/us-central1/publishers/google/models/text-embedding-004:predict HTTP/1.1", + "headers": { + "Content-Length": "48", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "EmbedContentTest.EmbedContentSingleStringVertexTest" + }, + "bodySegments": [ + { + "instances": [ + { + "content": "What is your name?" + } + ] + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "us-central1-aiplatform.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "a7fa6d840b8ecff204ac638ffdfc4cc1c5596557e7c7e09882e5d55d428e3676", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Thu, 20 Nov 2025 00:35:10 GMT", + "Server": "scaffolding on HTTPServer2", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "metadata": { + "billableCharacterCount": 15 + }, + "predictions": [ + { + "embeddings": { + "statistics": { + "token_count": 5, + "truncated": false + }, + "values": [ + 0.02191467583179474, + -0.005375662352889776, + -0.017126262187957764, + 0.02436019666492939, + 0.013047702610492706, + 0.057812709361314774, + 0.028640445321798325, + 0.011477270163595676, + -0.006714188493788242, + 0.02943362295627594, + -0.06577935814857483, + 0.006328667048364878, + 0.06190791353583336, + -0.041980549693107605, + -0.07129119336605072, + 0.013936841860413551, + -0.03303055465221405, + -0.020750362426042557, + -0.05600179359316826, + -0.06443746387958527, + 0.015810616314411163, + -0.0450187548995018, + 0.0142097482457757, + -0.06995121389627457, + -0.003983344882726669, + -0.037046972662210464, + -0.0021527165081351995, + -0.042551882565021515, + -0.04837816208600998, + -0.04867112636566162, + 0.023109082132577896, + 0.043841805309057236, + -0.02798762544989586, + 0.004672285169363022, + 0.049226004630327225, + 0.054410096257925034, + -0.02552333101630211, + -0.020402073860168457, + 0.026488689705729485, + -0.06786046922206879, + -0.0701357051730156, + 0.07654319703578949, + -0.04566756263375282, + 0.0274858046323061, + -0.0026797910686582327, + -0.009870409965515137, + 0.044678691774606705, + 0.029297087341547012, + -0.0410812608897686, + 0.06905873864889145, + 0.050521258264780045, + -0.01254947204142809, + -0.05097421631217003, + 0.015482486225664616, + 0.047183066606521606, + -0.01422051154077053, + -0.028319042176008224, + -0.017806529998779297, + 0.04670654609799385, + 0.007968416437506676, + -0.039873555302619934, + -0.011817448772490025, + -0.05669791251420975, + -0.0017165997996926308, + 0.05183912068605423, + 0.029032427817583084, + 0.007664937991648912, + 0.035931289196014404, + -0.023554900661110878, + 0.06322957575321198, + 0.0009985790820792317, + 0.015462295152246952, + -0.07874314486980438, + 0.04048033803701401, + -0.03157108277082443, + 0.004067446570843458, + -0.005662224255502224, + -0.011977564543485641, + 0.03169484809041023, + 0.020089799538254738, + 0.019109876826405525, + 0.01976454071700573, + 0.04042389988899231, + 0.06654180586338043, + 0.010684515349566936, + 0.011097312904894352, + 0.018535001203417778, + -0.028012026101350784, + -0.009333133697509766, + -0.01806136593222618, + 0.08294727653265, + 0.034502554684877396, + -0.03282937780022621, + -0.018723372370004654, + 0.025715427473187447, + -0.045961469411849976, + -0.08626145124435425, + -0.09200649708509445, + 0.03765988349914551, + 0.05396872013807297, + 0.007464696187525988, + 0.01741752400994301, + -0.007591143250465393, + -0.034974873065948486, + 0.042996928095817566, + 0.002628590678796172, + -0.03627432510256767, + -0.008292313665151596, + -0.04088747501373291, + -0.04826778173446655, + 0.020012345165014267, + -0.051125362515449524, + 0.052583735436201096, + -0.025491753593087196, + 0.005355607718229294, + -0.048058412969112396, + -0.021139446645975113, + 0.007148019969463348, + -0.04351223632693291, + 0.017901994287967682, + -0.043479811400175095, + 0.015374517068266869, + -0.02796998992562294, + 0.08216500282287598, + 0.0385577492415905, + 0.04523114114999771, + 0.05102241784334183, + -0.06517123430967331, + -0.026211468502879143, + -0.04753038287162781, + 0.09503993391990662, + -0.017820041626691818, + 0.020161526277661324, + 0.06453297287225723, + -0.03186536952853203, + 0.0028199423104524612, + 0.08753232657909393, + 0.022204184904694557, + -0.0046211970038712025, + -0.08923111110925674, + 0.016467973589897156, + -0.02773600071668625, + -0.06496598571538925, + -0.018676571547985077, + 0.024945924058556557, + -0.005324262659996748, + -0.0264165960252285, + 0.020861119031906128, + -0.018219755962491035, + -0.010250424034893513, + -0.013288149610161781, + 0.07496076822280884, + 0.06583354622125626, + -0.006147997919470072, + -0.026791710406541824, + 0.031568143516778946, + 0.06491973996162415, + 0.011463453993201256, + -0.0030693556182086468, + -0.06271496415138245, + -0.04288629814982414, + -0.02308020181953907, + -0.03446440026164055, + 0.02690156176686287, + -0.07374061644077301, + 0.033821430057287216, + 0.028715718537569046, + -0.012852726504206657, + 0.007933908142149448, + 0.0001657039683777839, + -0.01805940270423889, + -0.0007495938334614038, + -0.03690396621823311, + -0.05373769626021385, + 0.01503095030784607, + -0.012704755179584026, + 0.02236936055123806, + -0.030758671462535858, + 0.03672901913523674, + -0.003278525546193123, + -0.00994566548615694, + 0.061773158609867096, + -0.06340005248785019, + -0.01387645211070776, + -0.03648504242300987, + 0.02578301727771759, + -0.02501736767590046, + 0.07406442612409592, + -0.0003103716589976102, + 0.03796118125319481, + -0.049105674028396606, + 0.029097052291035652, + 0.030081935226917267, + -0.03432599827647209, + 0.0003734667261596769, + 0.01784430257976055, + 0.025448186323046684, + -0.05563183128833771, + -0.001006615930236876, + 0.012209201231598854, + 0.035354889929294586, + 0.005952359642833471, + -0.014054520055651665, + -0.034404680132865906, + -0.001159191015176475, + 0.014578981325030327, + -0.0015602193307131529, + -0.08669233322143555, + 0.0689886286854744, + 0.013376818038523197, + -0.016040271148085594, + -0.032342202961444855, + 0.018484599888324738, + -0.06335530430078506, + 0.01424500998109579, + -0.021511591970920563, + 0.04434873163700104, + 0.011166363954544067, + 0.07412409037351608, + -0.04271319508552551, + 0.028773780912160873, + 0.001773450174368918, + 0.012246144004166126, + 0.02176092378795147, + -0.02232058160007, + 0.003990938421338797, + -0.036765024065971375, + -0.004432495217770338, + -0.015791242942214012, + -0.0737270936369896, + -0.02488739788532257, + 0.008995487354695797, + -0.016183633357286453, + 0.023430241271853447, + -0.01661158725619316, + 0.028724433854222298, + 0.030969148501753807, + 0.02371246926486492, + 0.013921246863901615, + -0.028931334614753723, + 0.011242881417274475, + -0.00105689512565732, + -0.010574218817055225, + 0.018262026831507683, + -0.012447363696992397, + 0.014152003452181816, + 0.04794358089566231, + 0.046464547514915466, + 0.0488271526992321, + -0.04764255881309509, + -0.035664159804582596, + 0.009265505708754063, + -0.008771565742790699, + 0.048707153648138046, + -0.06692487746477127, + -0.02959105558693409, + 0.015313539654016495, + -0.038833536207675934, + 0.02816462703049183, + -0.008738221600651741, + 0.05495430901646614, + -0.04996863380074501, + -0.028620444238185883, + -0.08828423917293549, + -0.029385706409811974, + 0.007438374683260918, + -0.060841962695121765, + -0.0038528055883944035, + 0.054627519100904465, + -0.04789957031607628, + 0.0006318801897577941, + -0.001871264772489667, + 0.02649794891476631, + 0.0032661668956279755, + 0.00009672534361016005, + -0.02783897891640663, + -0.03259721025824547, + 0.011480639688670635, + -0.08014679700136185, + 0.007716733030974865, + 0.06792054325342178, + -0.012709974311292171, + -0.029126854613423347, + 0.024129651486873627, + -0.027213212102651596, + -0.05118342116475105, + 0.02024710550904274, + 0.023398887366056442, + -0.026866355910897255, + -0.0023911953903734684, + 0.02161281183362007, + 0.03676353394985199, + -0.03937196359038353, + 0.030888264998793602, + 0.001085786847397685, + 0.012805832549929619, + 0.0035912382882088423, + -0.013487495481967926, + 0.023255567997694016, + 0.01094580814242363, + 0.07211597263813019, + 0.06635834276676178, + -0.04578062519431114, + -0.008742721751332283, + 0.015196166932582855, + 0.02477053552865982, + -0.03767270967364311, + -0.004941184539347887, + -0.022991230711340904, + -0.014623144641518593, + -0.021738912910223007, + 0.0004978319630026817, + -0.04402419179677963, + -0.016015686094760895, + -0.04984444007277489, + -0.033859021961688995, + -0.06193063035607338, + -0.024885468184947968, + -0.014492817223072052, + -0.00777471624314785, + 0.0140109583735466, + 0.006411806680262089, + 0.00020509317982941866, + 0.0049156369641423225, + 0.03310377150774002, + -0.009215550497174263, + 0.030054306611418724, + -0.00488352682441473, + 0.023593753576278687, + 0.022362446412444115, + 0.005098273511976004, + -0.01709109917283058, + 0.040728792548179626, + -0.06043768674135208, + 0.057996466755867004, + 0.047297339886426926, + -0.05948658660054207, + 0.07101988047361374, + 0.03522071987390518, + 0.027591776102781296, + -0.0008590957731939852, + 0.009041606448590755, + 0.06813155859708786, + 0.020701205357909203, + -0.005096039269119501, + -0.0512864775955677, + 0.08414465934038162, + -0.04309631139039993, + -0.04794631525874138, + -0.04099157825112343, + 0.01830362156033516, + 0.0447906032204628, + 0.04389907792210579, + -0.07537507265806198, + -0.04408467561006546, + -0.025669483467936516, + 0.025553733110427856, + 0.007470926269888878, + 0.00961330533027649, + 0.014587015844881535, + 0.015057752840220928, + 0.05702519044280052, + -0.024880899116396904, + 0.038034889847040176, + -0.003278210759162903, + 0.0061341882683336735, + 0.024219488725066185, + 0.024731319397687912, + 0.018565086647868156, + -0.000867554743308574, + 0.015858300030231476, + 0.0239179115742445, + 0.01802726462483406, + -0.021079406142234802, + 0.026475200429558754, + -0.025301534682512283, + -0.050079744309186935, + 0.04159168154001236, + 0.017966004088521004, + -0.09342556446790695, + -0.00604909285902977, + -0.0627245083451271, + -0.03158983960747719, + -0.03260250389575958, + -0.04601069167256355, + 0.07970498502254486, + -0.016719479113817215, + 0.015865210443735123, + -0.003912380896508694, + 0.04825029522180557, + 0.012103811837732792, + 0.04264876991510391, + 0.010969320312142372, + 0.03572453558444977, + -0.02866789884865284, + -0.011157035827636719, + 0.010303262621164322, + -0.02316342666745186, + -0.030725056305527687, + 0.003250312525779009, + 0.030837692320346832, + -0.000044238851842237636, + 0.0585087426006794, + -0.06758221238851547, + 0.017678428441286087, + -0.02749842405319214, + 0.0650908499956131, + 0.01642517000436783, + 0.021325184032320976, + -0.05800101161003113, + 0.010178187862038612, + 0.05605687201023102, + 0.047045402228832245, + -0.04160941019654274, + -0.036981046199798584, + -0.049232251942157745, + 0.0017084302380681038, + -0.01927061937749386, + 0.03130889683961868, + 0.029332751408219337, + -0.05383957177400589, + 0.018522268161177635, + -0.012613418512046337, + -0.03559495508670807, + 0.04001833498477936, + -0.06445033848285675, + -0.012886453419923782, + 0.007960272021591663, + 0.015162055380642414, + 0.04947225749492645, + 0.012653318233788013, + 0.0033582099713385105, + -0.040082454681396484, + -0.006329271476715803, + -0.02013859711587429, + -0.0010933137964457273, + 0.0391286201775074, + 0.02581361122429371, + 0.009145757183432579, + -0.008476438000798225, + -0.013968796469271183, + -0.006294840015470982, + 0.025998245924711227, + 0.04027516394853592, + -0.05789496749639511, + 0.02823607251048088, + 0.012667701579630375, + 0.014668923802673817, + 0.0011884175473824143, + -0.02087756060063839, + 0.011980045586824417, + -0.016232535243034363, + 0.008744405582547188, + -0.004319068975746632, + -0.0028511960990726948, + 0.004092392046004534, + 0.03918279707431793, + 0.01614716835319996, + -0.035176414996385574, + -0.004968687891960144, + -0.07087896019220352, + 0.016983086243271828, + 0.12767021358013153, + 0.03583855926990509, + -0.014925802126526833, + 0.00769092608243227, + -0.055039528757333755, + 0.009122423827648163, + -0.0058362907730042934, + -0.028255537152290344, + 0.0005659337621182203, + -0.0028052967973053455, + -0.0018308012513443828, + -0.04430292174220085, + -0.021424653008580208, + -0.04285275563597679, + 0.030162720009684563, + 0.046057261526584625, + -0.042997781187295914, + 0.022494617849588394, + -0.026338685303926468, + 0.028608374297618866, + -0.019603440538048744, + 0.051890525966882706, + 0.050424471497535706, + -0.028561560437083244, + -0.035150691866874695, + -0.013873049058020115, + -0.03595273941755295, + -0.022301647812128067, + 0.0018776955548673868, + 0.059333059936761856, + -0.0023016617633402348, + 0.02771897241473198, + -0.019763948395848274, + -0.06571770459413528, + 0.04013008624315262, + 0.0022016155999153852, + -0.008628707379102707, + -0.004178460221737623, + 0.05334506556391716, + 0.04185163974761963, + -0.022866038605570793, + 0.002377495402470231, + -0.07506084442138672, + -0.012211451306939125, + -0.01224511954933405, + -0.0422467403113842, + 0.04260328784584999, + 0.014954379759728909, + 0.028194494545459747, + 0.018222235143184662, + 0.07092265784740448, + 0.015252997167408466, + 0.02233051136136055, + 0.029700912535190582, + -0.04542897641658783, + 0.021539974957704544, + 0.013014222495257854, + 0.0462556853890419, + -0.030964568257331848, + -0.019989941269159317, + -0.02363288402557373, + -0.013730700127780437, + -0.0066538588143885136, + -0.03316468372941017, + 0.012285794131457806, + 0.05539320409297943, + 0.0528317354619503, + 0.040991898626089096, + -0.014214767143130302, + 0.030394649133086205, + 0.04296719282865524, + 0.028466014191508293, + -0.019148608669638634, + 0.06060706079006195, + 0.008194002322852612, + 0.0519818477332592, + -0.028827263042330742, + 0.06501372158527374, + -0.007089383900165558, + 0.004593307618051767, + 0.036783672869205475, + 0.020347997546195984, + -0.01891440711915493, + 0.024651989340782166, + 0.008216982707381248, + -0.014283686876296997, + -0.03680012375116348, + 0.07185515016317368, + -0.014085646718740463, + -0.054729390889406204, + -0.05175693333148956, + -0.033140428364276886, + 0.014978989027440548, + -0.028585294261574745, + 0.014868294820189476, + -0.0009755154605954885, + -0.045300621539354324, + -0.04402726888656616, + 0.0004004614893347025, + -0.04966990649700165, + 0.04139050096273422, + -0.0057714530266821384, + -0.020481552928686142, + -0.012488295324146748, + -0.006574901286512613, + -0.010517316870391369, + -0.008989199064671993, + 0.011585038155317307, + 0.06023993343114853, + 0.00448524160310626, + 0.01088039856404066, + -0.029117189347743988, + 0.03834669291973114, + -0.00975235365331173, + -0.008536692708730698, + -0.02684057503938675, + 0.048732466995716095, + -0.05406339839100838, + -0.033410780131816864, + -0.014283313415944576, + -0.011546117253601551, + 0.05304519832134247, + -0.023353448137640953, + 0.018020741641521454, + 0.0682036429643631, + -0.014728601090610027, + 0.03610438108444214, + -0.007281638216227293, + -0.02099430561065674, + 0.045871686190366745, + -0.010921822860836983, + -0.011201693676412106, + -0.02132478915154934, + 0.01679741032421589, + -0.05681009590625763, + 0.022773336619138718, + -0.030883317813277245, + 0.04460291191935539, + -0.027888840064406395, + 0.004814655985683203, + 0.020167561247944832, + -0.05373602733016014, + -0.05105379968881607, + -0.019060643389821053, + -0.012701629661023617, + -0.0372864231467247, + 0.015188687480986118, + 0.03896869719028473, + 0.001956311520189047, + 0.02276485227048397, + -0.0011526296148076653, + 0.017354203388094902, + -0.06422004103660583, + -0.0644431933760643, + -0.0648014172911644, + -0.028815079480409622, + -0.007624851539731026, + -0.028117451816797256, + 0.007507665082812309, + 0.07547393441200256, + 0.05499254912137985, + -0.03819407895207405, + -0.06035035476088524, + 0.009037286043167114, + -0.029614770784974098, + -0.009691713377833366, + -0.0025090263225138187, + -0.025472985580563545, + 0.005090372636914253, + -0.01898542419075966, + 0.006853458471596241, + -0.04378918185830116, + -0.016609761863946915, + 0.01155804842710495, + -0.05629916116595268, + -0.03429161384701729, + -0.004304806236177683, + -0.040659163147211075, + -0.03133564814925194, + -0.0022064305376261473, + 0.015080428682267666, + 0.07632002234458923, + -0.05326807126402855, + 0.030744139105081558, + 0.008302881382405758, + -0.06570707261562347, + 0.048501692712306976, + 0.034659914672374725, + -0.035095471888780594, + -0.005165049806237221, + -0.055603254586458206, + -0.021192826330661774, + 0.022730527445673943, + 0.014607615768909454, + -0.0426994152367115, + 0.016557713970541954, + 0.022108182311058044, + -0.013454240746796131, + 0.03432025387883186, + -0.04634029418230057, + -0.05901316925883293, + 0.009274017997086048, + 0.006870052311569452, + 0.0036789809819310904, + -0.020034056156873703, + 0.04162808507680893, + 0.03416291996836662, + -0.01805955357849598, + -0.000977828400209546, + -0.004798010922968388, + 0.010859864763915539, + -0.014778133481740952, + -0.00529101537540555, + -0.029868070036172867, + 0.021942060440778732, + -0.0013025213265791535, + 0.010480746626853943, + -0.047470662742853165, + -0.01585027389228344, + -0.04689106345176697, + 0.04397595673799515, + -0.028347989544272423, + -0.012565996497869492, + -0.005692906677722931, + 0.052168164402246475, + -0.018355369567871094, + 0.07390446960926056, + -0.01871008425951004, + 0.017274361103773117, + -0.011059156619012356, + -0.035504214465618134, + 0.049215517938137054, + -0.048129498958587646, + 0.06892205029726028, + -0.046266961842775345, + 0.02197258546948433, + -0.0020027458667755127, + -0.021148083731532097, + -0.006229306571185589, + -0.03165286406874657, + -0.08150651305913925, + 0.01601426675915718, + 0.04902094230055809, + -0.02794867940247059, + 0.05690855532884598, + 0.018739905208349228, + 0.029227394610643387, + 0.006465272046625614, + -0.020602518692612648, + -0.05716253072023392, + 0.05311451107263565, + -0.006407602224498987, + -0.0243686456233263, + 0.02566416934132576, + 0.008096356876194477, + -0.055141381919384, + -0.009396945126354694, + -0.0012241379590705037, + 0.013284377753734589, + -0.047882791608572006, + 0.030743718147277832, + 0.04883703216910362, + 0.066514752805233, + 0.0017948453314602375, + 0.0044357567094266415, + -0.01611628569662571, + -0.027637965977191925, + 0.033804140985012054, + 0.04977351799607277, + 0.006761862896382809, + -0.019579298794269562, + 0.019470933824777603, + 0.01719452254474163, + 0.03818729147315025, + 0.05320286005735397, + 0.014689194038510323, + -0.0018116346327587962, + -0.08101537078619003, + 0.0344974584877491, + 0.0003159473999403417, + 0.011623978614807129, + -0.06837049871683121, + -0.004467540420591831, + 0.030559740960597992, + -0.06766505539417267, + -0.03334945812821388, + -0.05410384759306908, + -0.025884341448545456, + -0.024469265714287758, + -0.024729641154408455, + -0.0005382020026445389, + -0.011704366654157639, + 0.023576386272907257, + -0.030916554853320122, + 0.010395214892923832, + -0.039300188422203064, + 0.024920444935560226, + -0.013096856884658337, + -0.028153318911790848, + 0.07416229695081711, + -0.0353594571352005, + 0.006645023822784424, + -0.0370262935757637, + -0.02939070202410221, + 0.017032137140631676, + -0.026637757197022438 + ] + } + } + ] + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedGeminiTest.json b/Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedGeminiTest.json new file mode 100644 index 00000000..c58b30f7 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedGeminiTest.json @@ -0,0 +1,2308 @@ +{ + "recordID": "GetModelTest.GetModelTunedGeminiTest", + "interactions": [ + { + "request": { + "method": "GET", + "url": "/v1beta/tunedModels/generate-num-8498", + "request": "GET /v1beta/tunedModels/generate-num-8498 HTTP/1.1", + "headers": { + "Test-Name": "GetModelTest.GetModelTunedGeminiTest" + }, + "bodySegments": [ + null + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "generativelanguage.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "7ac7d107ec9c461436c207eb915be15275f6a08d1697b4a199836b0ff54d36cb", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Wed, 19 Nov 2025 23:14:40 GMT", + "Server": "scaffolding on HTTPServer2", + "Server-Timing": "gfet4t7; dur=363", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "baseModel": "models/gemini-1.0-pro-001", + "createTime": "2024-10-08T17:37:34.572442Z", + "description": "My tuned gemini-1.0", + "displayName": "My tuned gemini-1.0", + "name": "tunedModels/generate-num-8498", + "state": "ACTIVE", + "temperature": 0.9, + "topK": 0, + "topP": 1, + "tuningTask": { + "completeTime": "2024-10-08T17:43:00.655489Z", + "hyperparameters": { + "batchSize": 4, + "epochCount": 100, + "learningRate": 0.001 + }, + "snapshots": [ + { + "computeTime": "2024-10-08T17:37:36.072445920Z", + "meanLoss": 12.668232, + "step": 1 + }, + { + "computeTime": "2024-10-08T17:37:36.882257245Z", + "meanLoss": 10.696646, + "step": 2 + }, + { + "computeTime": "2024-10-08T17:37:37.772298556Z", + "meanLoss": 11.886915, + "step": 3 + }, + { + "computeTime": "2024-10-08T17:37:38.645884009Z", + "epoch": 1, + "meanLoss": 10.8498, + "step": 4 + }, + { + "computeTime": "2024-10-08T17:37:39.467666523Z", + "epoch": 1, + "meanLoss": 12.209468, + "step": 5 + }, + { + "computeTime": "2024-10-08T17:37:40.331977916Z", + "epoch": 1, + "meanLoss": 8.550356, + "step": 6 + }, + { + "computeTime": "2024-10-08T17:37:41.106462145Z", + "epoch": 1, + "meanLoss": 5.8625765, + "step": 7 + }, + { + "computeTime": "2024-10-08T17:37:41.785468853Z", + "epoch": 2, + "meanLoss": 9.1942625, + "step": 8 + }, + { + "computeTime": "2024-10-08T17:37:42.553115854Z", + "epoch": 2, + "meanLoss": 5.0111547, + "step": 9 + }, + { + "computeTime": "2024-10-08T17:37:43.417678141Z", + "epoch": 2, + "meanLoss": 8.292959, + "step": 10 + }, + { + "computeTime": "2024-10-08T17:37:44.207643743Z", + "epoch": 2, + "meanLoss": 4.0712137, + "step": 11 + }, + { + "computeTime": "2024-10-08T17:37:45.051583530Z", + "epoch": 3, + "meanLoss": 3.0429158, + "step": 12 + }, + { + "computeTime": "2024-10-08T17:37:45.930800758Z", + "epoch": 3, + "meanLoss": 2.2044506, + "step": 13 + }, + { + "computeTime": "2024-10-08T17:37:46.768412040Z", + "epoch": 3, + "meanLoss": 1.6234471, + "step": 14 + }, + { + "computeTime": "2024-10-08T17:37:47.627814002Z", + "epoch": 4, + "meanLoss": 0.43513942, + "step": 15 + }, + { + "computeTime": "2024-10-08T17:37:48.396110335Z", + "epoch": 4, + "meanLoss": 0.6458631, + "step": 16 + }, + { + "computeTime": "2024-10-08T17:37:49.299269278Z", + "epoch": 4, + "meanLoss": 0.5415146, + "step": 17 + }, + { + "computeTime": "2024-10-08T17:37:49.981766055Z", + "epoch": 4, + "meanLoss": 1.1775417, + "step": 18 + }, + { + "computeTime": "2024-10-08T17:37:50.935517146Z", + "epoch": 5, + "meanLoss": 0.7849057, + "step": 19 + }, + { + "computeTime": "2024-10-08T17:37:51.866942638Z", + "epoch": 5, + "meanLoss": 0.15484557, + "step": 20 + }, + { + "computeTime": "2024-10-08T17:37:52.645858185Z", + "epoch": 5, + "meanLoss": 0.15443908, + "step": 21 + }, + { + "computeTime": "2024-10-08T17:37:55.050978443Z", + "epoch": 5, + "meanLoss": 0.009175723, + "step": 22 + }, + { + "computeTime": "2024-10-08T17:37:55.798403917Z", + "epoch": 6, + "meanLoss": 0.19410582, + "step": 23 + }, + { + "computeTime": "2024-10-08T17:37:56.540487793Z", + "epoch": 6, + "meanLoss": 0.021979569, + "step": 24 + }, + { + "computeTime": "2024-10-08T17:37:57.218147171Z", + "epoch": 6, + "meanLoss": 0.05858153, + "step": 25 + }, + { + "computeTime": "2024-10-08T17:37:57.966580218Z", + "epoch": 6, + "meanLoss": 0.0014770621, + "step": 26 + }, + { + "computeTime": "2024-10-08T17:37:58.633358520Z", + "epoch": 7, + "meanLoss": 0.0081911525, + "step": 27 + }, + { + "computeTime": "2024-10-08T17:37:59.401183316Z", + "epoch": 7, + "meanLoss": 0.008381691, + "step": 28 + }, + { + "computeTime": "2024-10-08T17:38:00.088304584Z", + "epoch": 7, + "meanLoss": 0.0024064828, + "step": 29 + }, + { + "computeTime": "2024-10-08T17:38:01.119295583Z", + "epoch": 8, + "meanLoss": 0.007589986, + "step": 30 + }, + { + "computeTime": "2024-10-08T17:38:02.064990437Z", + "epoch": 8, + "meanLoss": 0.0020501532, + "step": 31 + }, + { + "computeTime": "2024-10-08T17:38:02.894601740Z", + "epoch": 8, + "meanLoss": 0.003221727, + "step": 32 + }, + { + "computeTime": "2024-10-08T17:38:03.761565447Z", + "epoch": 8, + "meanLoss": 0.001016869, + "step": 33 + }, + { + "computeTime": "2024-10-08T17:38:04.653837592Z", + "epoch": 9, + "meanLoss": 0.0010674843, + "step": 34 + }, + { + "computeTime": "2024-10-08T17:38:05.374973133Z", + "epoch": 9, + "meanLoss": 0.0008130369, + "step": 35 + }, + { + "computeTime": "2024-10-08T17:38:06.237867741Z", + "epoch": 9, + "meanLoss": 0.00006294786, + "step": 36 + }, + { + "computeTime": "2024-10-08T17:38:07.065619261Z", + "epoch": 9, + "meanLoss": 0.001419805, + "step": 37 + }, + { + "computeTime": "2024-10-08T17:38:07.850005834Z", + "epoch": 10, + "meanLoss": 0.00056862226, + "step": 38 + }, + { + "computeTime": "2024-10-08T17:38:08.766101275Z", + "epoch": 10, + "meanLoss": 0.0007576209, + "step": 39 + }, + { + "computeTime": "2024-10-08T17:38:11.054763676Z", + "epoch": 10, + "meanLoss": 0.00047469581, + "step": 40 + }, + { + "computeTime": "2024-10-08T17:38:11.983893044Z", + "epoch": 10, + "meanLoss": 0.00007652119, + "step": 41 + }, + { + "computeTime": "2024-10-08T17:38:12.913139302Z", + "epoch": 11, + "meanLoss": 0.000053808093, + "step": 42 + }, + { + "computeTime": "2024-10-08T17:38:13.847979442Z", + "epoch": 11, + "meanLoss": 0.0001196831, + "step": 43 + }, + { + "computeTime": "2024-10-08T17:38:14.726021989Z", + "epoch": 11, + "meanLoss": 0.00013844273, + "step": 44 + }, + { + "computeTime": "2024-10-08T17:38:15.469183330Z", + "epoch": 12, + "meanLoss": 0.0003049206, + "step": 45 + }, + { + "computeTime": "2024-10-08T17:38:16.232621002Z", + "epoch": 12, + "meanLoss": 0.00007255026, + "step": 46 + }, + { + "computeTime": "2024-10-08T17:38:17.142074922Z", + "epoch": 12, + "meanLoss": 0.00023959973, + "step": 47 + }, + { + "computeTime": "2024-10-08T17:38:18.071021622Z", + "epoch": 12, + "meanLoss": 0.00010568218, + "step": 48 + }, + { + "computeTime": "2024-10-08T17:38:18.785214020Z", + "epoch": 13, + "meanLoss": 0.000020638108, + "step": 49 + }, + { + "computeTime": "2024-10-08T17:38:19.559160479Z", + "epoch": 13, + "meanLoss": 0.0000081158105, + "step": 50 + }, + { + "computeTime": "2024-10-08T17:38:20.433601409Z", + "epoch": 13, + "meanLoss": 0.00016398309, + "step": 51 + }, + { + "computeTime": "2024-10-08T17:38:21.165001783Z", + "epoch": 13, + "meanLoss": 0.00012057803, + "step": 52 + }, + { + "computeTime": "2024-10-08T17:38:22.111252360Z", + "epoch": 14, + "meanLoss": 0.000010221731, + "step": 53 + }, + { + "computeTime": "2024-10-08T17:38:22.887478694Z", + "epoch": 14, + "meanLoss": 0.00012769084, + "step": 54 + }, + { + "computeTime": "2024-10-08T17:38:23.642570356Z", + "epoch": 14, + "meanLoss": 0.000024748777, + "step": 55 + }, + { + "computeTime": "2024-10-08T17:38:24.566346488Z", + "epoch": 14, + "meanLoss": 0.00007697614, + "step": 56 + }, + { + "computeTime": "2024-10-08T17:38:25.475981101Z", + "epoch": 15, + "meanLoss": 0.00010589976, + "step": 57 + }, + { + "computeTime": "2024-10-08T17:38:26.366134579Z", + "epoch": 15, + "meanLoss": 0.000008934876, + "step": 58 + }, + { + "computeTime": "2024-10-08T17:38:27.082002818Z", + "epoch": 15, + "meanLoss": 0.00006510031, + "step": 59 + }, + { + "computeTime": "2024-10-08T17:38:27.806722830Z", + "epoch": 16, + "meanLoss": 0.000036248937, + "step": 60 + }, + { + "computeTime": "2024-10-08T17:38:28.738835306Z", + "epoch": 16, + "meanLoss": 0.00009052991, + "step": 61 + }, + { + "computeTime": "2024-10-08T17:38:29.487661780Z", + "epoch": 16, + "meanLoss": 0.00003062744, + "step": 62 + }, + { + "computeTime": "2024-10-08T17:38:30.421035224Z", + "epoch": 16, + "meanLoss": 0.000022491207, + "step": 63 + }, + { + "computeTime": "2024-10-08T17:38:31.198569092Z", + "epoch": 17, + "meanLoss": 0.000030585914, + "step": 64 + }, + { + "computeTime": "2024-10-08T17:38:31.897419048Z", + "epoch": 17, + "meanLoss": 0.000030769268, + "step": 65 + }, + { + "computeTime": "2024-10-08T17:38:32.749949450Z", + "epoch": 17, + "meanLoss": 0.000052261166, + "step": 66 + }, + { + "computeTime": "2024-10-08T17:38:33.503249492Z", + "epoch": 17, + "meanLoss": 0.000089821406, + "step": 67 + }, + { + "computeTime": "2024-10-08T17:38:34.451110490Z", + "epoch": 18, + "meanLoss": 0.00002678216, + "step": 68 + }, + { + "computeTime": "2024-10-08T17:38:35.308011190Z", + "epoch": 18, + "meanLoss": 0.000009709271, + "step": 69 + }, + { + "computeTime": "2024-10-08T17:38:36.669419683Z", + "epoch": 18, + "meanLoss": 0.000031680567, + "step": 70 + }, + { + "computeTime": "2024-10-08T17:38:37.559391123Z", + "epoch": 18, + "meanLoss": 0.000016135513, + "step": 71 + }, + { + "computeTime": "2024-10-08T17:38:38.442919050Z", + "epoch": 19, + "meanLoss": 0.0000926801, + "step": 72 + }, + { + "computeTime": "2024-10-08T17:38:39.281790396Z", + "epoch": 19, + "meanLoss": 0.000005536007, + "step": 73 + }, + { + "computeTime": "2024-10-08T17:38:40.135653490Z", + "epoch": 19, + "meanLoss": 0.00005845639, + "step": 74 + }, + { + "computeTime": "2024-10-08T17:38:40.985578112Z", + "epoch": 20, + "meanLoss": 0.000025764923, + "step": 75 + }, + { + "computeTime": "2024-10-08T17:38:41.660226852Z", + "epoch": 20, + "meanLoss": 0.000042716973, + "step": 76 + }, + { + "computeTime": "2024-10-08T17:38:42.419551957Z", + "epoch": 20, + "meanLoss": 0.00007727187, + "step": 77 + }, + { + "computeTime": "2024-10-08T17:38:43.352283449Z", + "epoch": 20, + "meanLoss": 0.0000015788246, + "step": 78 + }, + { + "computeTime": "2024-10-08T17:38:44.225798040Z", + "epoch": 21, + "meanLoss": 0.000012106728, + "step": 79 + }, + { + "computeTime": "2024-10-08T17:38:45.079687198Z", + "epoch": 21, + "meanLoss": 0.000039538274, + "step": 80 + }, + { + "computeTime": "2024-10-08T17:38:45.914487176Z", + "epoch": 21, + "meanLoss": 0.0000059455633, + "step": 81 + }, + { + "computeTime": "2024-10-08T17:38:46.792629112Z", + "epoch": 21, + "meanLoss": 0.0000749178, + "step": 82 + }, + { + "computeTime": "2024-10-08T17:38:47.807362983Z", + "epoch": 22, + "meanLoss": 0.00006603543, + "step": 83 + }, + { + "computeTime": "2024-10-08T17:38:48.754567683Z", + "epoch": 22, + "meanLoss": 0.00001538964, + "step": 84 + }, + { + "computeTime": "2024-10-08T17:38:49.606776254Z", + "epoch": 22, + "meanLoss": 0.000012471457, + "step": 85 + }, + { + "computeTime": "2024-10-08T17:38:50.339917712Z", + "epoch": 22, + "meanLoss": 0.000018140534, + "step": 86 + }, + { + "computeTime": "2024-10-08T17:38:51.226167835Z", + "epoch": 23, + "meanLoss": 0.00007141521, + "step": 87 + }, + { + "computeTime": "2024-10-08T17:38:51.987250704Z", + "epoch": 23, + "meanLoss": 0.0000068302033, + "step": 88 + }, + { + "computeTime": "2024-10-08T17:38:52.688778907Z", + "epoch": 23, + "meanLoss": 0.000003338093, + "step": 89 + }, + { + "computeTime": "2024-10-08T17:38:53.563888651Z", + "epoch": 24, + "meanLoss": 0.00004176516, + "step": 90 + }, + { + "computeTime": "2024-10-08T17:38:54.236836831Z", + "epoch": 24, + "meanLoss": 0.000007340493, + "step": 91 + }, + { + "computeTime": "2024-10-08T17:38:55.019535973Z", + "epoch": 24, + "meanLoss": 0.00003216043, + "step": 92 + }, + { + "computeTime": "2024-10-08T17:38:55.691676919Z", + "epoch": 24, + "meanLoss": 0.00008927053, + "step": 93 + }, + { + "computeTime": "2024-10-08T17:38:56.363173675Z", + "epoch": 25, + "meanLoss": 0.000016826321, + "step": 94 + }, + { + "computeTime": "2024-10-08T17:38:57.298784082Z", + "epoch": 25, + "meanLoss": 0.00002305163, + "step": 95 + }, + { + "computeTime": "2024-10-08T17:38:58.225210125Z", + "epoch": 25, + "meanLoss": 0.00006197253, + "step": 96 + }, + { + "computeTime": "2024-10-08T17:38:59.033185257Z", + "epoch": 25, + "meanLoss": 0.000025796704, + "step": 97 + }, + { + "computeTime": "2024-10-08T17:38:59.890141664Z", + "epoch": 26, + "meanLoss": 0.000009108218, + "step": 98 + }, + { + "computeTime": "2024-10-08T17:39:00.768005921Z", + "epoch": 26, + "meanLoss": 0.000011113705, + "step": 99 + }, + { + "computeTime": "2024-10-08T17:39:01.611132964Z", + "epoch": 26, + "meanLoss": 0.0000054556485, + "step": 100 + }, + { + "computeTime": "2024-10-08T17:39:02.453321904Z", + "epoch": 26, + "meanLoss": 0.00008064369, + "step": 101 + }, + { + "computeTime": "2024-10-08T17:39:03.393911700Z", + "epoch": 27, + "meanLoss": 0.000016423874, + "step": 102 + }, + { + "computeTime": "2024-10-08T17:39:04.249695847Z", + "epoch": 27, + "meanLoss": 0.000024303328, + "step": 103 + }, + { + "computeTime": "2024-10-08T17:39:05.075858532Z", + "epoch": 27, + "meanLoss": 0.000056035817, + "step": 104 + }, + { + "computeTime": "2024-10-08T17:39:05.852979086Z", + "epoch": 28, + "meanLoss": 0.000027906848, + "step": 105 + }, + { + "computeTime": "2024-10-08T17:39:06.778067503Z", + "epoch": 28, + "meanLoss": 0.000023704488, + "step": 106 + }, + { + "computeTime": "2024-10-08T17:39:07.632863454Z", + "epoch": 28, + "meanLoss": 0.000055722427, + "step": 107 + }, + { + "computeTime": "2024-10-08T17:39:08.516290010Z", + "epoch": 28, + "meanLoss": 0.00001547567, + "step": 108 + }, + { + "computeTime": "2024-10-08T17:39:09.197713371Z", + "epoch": 29, + "meanLoss": 0.000020633684, + "step": 109 + }, + { + "computeTime": "2024-10-08T17:39:10.113908998Z", + "epoch": 29, + "meanLoss": 0.000024841782, + "step": 110 + }, + { + "computeTime": "2024-10-08T17:39:11.008294150Z", + "epoch": 29, + "meanLoss": 0.00005319307, + "step": 111 + }, + { + "computeTime": "2024-10-08T17:39:11.666803723Z", + "epoch": 29, + "meanLoss": 0.000012825709, + "step": 112 + }, + { + "computeTime": "2024-10-08T17:39:12.524237494Z", + "epoch": 30, + "meanLoss": 0.00007236423, + "step": 113 + }, + { + "computeTime": "2024-10-08T17:39:13.409718745Z", + "epoch": 30, + "meanLoss": 0.000017317943, + "step": 114 + }, + { + "computeTime": "2024-10-08T17:39:14.289730999Z", + "epoch": 30, + "meanLoss": 0.0000060837447, + "step": 115 + }, + { + "computeTime": "2024-10-08T17:39:15.152362789Z", + "epoch": 30, + "meanLoss": 0.000034483306, + "step": 116 + }, + { + "computeTime": "2024-10-08T17:39:16.016402817Z", + "epoch": 31, + "meanLoss": 0.000051615294, + "step": 117 + }, + { + "computeTime": "2024-10-08T17:39:16.912261490Z", + "epoch": 31, + "meanLoss": 0.000016924227, + "step": 118 + }, + { + "computeTime": "2024-10-08T17:39:17.613971509Z", + "epoch": 31, + "meanLoss": 0.0000071062204, + "step": 119 + }, + { + "computeTime": "2024-10-08T17:39:18.416641901Z", + "epoch": 32, + "meanLoss": 0.000029719435, + "step": 120 + }, + { + "computeTime": "2024-10-08T17:39:19.357107694Z", + "epoch": 32, + "meanLoss": 0.000024545938, + "step": 121 + }, + { + "computeTime": "2024-10-08T17:39:20.051275115Z", + "epoch": 32, + "meanLoss": 0.000046711946, + "step": 122 + }, + { + "computeTime": "2024-10-08T17:39:20.999481693Z", + "epoch": 32, + "meanLoss": 0.000016636684, + "step": 123 + }, + { + "computeTime": "2024-10-08T17:39:21.764591719Z", + "epoch": 33, + "meanLoss": 0.0000146697275, + "step": 124 + }, + { + "computeTime": "2024-10-08T17:39:22.514676707Z", + "epoch": 33, + "meanLoss": 0.00001737848, + "step": 125 + }, + { + "computeTime": "2024-10-08T17:39:23.363279685Z", + "epoch": 33, + "meanLoss": 0.000016596168, + "step": 126 + }, + { + "computeTime": "2024-10-08T17:39:24.142693611Z", + "epoch": 33, + "meanLoss": 0.000013278375, + "step": 127 + }, + { + "computeTime": "2024-10-08T17:39:24.851193860Z", + "epoch": 34, + "meanLoss": 0.000042474363, + "step": 128 + }, + { + "computeTime": "2024-10-08T17:39:25.601853854Z", + "epoch": 34, + "meanLoss": 0.000031460542, + "step": 129 + }, + { + "computeTime": "2024-10-08T17:39:26.527303605Z", + "epoch": 34, + "meanLoss": 0.0000132646455, + "step": 130 + }, + { + "computeTime": "2024-10-08T17:39:27.272044145Z", + "epoch": 34, + "meanLoss": 0.000059770187, + "step": 131 + }, + { + "computeTime": "2024-10-08T17:39:28.186842594Z", + "epoch": 35, + "meanLoss": 0.00005959766, + "step": 132 + }, + { + "computeTime": "2024-10-08T17:39:28.915598081Z", + "epoch": 35, + "meanLoss": 0.0000041270396, + "step": 133 + }, + { + "computeTime": "2024-10-08T17:39:29.752008509Z", + "epoch": 35, + "meanLoss": 0.000019695843, + "step": 134 + }, + { + "computeTime": "2024-10-08T17:39:30.610833607Z", + "epoch": 36, + "meanLoss": 0.000016507227, + "step": 135 + }, + { + "computeTime": "2024-10-08T17:39:31.545694511Z", + "epoch": 36, + "meanLoss": 0.000049622176, + "step": 136 + }, + { + "computeTime": "2024-10-08T17:39:32.426648106Z", + "epoch": 36, + "meanLoss": 0.0000091362745, + "step": 137 + }, + { + "computeTime": "2024-10-08T17:39:33.479295992Z", + "epoch": 36, + "meanLoss": 0.000025459565, + "step": 138 + }, + { + "computeTime": "2024-10-08T17:39:34.187996048Z", + "epoch": 37, + "meanLoss": 0.000051791547, + "step": 139 + }, + { + "computeTime": "2024-10-08T17:39:35.015973838Z", + "epoch": 37, + "meanLoss": 0.000011348631, + "step": 140 + }, + { + "computeTime": "2024-10-08T17:39:35.742445738Z", + "epoch": 37, + "meanLoss": 0.0000092778355, + "step": 141 + }, + { + "computeTime": "2024-10-08T17:39:37.673545877Z", + "epoch": 37, + "meanLoss": 0.000029121991, + "step": 142 + }, + { + "computeTime": "2024-10-08T17:39:38.379069776Z", + "epoch": 38, + "meanLoss": 0.00001170754, + "step": 143 + }, + { + "computeTime": "2024-10-08T17:39:39.152094982Z", + "epoch": 38, + "meanLoss": 0.0000532486, + "step": 144 + }, + { + "computeTime": "2024-10-08T17:39:39.861242862Z", + "epoch": 38, + "meanLoss": 0.0000152922, + "step": 145 + }, + { + "computeTime": "2024-10-08T17:39:40.792168202Z", + "epoch": 38, + "meanLoss": 0.000012747245, + "step": 146 + }, + { + "computeTime": "2024-10-08T17:39:41.697163985Z", + "epoch": 39, + "meanLoss": 0.000018112085, + "step": 147 + }, + { + "computeTime": "2024-10-08T17:39:42.549994040Z", + "epoch": 39, + "meanLoss": 0.000025884132, + "step": 148 + }, + { + "computeTime": "2024-10-08T17:39:43.541199811Z", + "epoch": 39, + "meanLoss": 0.000005745096, + "step": 149 + }, + { + "computeTime": "2024-10-08T17:39:44.378384665Z", + "epoch": 40, + "meanLoss": 0.00004339754, + "step": 150 + }, + { + "computeTime": "2024-10-08T17:39:45.217310269Z", + "epoch": 40, + "meanLoss": 0.000052993302, + "step": 151 + }, + { + "computeTime": "2024-10-08T17:39:46.068952254Z", + "epoch": 40, + "meanLoss": 0.000021308722, + "step": 152 + }, + { + "computeTime": "2024-10-08T17:39:47.008470358Z", + "epoch": 40, + "meanLoss": 0.0000066419598, + "step": 153 + }, + { + "computeTime": "2024-10-08T17:39:47.765587703Z", + "epoch": 41, + "meanLoss": 0.000001860084, + "step": 154 + }, + { + "computeTime": "2024-10-08T17:39:48.690181664Z", + "epoch": 41, + "meanLoss": 0.000014289166, + "step": 155 + }, + { + "computeTime": "2024-10-08T17:39:49.514832023Z", + "epoch": 41, + "meanLoss": 0.000052366755, + "step": 156 + }, + { + "computeTime": "2024-10-08T17:39:50.271614893Z", + "epoch": 41, + "meanLoss": 0.000002193614, + "step": 157 + }, + { + "computeTime": "2024-10-08T17:39:51.037086084Z", + "epoch": 42, + "meanLoss": 0.000051544514, + "step": 158 + }, + { + "computeTime": "2024-10-08T17:39:51.933797880Z", + "epoch": 42, + "meanLoss": 0.000021184795, + "step": 159 + }, + { + "computeTime": "2024-10-08T17:39:52.703949004Z", + "epoch": 42, + "meanLoss": 0.0000074247364, + "step": 160 + }, + { + "computeTime": "2024-10-08T17:39:53.720932410Z", + "epoch": 42, + "meanLoss": 0.00000949949, + "step": 161 + }, + { + "computeTime": "2024-10-08T17:39:54.454947830Z", + "epoch": 43, + "meanLoss": 0.000015500002, + "step": 162 + }, + { + "computeTime": "2024-10-08T17:39:55.191918704Z", + "epoch": 43, + "meanLoss": 0.000005604932, + "step": 163 + }, + { + "computeTime": "2024-10-08T17:39:56.123845350Z", + "epoch": 43, + "meanLoss": 0.00004998245, + "step": 164 + }, + { + "computeTime": "2024-10-08T17:39:56.837831882Z", + "epoch": 44, + "meanLoss": 0.000010597054, + "step": 165 + }, + { + "computeTime": "2024-10-08T17:39:57.664311250Z", + "epoch": 44, + "meanLoss": 0.0000023294706, + "step": 166 + }, + { + "computeTime": "2024-10-08T17:39:58.764991946Z", + "epoch": 44, + "meanLoss": 0.000033228658, + "step": 167 + }, + { + "computeTime": "2024-10-08T17:39:59.596894732Z", + "epoch": 44, + "meanLoss": 0.00005028397, + "step": 168 + }, + { + "computeTime": "2024-10-08T17:40:00.515713666Z", + "epoch": 45, + "meanLoss": 0.0000052666173, + "step": 169 + }, + { + "computeTime": "2024-10-08T17:40:01.378194257Z", + "epoch": 45, + "meanLoss": 0.000011793338, + "step": 170 + }, + { + "computeTime": "2024-10-08T17:40:02.298968665Z", + "epoch": 45, + "meanLoss": 0.000016496284, + "step": 171 + }, + { + "computeTime": "2024-10-08T17:40:03.107669177Z", + "epoch": 45, + "meanLoss": 0.000047122947, + "step": 172 + }, + { + "computeTime": "2024-10-08T17:40:03.910921909Z", + "epoch": 46, + "meanLoss": 0.000021817163, + "step": 173 + }, + { + "computeTime": "2024-10-08T17:40:04.712354244Z", + "epoch": 46, + "meanLoss": 0.00006535463, + "step": 174 + }, + { + "computeTime": "2024-10-08T17:40:05.645224777Z", + "epoch": 46, + "meanLoss": 0.000011272728, + "step": 175 + }, + { + "computeTime": "2024-10-08T17:40:06.376158301Z", + "epoch": 46, + "meanLoss": 0.000006472921, + "step": 176 + }, + { + "computeTime": "2024-10-08T17:40:07.238112277Z", + "epoch": 47, + "meanLoss": 0.0000049846676, + "step": 177 + }, + { + "computeTime": "2024-10-08T17:40:08.329112961Z", + "epoch": 47, + "meanLoss": 0.0000053760596, + "step": 178 + }, + { + "computeTime": "2024-10-08T17:40:09.102621490Z", + "epoch": 47, + "meanLoss": 0.000010231044, + "step": 179 + }, + { + "computeTime": "2024-10-08T17:40:09.895721970Z", + "epoch": 48, + "meanLoss": 0.000061140374, + "step": 180 + }, + { + "computeTime": "2024-10-08T17:40:10.733005100Z", + "epoch": 48, + "meanLoss": 0.000011222236, + "step": 181 + }, + { + "computeTime": "2024-10-08T17:40:11.675265429Z", + "epoch": 48, + "meanLoss": 0.000043811277, + "step": 182 + }, + { + "computeTime": "2024-10-08T17:40:12.515295342Z", + "epoch": 48, + "meanLoss": 0.000018196646, + "step": 183 + }, + { + "computeTime": "2024-10-08T17:40:13.342684605Z", + "epoch": 49, + "meanLoss": 0.0000138916075, + "step": 184 + }, + { + "computeTime": "2024-10-08T17:40:14.183202808Z", + "epoch": 49, + "meanLoss": 0.00004231045, + "step": 185 + }, + { + "computeTime": "2024-10-08T17:40:14.924681676Z", + "epoch": 49, + "meanLoss": 0.000011763303, + "step": 186 + }, + { + "computeTime": "2024-10-08T17:40:15.771344055Z", + "epoch": 49, + "meanLoss": 0.000007604831, + "step": 187 + }, + { + "computeTime": "2024-10-08T17:40:16.457266446Z", + "epoch": 50, + "meanLoss": 0.000023080926, + "step": 188 + }, + { + "computeTime": "2024-10-08T17:40:17.320314474Z", + "epoch": 50, + "meanLoss": 0.00004527322, + "step": 189 + }, + { + "computeTime": "2024-10-08T17:40:18.038347414Z", + "epoch": 50, + "meanLoss": 0.0000034695258, + "step": 190 + }, + { + "computeTime": "2024-10-08T17:40:18.899611323Z", + "epoch": 50, + "meanLoss": 0.000016948034, + "step": 191 + }, + { + "computeTime": "2024-10-08T17:40:19.657442572Z", + "epoch": 51, + "meanLoss": 0.0000021196902, + "step": 192 + }, + { + "computeTime": "2024-10-08T17:40:20.546908284Z", + "epoch": 51, + "meanLoss": 0.00005085529, + "step": 193 + }, + { + "computeTime": "2024-10-08T17:40:21.389905808Z", + "epoch": 51, + "meanLoss": 0.00002382067, + "step": 194 + }, + { + "computeTime": "2024-10-08T17:40:22.228772819Z", + "epoch": 52, + "meanLoss": 0.000017785696, + "step": 195 + }, + { + "computeTime": "2024-10-08T17:40:23.053380171Z", + "epoch": 52, + "meanLoss": 0.00006731693, + "step": 196 + }, + { + "computeTime": "2024-10-08T17:40:23.901473968Z", + "epoch": 52, + "meanLoss": 0.00000905036, + "step": 197 + }, + { + "computeTime": "2024-10-08T17:40:24.759659236Z", + "epoch": 52, + "meanLoss": 0.00000852126, + "step": 198 + }, + { + "computeTime": "2024-10-08T17:40:25.501437525Z", + "epoch": 53, + "meanLoss": 0.000017381972, + "step": 199 + }, + { + "computeTime": "2024-10-08T17:40:26.504997557Z", + "epoch": 53, + "meanLoss": 0.000008223578, + "step": 200 + }, + { + "computeTime": "2024-10-08T17:40:27.353209855Z", + "epoch": 53, + "meanLoss": 0.000011609867, + "step": 201 + }, + { + "computeTime": "2024-10-08T17:40:28.296326362Z", + "epoch": 53, + "meanLoss": 0.000010239426, + "step": 202 + }, + { + "computeTime": "2024-10-08T17:40:29.181585846Z", + "epoch": 54, + "meanLoss": 0.000045160064, + "step": 203 + }, + { + "computeTime": "2024-10-08T17:40:30.113610280Z", + "epoch": 54, + "meanLoss": 0.000011172844, + "step": 204 + }, + { + "computeTime": "2024-10-08T17:40:30.834785873Z", + "epoch": 54, + "meanLoss": 0.000011081342, + "step": 205 + }, + { + "computeTime": "2024-10-08T17:40:31.695057107Z", + "epoch": 54, + "meanLoss": 0.000057451893, + "step": 206 + }, + { + "computeTime": "2024-10-08T17:40:32.518104210Z", + "epoch": 55, + "meanLoss": 0.000041403342, + "step": 207 + }, + { + "computeTime": "2024-10-08T17:40:33.362812022Z", + "epoch": 55, + "meanLoss": 0.000013636654, + "step": 208 + }, + { + "computeTime": "2024-10-08T17:40:34.106086589Z", + "epoch": 55, + "meanLoss": 0.0000037915306, + "step": 209 + }, + { + "computeTime": "2024-10-08T17:40:34.957944379Z", + "epoch": 56, + "meanLoss": 0.000012258533, + "step": 210 + }, + { + "computeTime": "2024-10-08T17:40:35.754075070Z", + "epoch": 56, + "meanLoss": 0.00001578359, + "step": 211 + }, + { + "computeTime": "2024-10-08T17:40:38.261594981Z", + "epoch": 56, + "meanLoss": 0.000014980324, + "step": 212 + }, + { + "computeTime": "2024-10-08T17:40:39.125811886Z", + "epoch": 56, + "meanLoss": 0.000040033596, + "step": 213 + }, + { + "computeTime": "2024-10-08T17:40:40.082321923Z", + "epoch": 57, + "meanLoss": 0.0000089146, + "step": 214 + }, + { + "computeTime": "2024-10-08T17:40:41.108892860Z", + "epoch": 57, + "meanLoss": 0.0000071961267, + "step": 215 + }, + { + "computeTime": "2024-10-08T17:40:42.042967945Z", + "epoch": 57, + "meanLoss": 0.00004207576, + "step": 216 + }, + { + "computeTime": "2024-10-08T17:40:42.928115652Z", + "epoch": 57, + "meanLoss": 0.000022104941, + "step": 217 + }, + { + "computeTime": "2024-10-08T17:40:43.672676010Z", + "epoch": 58, + "meanLoss": 0.0000027231872, + "step": 218 + }, + { + "computeTime": "2024-10-08T17:40:44.496017217Z", + "epoch": 58, + "meanLoss": 0.0000064434716, + "step": 219 + }, + { + "computeTime": "2024-10-08T17:40:45.465695207Z", + "epoch": 58, + "meanLoss": 0.00003568953, + "step": 220 + }, + { + "computeTime": "2024-10-08T17:40:46.399344538Z", + "epoch": 58, + "meanLoss": 0.000014616642, + "step": 221 + }, + { + "computeTime": "2024-10-08T17:40:47.321993003Z", + "epoch": 59, + "meanLoss": 0.0000063756015, + "step": 222 + }, + { + "computeTime": "2024-10-08T17:40:48.061109599Z", + "epoch": 59, + "meanLoss": 0.000008551404, + "step": 223 + }, + { + "computeTime": "2024-10-08T17:40:48.985188337Z", + "epoch": 59, + "meanLoss": 0.000016745678, + "step": 224 + }, + { + "computeTime": "2024-10-08T17:40:49.731715286Z", + "epoch": 60, + "meanLoss": 0.000039205654, + "step": 225 + }, + { + "computeTime": "2024-10-08T17:40:50.652881408Z", + "epoch": 60, + "meanLoss": 0.0000023188768, + "step": 226 + }, + { + "computeTime": "2024-10-08T17:40:51.480775156Z", + "epoch": 60, + "meanLoss": 0.000035569537, + "step": 227 + }, + { + "computeTime": "2024-10-08T17:40:52.380815972Z", + "epoch": 60, + "meanLoss": 0.000019384432, + "step": 228 + }, + { + "computeTime": "2024-10-08T17:40:53.238117755Z", + "epoch": 61, + "meanLoss": 0.000006313203, + "step": 229 + }, + { + "computeTime": "2024-10-08T17:40:54.089490026Z", + "epoch": 61, + "meanLoss": 0.000010266325, + "step": 230 + }, + { + "computeTime": "2024-10-08T17:40:54.921277336Z", + "epoch": 61, + "meanLoss": 0.000015260535, + "step": 231 + }, + { + "computeTime": "2024-10-08T17:40:55.779087861Z", + "epoch": 61, + "meanLoss": 0.00005511893, + "step": 232 + }, + { + "computeTime": "2024-10-08T17:40:56.457435458Z", + "epoch": 62, + "meanLoss": 0.0000030512456, + "step": 233 + }, + { + "computeTime": "2024-10-08T17:40:57.182601595Z", + "epoch": 62, + "meanLoss": 0.000047784066, + "step": 234 + }, + { + "computeTime": "2024-10-08T17:40:57.920685786Z", + "epoch": 62, + "meanLoss": 0.000010844789, + "step": 235 + }, + { + "computeTime": "2024-10-08T17:40:58.807097644Z", + "epoch": 62, + "meanLoss": 0.00001064688, + "step": 236 + }, + { + "computeTime": "2024-10-08T17:40:59.575375002Z", + "epoch": 63, + "meanLoss": 0.000010397751, + "step": 237 + }, + { + "computeTime": "2024-10-08T17:41:00.455870631Z", + "epoch": 63, + "meanLoss": 0.000015217811, + "step": 238 + }, + { + "computeTime": "2024-10-08T17:41:01.314416600Z", + "epoch": 63, + "meanLoss": 0.000005250913, + "step": 239 + }, + { + "computeTime": "2024-10-08T17:41:02.154100939Z", + "epoch": 64, + "meanLoss": 0.000049643568, + "step": 240 + }, + { + "computeTime": "2024-10-08T17:41:02.998739077Z", + "epoch": 64, + "meanLoss": 0.000010409703, + "step": 241 + }, + { + "computeTime": "2024-10-08T17:41:03.678708012Z", + "epoch": 64, + "meanLoss": 0.000014257617, + "step": 242 + }, + { + "computeTime": "2024-10-08T17:41:04.437614569Z", + "epoch": 64, + "meanLoss": 0.000007989354, + "step": 243 + }, + { + "computeTime": "2024-10-08T17:41:05.219203714Z", + "epoch": 65, + "meanLoss": 0.00003757933, + "step": 244 + }, + { + "computeTime": "2024-10-08T17:41:06.083225987Z", + "epoch": 65, + "meanLoss": 0.00004364364, + "step": 245 + }, + { + "computeTime": "2024-10-08T17:41:08.498146970Z", + "epoch": 65, + "meanLoss": 0.0000111124245, + "step": 246 + }, + { + "computeTime": "2024-10-08T17:41:09.324947354Z", + "epoch": 65, + "meanLoss": 0.00001606089, + "step": 247 + }, + { + "computeTime": "2024-10-08T17:41:10.236729055Z", + "epoch": 66, + "meanLoss": 0.0000046512578, + "step": 248 + }, + { + "computeTime": "2024-10-08T17:41:11.037799841Z", + "epoch": 66, + "meanLoss": 0.00003276343, + "step": 249 + }, + { + "computeTime": "2024-10-08T17:41:11.873926740Z", + "epoch": 66, + "meanLoss": 0.000015001395, + "step": 250 + }, + { + "computeTime": "2024-10-08T17:41:12.745838157Z", + "epoch": 66, + "meanLoss": 0.000014905818, + "step": 251 + }, + { + "computeTime": "2024-10-08T17:41:13.481571975Z", + "epoch": 67, + "meanLoss": 0.000007428229, + "step": 252 + }, + { + "computeTime": "2024-10-08T17:41:14.352636878Z", + "epoch": 67, + "meanLoss": 0.00005239481, + "step": 253 + }, + { + "computeTime": "2024-10-08T17:41:16.748446477Z", + "epoch": 67, + "meanLoss": 0.0000044805865, + "step": 254 + }, + { + "computeTime": "2024-10-08T17:41:17.831909898Z", + "epoch": 68, + "meanLoss": 0.00000924923, + "step": 255 + }, + { + "computeTime": "2024-10-08T17:41:18.753986139Z", + "epoch": 68, + "meanLoss": 0.0000049276277, + "step": 256 + }, + { + "computeTime": "2024-10-08T17:41:19.698695168Z", + "epoch": 68, + "meanLoss": 0.00002289412, + "step": 257 + }, + { + "computeTime": "2024-10-08T17:41:20.589359316Z", + "epoch": 68, + "meanLoss": 0.000007938589, + "step": 258 + }, + { + "computeTime": "2024-10-08T17:41:21.397796822Z", + "epoch": 69, + "meanLoss": 0.00003947923, + "step": 259 + }, + { + "computeTime": "2024-10-08T17:41:22.141684053Z", + "epoch": 69, + "meanLoss": 0.000012250996, + "step": 260 + }, + { + "computeTime": "2024-10-08T17:41:23.055715266Z", + "epoch": 69, + "meanLoss": 0.000008767025, + "step": 261 + }, + { + "computeTime": "2024-10-08T17:41:23.805382375Z", + "epoch": 69, + "meanLoss": 0.000035481295, + "step": 262 + }, + { + "computeTime": "2024-10-08T17:41:24.685618974Z", + "epoch": 70, + "meanLoss": 0.00000785396, + "step": 263 + }, + { + "computeTime": "2024-10-08T17:41:25.510729251Z", + "epoch": 70, + "meanLoss": 0.0000031836098, + "step": 264 + }, + { + "computeTime": "2024-10-08T17:41:26.361579893Z", + "epoch": 70, + "meanLoss": 0.000045795503, + "step": 265 + }, + { + "computeTime": "2024-10-08T17:41:27.198533530Z", + "epoch": 70, + "meanLoss": 0.000007276889, + "step": 266 + }, + { + "computeTime": "2024-10-08T17:41:28.034584646Z", + "epoch": 71, + "meanLoss": 0.000007869909, + "step": 267 + }, + { + "computeTime": "2024-10-08T17:41:28.894874405Z", + "epoch": 71, + "meanLoss": 0.000014096964, + "step": 268 + }, + { + "computeTime": "2024-10-08T17:41:29.780620915Z", + "epoch": 71, + "meanLoss": 0.000035650097, + "step": 269 + }, + { + "computeTime": "2024-10-08T17:41:30.750569055Z", + "epoch": 72, + "meanLoss": 0.000009381029, + "step": 270 + }, + { + "computeTime": "2024-10-08T17:41:31.562038970Z", + "epoch": 72, + "meanLoss": 0.000008806154, + "step": 271 + }, + { + "computeTime": "2024-10-08T17:41:32.524827143Z", + "epoch": 72, + "meanLoss": 0.000036582816, + "step": 272 + }, + { + "computeTime": "2024-10-08T17:41:33.397786934Z", + "epoch": 72, + "meanLoss": 0.000004988862, + "step": 273 + }, + { + "computeTime": "2024-10-08T17:41:34.303318861Z", + "epoch": 73, + "meanLoss": 0.0000048989955, + "step": 274 + }, + { + "computeTime": "2024-10-08T17:41:35.277007681Z", + "epoch": 73, + "meanLoss": 0.0000067234505, + "step": 275 + }, + { + "computeTime": "2024-10-08T17:41:36.115283863Z", + "epoch": 73, + "meanLoss": 0.000007978652, + "step": 276 + }, + { + "computeTime": "2024-10-08T17:41:38.525232571Z", + "epoch": 73, + "meanLoss": 0.000021777581, + "step": 277 + }, + { + "computeTime": "2024-10-08T17:41:39.329646225Z", + "epoch": 74, + "meanLoss": 0.00004708441, + "step": 278 + }, + { + "computeTime": "2024-10-08T17:41:40.266254760Z", + "epoch": 74, + "meanLoss": 0.000006921822, + "step": 279 + }, + { + "computeTime": "2024-10-08T17:41:41.013727882Z", + "epoch": 74, + "meanLoss": 0.000004032103, + "step": 280 + }, + { + "computeTime": "2024-10-08T17:41:41.721008037Z", + "epoch": 74, + "meanLoss": 0.000040391576, + "step": 281 + }, + { + "computeTime": "2024-10-08T17:41:42.791987709Z", + "epoch": 75, + "meanLoss": 0.0000060298516, + "step": 282 + }, + { + "computeTime": "2024-10-08T17:41:43.530089366Z", + "epoch": 75, + "meanLoss": 0.000054906122, + "step": 283 + }, + { + "computeTime": "2024-10-08T17:41:44.318480758Z", + "epoch": 75, + "meanLoss": 0.0000071194954, + "step": 284 + }, + { + "computeTime": "2024-10-08T17:41:45.220114171Z", + "epoch": 76, + "meanLoss": 0.000010173768, + "step": 285 + }, + { + "computeTime": "2024-10-08T17:41:45.971349519Z", + "epoch": 76, + "meanLoss": 0.0000058401743, + "step": 286 + }, + { + "computeTime": "2024-10-08T17:41:46.921883192Z", + "epoch": 76, + "meanLoss": 0.000032979995, + "step": 287 + }, + { + "computeTime": "2024-10-08T17:41:47.671813373Z", + "epoch": 76, + "meanLoss": 0.000009083957, + "step": 288 + }, + { + "computeTime": "2024-10-08T17:41:48.499348848Z", + "epoch": 77, + "meanLoss": 0.000009019626, + "step": 289 + }, + { + "computeTime": "2024-10-08T17:41:49.243258338Z", + "epoch": 77, + "meanLoss": 0.00003687595, + "step": 290 + }, + { + "computeTime": "2024-10-08T17:41:50.048901792Z", + "epoch": 77, + "meanLoss": 0.000010386342, + "step": 291 + }, + { + "computeTime": "2024-10-08T17:41:50.966049136Z", + "epoch": 77, + "meanLoss": 0.000006719021, + "step": 292 + }, + { + "computeTime": "2024-10-08T17:41:51.718109252Z", + "epoch": 78, + "meanLoss": 0.000015799887, + "step": 293 + }, + { + "computeTime": "2024-10-08T17:41:52.423370930Z", + "epoch": 78, + "meanLoss": 0.00004193676, + "step": 294 + }, + { + "computeTime": "2024-10-08T17:41:53.095452212Z", + "epoch": 78, + "meanLoss": 0.000007605646, + "step": 295 + }, + { + "computeTime": "2024-10-08T17:41:53.946529110Z", + "epoch": 78, + "meanLoss": 0.000007941737, + "step": 296 + }, + { + "computeTime": "2024-10-08T17:41:54.809779753Z", + "epoch": 79, + "meanLoss": 0.0000026591588, + "step": 297 + }, + { + "computeTime": "2024-10-08T17:41:55.636073690Z", + "epoch": 79, + "meanLoss": 0.000032824693, + "step": 298 + }, + { + "computeTime": "2024-10-08T17:41:56.478808973Z", + "epoch": 79, + "meanLoss": 0.000017697923, + "step": 299 + }, + { + "computeTime": "2024-10-08T17:41:57.401413600Z", + "epoch": 80, + "meanLoss": 0.000005688169, + "step": 300 + }, + { + "computeTime": "2024-10-08T17:41:58.105135459Z", + "epoch": 80, + "meanLoss": 0.00000640878, + "step": 301 + }, + { + "computeTime": "2024-10-08T17:41:58.965686395Z", + "epoch": 80, + "meanLoss": 0.00001405718, + "step": 302 + }, + { + "computeTime": "2024-10-08T17:41:59.927718567Z", + "epoch": 80, + "meanLoss": 0.000009137904, + "step": 303 + }, + { + "computeTime": "2024-10-08T17:42:00.794348294Z", + "epoch": 81, + "meanLoss": 0.00006602777, + "step": 304 + }, + { + "computeTime": "2024-10-08T17:42:01.572467042Z", + "epoch": 81, + "meanLoss": 0.000012708828, + "step": 305 + }, + { + "computeTime": "2024-10-08T17:42:02.706926438Z", + "epoch": 81, + "meanLoss": 0.0000015384285, + "step": 306 + }, + { + "computeTime": "2024-10-08T17:42:03.634048547Z", + "epoch": 81, + "meanLoss": 0.000007570754, + "step": 307 + }, + { + "computeTime": "2024-10-08T17:42:04.354197275Z", + "epoch": 82, + "meanLoss": 0.000023626024, + "step": 308 + }, + { + "computeTime": "2024-10-08T17:42:05.126722868Z", + "epoch": 82, + "meanLoss": 0.0000072568655, + "step": 309 + }, + { + "computeTime": "2024-10-08T17:42:05.950629837Z", + "epoch": 82, + "meanLoss": 0.0000074897744, + "step": 310 + }, + { + "computeTime": "2024-10-08T17:42:06.899255700Z", + "epoch": 82, + "meanLoss": 0.0000063083135, + "step": 311 + }, + { + "computeTime": "2024-10-08T17:42:07.732815609Z", + "epoch": 83, + "meanLoss": 0.000033332268, + "step": 312 + }, + { + "computeTime": "2024-10-08T17:42:08.671225254Z", + "epoch": 83, + "meanLoss": 0.000034363948, + "step": 313 + }, + { + "computeTime": "2024-10-08T17:42:09.585525384Z", + "epoch": 83, + "meanLoss": 0.000016310252, + "step": 314 + }, + { + "computeTime": "2024-10-08T17:42:10.514032407Z", + "epoch": 84, + "meanLoss": 0.0000046960777, + "step": 315 + }, + { + "computeTime": "2024-10-08T17:42:11.414552615Z", + "epoch": 84, + "meanLoss": 0.0000305218, + "step": 316 + }, + { + "computeTime": "2024-10-08T17:42:12.071919147Z", + "epoch": 84, + "meanLoss": 0.000011242926, + "step": 317 + }, + { + "computeTime": "2024-10-08T17:42:12.970599005Z", + "epoch": 84, + "meanLoss": 0.000010423362, + "step": 318 + }, + { + "computeTime": "2024-10-08T17:42:13.884200041Z", + "epoch": 85, + "meanLoss": 0.000005603768, + "step": 319 + }, + { + "computeTime": "2024-10-08T17:42:14.731022003Z", + "epoch": 85, + "meanLoss": 0.0000066477864, + "step": 320 + }, + { + "computeTime": "2024-10-08T17:42:15.643470722Z", + "epoch": 85, + "meanLoss": 0.0000059277518, + "step": 321 + }, + { + "computeTime": "2024-10-08T17:42:16.413515767Z", + "epoch": 85, + "meanLoss": 0.000038324986, + "step": 322 + }, + { + "computeTime": "2024-10-08T17:42:17.295602075Z", + "epoch": 86, + "meanLoss": 0.00003267487, + "step": 323 + }, + { + "computeTime": "2024-10-08T17:42:18.142488693Z", + "epoch": 86, + "meanLoss": 0.000015409314, + "step": 324 + }, + { + "computeTime": "2024-10-08T17:42:18.980724545Z", + "epoch": 86, + "meanLoss": 0.000007288065, + "step": 325 + }, + { + "computeTime": "2024-10-08T17:42:19.835587469Z", + "epoch": 86, + "meanLoss": 0.000014976598, + "step": 326 + }, + { + "computeTime": "2024-10-08T17:42:20.586370088Z", + "epoch": 87, + "meanLoss": 0.0000049157534, + "step": 327 + }, + { + "computeTime": "2024-10-08T17:42:21.263014498Z", + "epoch": 87, + "meanLoss": 0.0000067565124, + "step": 328 + }, + { + "computeTime": "2024-10-08T17:42:21.987379389Z", + "epoch": 87, + "meanLoss": 0.00000623893, + "step": 329 + }, + { + "computeTime": "2024-10-08T17:42:22.858861550Z", + "epoch": 88, + "meanLoss": 0.000046439935, + "step": 330 + }, + { + "computeTime": "2024-10-08T17:42:23.730958491Z", + "epoch": 88, + "meanLoss": 0.00000433065, + "step": 331 + }, + { + "computeTime": "2024-10-08T17:42:24.403800221Z", + "epoch": 88, + "meanLoss": 0.000012143515, + "step": 332 + }, + { + "computeTime": "2024-10-08T17:42:25.141667909Z", + "epoch": 88, + "meanLoss": 0.000010062708, + "step": 333 + }, + { + "computeTime": "2024-10-08T17:42:25.886580289Z", + "epoch": 89, + "meanLoss": 0.00003332715, + "step": 334 + }, + { + "computeTime": "2024-10-08T17:42:26.748077517Z", + "epoch": 89, + "meanLoss": 0.000038366765, + "step": 335 + }, + { + "computeTime": "2024-10-08T17:42:27.468835120Z", + "epoch": 89, + "meanLoss": 0.0000099665485, + "step": 336 + }, + { + "computeTime": "2024-10-08T17:42:28.133658195Z", + "epoch": 89, + "meanLoss": 0.0000027150381, + "step": 337 + }, + { + "computeTime": "2024-10-08T17:42:28.824372430Z", + "epoch": 90, + "meanLoss": 0.000006923353, + "step": 338 + }, + { + "computeTime": "2024-10-08T17:42:29.485449702Z", + "epoch": 90, + "meanLoss": 0.000026692403, + "step": 339 + }, + { + "computeTime": "2024-10-08T17:42:30.338869671Z", + "epoch": 90, + "meanLoss": 0.0000052829273, + "step": 340 + }, + { + "computeTime": "2024-10-08T17:42:31.186034449Z", + "epoch": 90, + "meanLoss": 0.000010224292, + "step": 341 + }, + { + "computeTime": "2024-10-08T17:42:31.923539373Z", + "epoch": 91, + "meanLoss": 0.000007809605, + "step": 342 + }, + { + "computeTime": "2024-10-08T17:42:32.674534164Z", + "epoch": 91, + "meanLoss": 0.000029806508, + "step": 343 + }, + { + "computeTime": "2024-10-08T17:42:33.397969496Z", + "epoch": 91, + "meanLoss": 0.000009635929, + "step": 344 + }, + { + "computeTime": "2024-10-08T17:42:34.287363221Z", + "epoch": 92, + "meanLoss": 0.000010377029, + "step": 345 + }, + { + "computeTime": "2024-10-08T17:42:35.163277367Z", + "epoch": 92, + "meanLoss": 0.0000038488356, + "step": 346 + }, + { + "computeTime": "2024-10-08T17:42:35.899451903Z", + "epoch": 92, + "meanLoss": 0.000010902528, + "step": 347 + }, + { + "computeTime": "2024-10-08T17:42:36.823593147Z", + "epoch": 92, + "meanLoss": 0.000008793315, + "step": 348 + }, + { + "computeTime": "2024-10-08T17:42:38.472070237Z", + "epoch": 93, + "meanLoss": 0.0000381656, + "step": 349 + }, + { + "computeTime": "2024-10-08T17:42:39.146783111Z", + "epoch": 93, + "meanLoss": 0.0000054108677, + "step": 350 + }, + { + "computeTime": "2024-10-08T17:42:40.129626809Z", + "epoch": 93, + "meanLoss": 0.00003259955, + "step": 351 + }, + { + "computeTime": "2024-10-08T17:42:41.149527214Z", + "epoch": 93, + "meanLoss": 0.000010806584, + "step": 352 + }, + { + "computeTime": "2024-10-08T17:42:42.062178172Z", + "epoch": 94, + "meanLoss": 0.0000050216913, + "step": 353 + }, + { + "computeTime": "2024-10-08T17:42:42.881631392Z", + "epoch": 94, + "meanLoss": 0.000010973541, + "step": 354 + }, + { + "computeTime": "2024-10-08T17:42:43.659871730Z", + "epoch": 94, + "meanLoss": 0.000008197967, + "step": 355 + }, + { + "computeTime": "2024-10-08T17:42:44.640870883Z", + "epoch": 94, + "meanLoss": 0.00002855109, + "step": 356 + }, + { + "computeTime": "2024-10-08T17:42:45.371232884Z", + "epoch": 95, + "meanLoss": 0.00000879903, + "step": 357 + }, + { + "computeTime": "2024-10-08T17:42:46.422819867Z", + "epoch": 95, + "meanLoss": 0.000008893199, + "step": 358 + }, + { + "computeTime": "2024-10-08T17:42:47.425609830Z", + "epoch": 95, + "meanLoss": 0.00001678802, + "step": 359 + }, + { + "computeTime": "2024-10-08T17:42:48.242939044Z", + "epoch": 96, + "meanLoss": 0.000029327926, + "step": 360 + }, + { + "computeTime": "2024-10-08T17:42:49.093961799Z", + "epoch": 96, + "meanLoss": 0.0000055674464, + "step": 361 + }, + { + "computeTime": "2024-10-08T17:42:49.930317485Z", + "epoch": 96, + "meanLoss": 0.000010478834, + "step": 362 + }, + { + "computeTime": "2024-10-08T17:42:50.693333471Z", + "epoch": 96, + "meanLoss": 0.00002710661, + "step": 363 + }, + { + "computeTime": "2024-10-08T17:42:51.355070601Z", + "epoch": 97, + "meanLoss": 0.000016209477, + "step": 364 + }, + { + "computeTime": "2024-10-08T17:42:52.246481891Z", + "epoch": 97, + "meanLoss": 0.0000066091307, + "step": 365 + }, + { + "computeTime": "2024-10-08T17:42:52.967367937Z", + "epoch": 97, + "meanLoss": 0.00000902114, + "step": 366 + }, + { + "computeTime": "2024-10-08T17:42:53.890773700Z", + "epoch": 97, + "meanLoss": 0.000011836624, + "step": 367 + }, + { + "computeTime": "2024-10-08T17:42:54.834522556Z", + "epoch": 98, + "meanLoss": 0.000026904512, + "step": 368 + }, + { + "computeTime": "2024-10-08T17:42:55.621491643Z", + "epoch": 98, + "meanLoss": 0.000031254254, + "step": 369 + }, + { + "computeTime": "2024-10-08T17:42:56.489902292Z", + "epoch": 98, + "meanLoss": 0.0000024003675, + "step": 370 + }, + { + "computeTime": "2024-10-08T17:42:57.304558703Z", + "epoch": 98, + "meanLoss": 0.000008429171, + "step": 371 + }, + { + "computeTime": "2024-10-08T17:42:58.165055911Z", + "epoch": 99, + "meanLoss": 0.000010808172, + "step": 372 + }, + { + "computeTime": "2024-10-08T17:42:58.915151553Z", + "epoch": 99, + "meanLoss": 0.0000033918768, + "step": 373 + }, + { + "computeTime": "2024-10-08T17:42:59.766145825Z", + "epoch": 99, + "meanLoss": 0.000008599367, + "step": 374 + }, + { + "computeTime": "2024-10-08T17:43:00.517192174Z", + "epoch": 100, + "meanLoss": 0.000023751054, + "step": 375 + } + ], + "startTime": "2024-10-08T17:37:34.804998419Z" + }, + "updateTime": "2024-10-08T17:43:00.655489Z" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedVertexTest.json b/Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedVertexTest.json new file mode 100644 index 00000000..7c06bb3a --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/GetModelTest.GetModelTunedVertexTest.json @@ -0,0 +1,140 @@ +{ + "recordID": "GetModelTest.GetModelTunedVertexTest", + "interactions": [ + { + "request": { + "method": "GET", + "url": "/v1beta1/projects/REDACTED/locations/us-central1/models/8611312396578848768", + "request": "GET /v1beta1/projects/REDACTED/locations/us-central1/models/8611312396578848768 HTTP/1.1", + "headers": { + "Test-Name": "GetModelTest.GetModelTunedVertexTest" + }, + "bodySegments": [ + null + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "us-central1-aiplatform.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "0f81c81c0414ad948e2ed5ef347ce5619fcf3a014bbccfa56c665336e54bdd76", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Wed, 19 Nov 2025 23:14:00 GMT", + "Server": "ESF", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "baseModelSource": { + "genieSource": { + "originalPublisherBasedModelId": "gemini-2.5-flash" + } + }, + "checkpoints": [ + { + "checkpointId": "1", + "epoch": "2", + "step": "34" + }, + { + "checkpointId": "2", + "epoch": "3", + "step": "68" + }, + { + "checkpointId": "3", + "epoch": "4", + "step": "102" + }, + { + "checkpointId": "4", + "epoch": "5", + "step": "136" + }, + { + "checkpointId": "5", + "epoch": "6", + "step": "170" + }, + { + "checkpointId": "6", + "epoch": "7", + "step": "204" + }, + { + "checkpointId": "7", + "epoch": "7", + "step": "233" + } + ], + "createTime": "2025-11-17T20:33:17.341241Z", + "defaultCheckpointId": "7", + "deployedModels": [ + { + "checkpointId": "1", + "deployedModelId": "7133190536847949824", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/47313084854829056" + }, + { + "checkpointId": "4", + "deployedModelId": "711057468217622528", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/234775419344125952" + }, + { + "checkpointId": "7", + "deployedModelId": "5973513632800047104", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/4540216663110320128" + }, + { + "checkpointId": "3", + "deployedModelId": "4084253589118124032", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/5087966967789256704" + }, + { + "checkpointId": "5", + "deployedModelId": "886697853685071872", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/5727478114875867136" + }, + { + "checkpointId": "2", + "deployedModelId": "4845361926143737856", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/6265095320393220096" + }, + { + "checkpointId": "6", + "deployedModelId": "8605867614998102016", + "endpoint": "projects/REDACTED/locations/us-central1/endpoints/6846059672324014080" + } + ], + "displayName": "gemini-2.5-flash-f6cfc21c-f72c-4677-8d00-eedac4d73de0", + "etag": "AMEw9yPopsZpiDDQtELSZGpQBsZ67QQn8RziQG6kya7ddY1EBgz68mwqgIM6cSNrcvpc", + "labels": { + "goog-drz-vertex-ai-tuning-location": "us-central1", + "goog-drz-vertex-ai-tuning-uuid": "671808253180510208", + "google-vertex-llm-tuning-base-model-id": "gemini-2_5-flash", + "google-vertex-llm-tuning-job-id": "671808253180510208", + "tune-type": "sft" + }, + "modelSourceInfo": { + "sourceType": "GENIE" + }, + "name": "projects/REDACTED/locations/us-central1/models/8611312396578848768", + "updateTime": "2025-11-17T20:33:17.588922Z", + "versionAliases": [ + "default" + ], + "versionCreateTime": "2025-11-17T20:33:17.341241Z", + "versionId": "1", + "versionUpdateTime": "2025-11-17T21:09:56.810056Z" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelGeminiTest.json b/Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelGeminiTest.json new file mode 100644 index 00000000..cb6a1ca5 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelGeminiTest.json @@ -0,0 +1,55 @@ +{ + "recordID": "UpdateModelTest.UpdateModelGeminiTest", + "interactions": [ + { + "request": { + "method": "PATCH", + "url": "/v1beta/tunedModels/generate-num-9131", + "request": "PATCH /v1beta/tunedModels/generate-num-9131 HTTP/1.1", + "headers": { + "Content-Length": "38", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "UpdateModelTest.UpdateModelGeminiTest" + }, + "bodySegments": [ + { + "description": "Updated model config" + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "generativelanguage.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "43f857040fdcbe396f9d1a9394558676f0762c371dfa6b5103568b5777578761", + "response": { + "statusCode": 400, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Wed, 19 Nov 2025 23:20:05 GMT", + "Server": "scaffolding on HTTPServer2", + "Server-Timing": "gfet4t7; dur=527", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "error": { + "code": 400, + "details": [ + { + "@type": "type.googleapis.com/google.rpc.DebugInfo", + "detail": "[ORIGINAL ERROR] generic::failed_precondition: models/gemini-1.0-pro-001 is not found for CREATE TUNED MODEL at API version v1beta. [google.rpc.error_details_ext] { message: \"models/gemini-1.0-pro-001 is not found for CREATE TUNED MODEL at API version v1beta.\" }" + } + ], + "message": "models/gemini-1.0-pro-001 is not found for CREATE TUNED MODEL at API version v1beta.", + "status": "FAILED_PRECONDITION" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelVertexTest.json b/Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelVertexTest.json new file mode 100644 index 00000000..cdcda7d4 --- /dev/null +++ b/Google.GenAI.E2E.Tests/Recordings/UpdateModelTest.UpdateModelVertexTest.json @@ -0,0 +1,59 @@ +{ + "recordID": "UpdateModelTest.UpdateModelVertexTest", + "interactions": [ + { + "request": { + "method": "PATCH", + "url": "/v1beta1/projects/REDACTED/locations/us-central1/models/4705847094718496768", + "request": "PATCH /v1beta1/projects/REDACTED/locations/us-central1/models/4705847094718496768 HTTP/1.1", + "headers": { + "Content-Length": "38", + "Content-Type": "application/json; charset=utf-8", + "Test-Name": "UpdateModelTest.UpdateModelVertexTest" + }, + "bodySegments": [ + { + "description": "Updated model config" + } + ], + "previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d", + "serverAddress": "us-central1-aiplatform.googleapis.com", + "port": 443, + "protocol": "https" + }, + "shaSum": "896168779cb7b8fa23fe5dfaa56f578f1c45f6026e4b7f37195b381e343627b4", + "response": { + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=UTF-8", + "Date": "Wed, 19 Nov 2025 23:20:04 GMT", + "Server": "ESF", + "Vary": "Origin, X-Origin, Referer", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "SAMEORIGIN", + "X-Xss-Protection": "0" + }, + "bodySegments": [ + { + "baseModelSource": { + "genieSource": { + "originalPublisherBasedModelId": "gemini-2.5-flash" + } + }, + "createTime": "2025-11-17T20:33:20.361768Z", + "description": "Updated model config", + "etag": "AMEw9yOGeCk5FM9MXCr6lYC-3OJopJ4D0-RQ3XqFIErhKzTIlumEHBoydekWqSdBrgIM", + "labels": { + "google-vertex-llm-tuning-base-model-id": "gemini-2_5-flash" + }, + "modelSourceInfo": { + "sourceType": "GENIE" + }, + "name": "projects/REDACTED/locations/us-central1/models/4705847094718496768", + "updateTime": "2025-11-19T23:20:04.559519Z" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Google.GenAI/Common.cs b/Google.GenAI/Common.cs index d303081c..3bd095db 100644 --- a/Google.GenAI/Common.cs +++ b/Google.GenAI/Common.cs @@ -155,7 +155,7 @@ public static void SetValueByPath(JsonObject jsonObject, string[] path, object v GetValueByPath(element, keys.Skip(i + 1).ToArray()); if (node != null) { - result.Add(node); + result.Add(JsonNode.Parse(node.ToJsonString())); } } return result; diff --git a/Google.GenAI/HttpApiClient.cs b/Google.GenAI/HttpApiClient.cs index 3974aa8b..5ced97d6 100644 --- a/Google.GenAI/HttpApiClient.cs +++ b/Google.GenAI/HttpApiClient.cs @@ -162,7 +162,7 @@ public override async IAsyncEnumerable RequestStreamAsync( private async Task CreateHttpRequestAsync(HttpMethod httpMethod, string path, string requestJson, Types.HttpOptions? requestHttpOptions) { - bool queryBaseModel = httpMethod.Equals("GET") && path.StartsWith("publishers/google/models"); + bool queryBaseModel = httpMethod == HttpMethod.Get && path.StartsWith("publishers/google/models"); if (this.VertexAI && !path.StartsWith("projects/") && !queryBaseModel) { path = $"projects/{Project}/locations/{Location}/{path}"; diff --git a/Google.GenAI/Models.cs b/Google.GenAI/Models.cs index b89472a1..bf007ce8 100644 --- a/Google.GenAI/Models.cs +++ b/Google.GenAI/Models.cs @@ -164,6 +164,42 @@ internal JsonNode ComputeTokensResponseFromVertex(JsonNode fromObject, return toObject; } + internal JsonNode ContentEmbeddingFromVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "values" }) != null) { + Common.SetValueByPath(toObject, new string[] { "values" }, + Common.GetValueByPath(fromObject, new string[] { "values" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "statistics" }) != null) { + Common.SetValueByPath(toObject, new string[] { "statistics" }, + ContentEmbeddingStatisticsFromVertex( + JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( + fromObject, new string[] { "statistics" }))), + toObject)); + } + + return toObject; + } + + internal JsonNode ContentEmbeddingStatisticsFromVertex(JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "truncated" }) != null) { + Common.SetValueByPath(toObject, new string[] { "truncated" }, + Common.GetValueByPath(fromObject, new string[] { "truncated" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "token_count" }) != null) { + Common.SetValueByPath(toObject, new string[] { "tokenCount" }, + Common.GetValueByPath(fromObject, new string[] { "token_count" })); + } + + return toObject; + } + internal JsonNode ContentToMldev(JsonNode fromObject, JsonObject parentObject) { JsonObject toObject = new JsonObject(); @@ -350,6 +386,58 @@ internal JsonNode CountTokensResponseFromVertex(JsonNode fromObject, JsonObject return toObject; } + internal JsonNode DeleteModelParametersToMldev(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "name" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + return toObject; + } + + internal JsonNode DeleteModelParametersToVertex(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "name" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + return toObject; + } + + internal JsonNode DeleteModelResponseFromMldev(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "sdkHttpResponse" }, + Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" })); + } + + return toObject; + } + + internal JsonNode DeleteModelResponseFromVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "sdkHttpResponse" }, + Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" })); + } + + return toObject; + } + internal JsonNode EditImageConfigToVertex(JsonNode fromObject, JsonObject parentObject) { JsonObject toObject = new JsonObject(); @@ -509,6 +597,197 @@ internal JsonNode EditImageResponseFromVertex(JsonNode fromObject, JsonObject pa return toObject; } + internal JsonNode EmbedContentConfigToMldev(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "taskType" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "requests[]", "taskType" }, + Common.GetValueByPath(fromObject, new string[] { "taskType" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "title" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "requests[]", "title" }, + Common.GetValueByPath(fromObject, new string[] { "title" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "outputDimensionality" }) != null) { + Common.SetValueByPath( + parentObject, new string[] { "requests[]", "outputDimensionality" }, + Common.GetValueByPath(fromObject, new string[] { "outputDimensionality" })); + } + + if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "mimeType" }))) { + throw new NotSupportedException("mimeType parameter is not supported in Gemini API."); + } + + if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "autoTruncate" }))) { + throw new NotSupportedException("autoTruncate parameter is not supported in Gemini API."); + } + + return toObject; + } + + internal JsonNode EmbedContentConfigToVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "taskType" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "instances[]", "task_type" }, + Common.GetValueByPath(fromObject, new string[] { "taskType" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "title" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "instances[]", "title" }, + Common.GetValueByPath(fromObject, new string[] { "title" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "outputDimensionality" }) != null) { + Common.SetValueByPath( + parentObject, new string[] { "parameters", "outputDimensionality" }, + Common.GetValueByPath(fromObject, new string[] { "outputDimensionality" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "mimeType" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "instances[]", "mimeType" }, + Common.GetValueByPath(fromObject, new string[] { "mimeType" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "autoTruncate" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "parameters", "autoTruncate" }, + Common.GetValueByPath(fromObject, new string[] { "autoTruncate" })); + } + + return toObject; + } + + internal JsonNode EmbedContentParametersToMldev(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "model" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + if (Common.GetValueByPath(fromObject, new string[] { "contents" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "requests[]", "content" }, + Transformers.TContentsForEmbed( + this._apiClient, Common.GetValueByPath(fromObject, new string[] { "contents" }))); + } + + if (Common.GetValueByPath(fromObject, new string[] { "config" }) != null) { + _ = EmbedContentConfigToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( + fromObject, new string[] { "config" }))), + toObject); + } + + Common.SetValueByPath( + toObject, new string[] { "requests[]", "model" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + + return toObject; + } + + internal JsonNode EmbedContentParametersToVertex(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "model" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + if (Common.GetValueByPath(fromObject, new string[] { "contents" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "instances[]", "content" }, + Transformers.TContentsForEmbed( + this._apiClient, Common.GetValueByPath(fromObject, new string[] { "contents" }))); + } + + if (Common.GetValueByPath(fromObject, new string[] { "config" }) != null) { + _ = EmbedContentConfigToVertex( + JsonNode.Parse(JsonSerializer.Serialize( + Common.GetValueByPath(fromObject, new string[] { "config" }))), + toObject); + } + + return toObject; + } + + internal JsonNode EmbedContentResponseFromMldev(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "sdkHttpResponse" }, + Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "embeddings" }) != null) { + Common.SetValueByPath(toObject, new string[] { "embeddings" }, + Common.GetValueByPath(fromObject, new string[] { "embeddings" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "metadata" }) != null) { + Common.SetValueByPath(toObject, new string[] { "metadata" }, + Common.GetValueByPath(fromObject, new string[] { "metadata" })); + } + + return toObject; + } + + internal JsonNode EmbedContentResponseFromVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "sdkHttpResponse" }, + Common.GetValueByPath(fromObject, new string[] { "sdkHttpResponse" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "predictions[]", "embeddings" }) != + null) { + JsonArray keyArray = (JsonArray)Common.GetValueByPath( + fromObject, new string[] { "predictions[]", "embeddings" }); + JsonArray result = new JsonArray(); + + foreach (var record in keyArray) { + result.Add(ContentEmbeddingFromVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), + toObject)); + } + Common.SetValueByPath(toObject, new string[] { "embeddings" }, result); + } + + if (Common.GetValueByPath(fromObject, new string[] { "metadata" }) != null) { + Common.SetValueByPath(toObject, new string[] { "metadata" }, + Common.GetValueByPath(fromObject, new string[] { "metadata" })); + } + + return toObject; + } + + internal JsonNode EndpointFromVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "endpoint" }) != null) { + Common.SetValueByPath(toObject, new string[] { "name" }, + Common.GetValueByPath(fromObject, new string[] { "endpoint" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "deployedModelId" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "deployedModelId" }, + Common.GetValueByPath(fromObject, new string[] { "deployedModelId" })); + } + + return toObject; + } + internal JsonNode FileDataToMldev(JsonNode fromObject, JsonObject parentObject) { JsonObject toObject = new JsonObject(); @@ -1668,6 +1947,34 @@ internal JsonNode GenerationConfigToVertex(JsonNode fromObject, JsonObject paren return toObject; } + internal JsonNode GetModelParametersToMldev(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "name" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + return toObject; + } + + internal JsonNode GetModelParametersToVertex(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "name" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + return toObject; + } + internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject) { JsonObject toObject = new JsonObject(); @@ -1841,54 +2148,191 @@ internal JsonNode MaskReferenceConfigToVertex(JsonNode fromObject, JsonObject pa return toObject; } - internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) { + internal JsonNode ModelFromMldev(JsonNode fromObject, JsonObject parentObject) { JsonObject toObject = new JsonObject(); - if (Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }) != null) { - Common.SetValueByPath( - toObject, new string[] { "mediaResolution" }, - Common.GetValueByPath(fromObject, new string[] { "mediaResolution" })); + if (Common.GetValueByPath(fromObject, new string[] { "name" }) != null) { + Common.SetValueByPath(toObject, new string[] { "name" }, + Common.GetValueByPath(fromObject, new string[] { "name" })); } - if (Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }) != null) { - Common.SetValueByPath( - toObject, new string[] { "codeExecutionResult" }, - Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" })); + if (Common.GetValueByPath(fromObject, new string[] { "displayName" }) != null) { + Common.SetValueByPath(toObject, new string[] { "displayName" }, + Common.GetValueByPath(fromObject, new string[] { "displayName" })); } - if (Common.GetValueByPath(fromObject, new string[] { "executableCode" }) != null) { - Common.SetValueByPath(toObject, new string[] { "executableCode" }, - Common.GetValueByPath(fromObject, new string[] { "executableCode" })); + if (Common.GetValueByPath(fromObject, new string[] { "description" }) != null) { + Common.SetValueByPath(toObject, new string[] { "description" }, + Common.GetValueByPath(fromObject, new string[] { "description" })); } - if (Common.GetValueByPath(fromObject, new string[] { "fileData" }) != null) { - Common.SetValueByPath( - toObject, new string[] { "fileData" }, - FileDataToMldev(JsonNode.Parse(JsonSerializer.Serialize( - Common.GetValueByPath(fromObject, new string[] { "fileData" }))), - toObject)); + if (Common.GetValueByPath(fromObject, new string[] { "version" }) != null) { + Common.SetValueByPath(toObject, new string[] { "version" }, + Common.GetValueByPath(fromObject, new string[] { "version" })); } - if (Common.GetValueByPath(fromObject, new string[] { "functionCall" }) != null) { + if (Common.GetValueByPath(fromObject, new string[] { "_self" }) != null) { + Common.SetValueByPath(toObject, new string[] { "tunedModelInfo" }, + Common.GetValueByPath(fromObject, new string[] { "_self" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "inputTokenLimit" }) != null) { Common.SetValueByPath( - toObject, new string[] { "functionCall" }, - FunctionCallToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( - fromObject, new string[] { "functionCall" }))), - toObject)); + toObject, new string[] { "inputTokenLimit" }, + Common.GetValueByPath(fromObject, new string[] { "inputTokenLimit" })); } - if (Common.GetValueByPath(fromObject, new string[] { "functionResponse" }) != null) { + if (Common.GetValueByPath(fromObject, new string[] { "outputTokenLimit" }) != null) { Common.SetValueByPath( - toObject, new string[] { "functionResponse" }, - Common.GetValueByPath(fromObject, new string[] { "functionResponse" })); + toObject, new string[] { "outputTokenLimit" }, + Common.GetValueByPath(fromObject, new string[] { "outputTokenLimit" })); } - if (Common.GetValueByPath(fromObject, new string[] { "inlineData" }) != null) { + if (Common.GetValueByPath(fromObject, new string[] { "supportedGenerationMethods" }) != + null) { Common.SetValueByPath( - toObject, new string[] { "inlineData" }, - BlobToMldev(JsonNode.Parse(JsonSerializer.Serialize( - Common.GetValueByPath(fromObject, new string[] { "inlineData" }))), - toObject)); + toObject, new string[] { "supportedActions" }, + Common.GetValueByPath(fromObject, new string[] { "supportedGenerationMethods" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "temperature" }) != null) { + Common.SetValueByPath(toObject, new string[] { "temperature" }, + Common.GetValueByPath(fromObject, new string[] { "temperature" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "maxTemperature" }) != null) { + Common.SetValueByPath(toObject, new string[] { "maxTemperature" }, + Common.GetValueByPath(fromObject, new string[] { "maxTemperature" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "topP" }) != null) { + Common.SetValueByPath(toObject, new string[] { "topP" }, + Common.GetValueByPath(fromObject, new string[] { "topP" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "topK" }) != null) { + Common.SetValueByPath(toObject, new string[] { "topK" }, + Common.GetValueByPath(fromObject, new string[] { "topK" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "thinking" }) != null) { + Common.SetValueByPath(toObject, new string[] { "thinking" }, + Common.GetValueByPath(fromObject, new string[] { "thinking" })); + } + + return toObject; + } + + internal JsonNode ModelFromVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "name" }) != null) { + Common.SetValueByPath(toObject, new string[] { "name" }, + Common.GetValueByPath(fromObject, new string[] { "name" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "displayName" }) != null) { + Common.SetValueByPath(toObject, new string[] { "displayName" }, + Common.GetValueByPath(fromObject, new string[] { "displayName" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "description" }) != null) { + Common.SetValueByPath(toObject, new string[] { "description" }, + Common.GetValueByPath(fromObject, new string[] { "description" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "versionId" }) != null) { + Common.SetValueByPath(toObject, new string[] { "version" }, + Common.GetValueByPath(fromObject, new string[] { "versionId" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "deployedModels" }) != null) { + JsonArray keyArray = + (JsonArray)Common.GetValueByPath(fromObject, new string[] { "deployedModels" }); + JsonArray result = new JsonArray(); + + foreach (var record in keyArray) { + result.Add( + EndpointFromVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject)); + } + Common.SetValueByPath(toObject, new string[] { "endpoints" }, result); + } + + if (Common.GetValueByPath(fromObject, new string[] { "labels" }) != null) { + Common.SetValueByPath(toObject, new string[] { "labels" }, + Common.GetValueByPath(fromObject, new string[] { "labels" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "_self" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "tunedModelInfo" }, + TunedModelInfoFromVertex(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( + fromObject, new string[] { "_self" }))), + toObject)); + } + + if (Common.GetValueByPath(fromObject, new string[] { "defaultCheckpointId" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "defaultCheckpointId" }, + Common.GetValueByPath(fromObject, new string[] { "defaultCheckpointId" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "checkpoints" }) != null) { + Common.SetValueByPath(toObject, new string[] { "checkpoints" }, + Common.GetValueByPath(fromObject, new string[] { "checkpoints" })); + } + + return toObject; + } + + internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "mediaResolution" }, + Common.GetValueByPath(fromObject, new string[] { "mediaResolution" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "codeExecutionResult" }, + Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "executableCode" }) != null) { + Common.SetValueByPath(toObject, new string[] { "executableCode" }, + Common.GetValueByPath(fromObject, new string[] { "executableCode" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "fileData" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "fileData" }, + FileDataToMldev(JsonNode.Parse(JsonSerializer.Serialize( + Common.GetValueByPath(fromObject, new string[] { "fileData" }))), + toObject)); + } + + if (Common.GetValueByPath(fromObject, new string[] { "functionCall" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "functionCall" }, + FunctionCallToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( + fromObject, new string[] { "functionCall" }))), + toObject)); + } + + if (Common.GetValueByPath(fromObject, new string[] { "functionResponse" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "functionResponse" }, + Common.GetValueByPath(fromObject, new string[] { "functionResponse" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "inlineData" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "inlineData" }, + BlobToMldev(JsonNode.Parse(JsonSerializer.Serialize( + Common.GetValueByPath(fromObject, new string[] { "inlineData" }))), + toObject)); } if (Common.GetValueByPath(fromObject, new string[] { "text" }) != null) { @@ -2481,6 +2925,115 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) { return toObject; } + internal JsonNode TunedModelInfoFromVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath( + fromObject, new string[] { "labels", "google-vertex-llm-tuning-base-model-id" }) != + null) { + Common.SetValueByPath( + toObject, new string[] { "baseModel" }, + Common.GetValueByPath( + fromObject, new string[] { "labels", "google-vertex-llm-tuning-base-model-id" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "createTime" }) != null) { + Common.SetValueByPath(toObject, new string[] { "createTime" }, + Common.GetValueByPath(fromObject, new string[] { "createTime" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "updateTime" }) != null) { + Common.SetValueByPath(toObject, new string[] { "updateTime" }, + Common.GetValueByPath(fromObject, new string[] { "updateTime" })); + } + + return toObject; + } + + internal JsonNode UpdateModelConfigToMldev(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "displayName" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "displayName" }, + Common.GetValueByPath(fromObject, new string[] { "displayName" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "description" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "description" }, + Common.GetValueByPath(fromObject, new string[] { "description" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "defaultCheckpointId" }) != null) { + Common.SetValueByPath( + parentObject, new string[] { "defaultCheckpointId" }, + Common.GetValueByPath(fromObject, new string[] { "defaultCheckpointId" })); + } + + return toObject; + } + + internal JsonNode UpdateModelConfigToVertex(JsonNode fromObject, JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "displayName" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "displayName" }, + Common.GetValueByPath(fromObject, new string[] { "displayName" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "description" }) != null) { + Common.SetValueByPath(parentObject, new string[] { "description" }, + Common.GetValueByPath(fromObject, new string[] { "description" })); + } + + if (Common.GetValueByPath(fromObject, new string[] { "defaultCheckpointId" }) != null) { + Common.SetValueByPath( + parentObject, new string[] { "defaultCheckpointId" }, + Common.GetValueByPath(fromObject, new string[] { "defaultCheckpointId" })); + } + + return toObject; + } + + internal JsonNode UpdateModelParametersToMldev(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "name" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + if (Common.GetValueByPath(fromObject, new string[] { "config" }) != null) { + _ = UpdateModelConfigToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( + fromObject, new string[] { "config" }))), + toObject); + } + + return toObject; + } + + internal JsonNode UpdateModelParametersToVertex(ApiClient apiClient, JsonNode fromObject, + JsonObject parentObject) { + JsonObject toObject = new JsonObject(); + + if (Common.GetValueByPath(fromObject, new string[] { "model" }) != null) { + Common.SetValueByPath( + toObject, new string[] { "_url", "model" }, + Transformers.TModel(this._apiClient, + Common.GetValueByPath(fromObject, new string[] { "model" }))); + } + + if (Common.GetValueByPath(fromObject, new string[] { "config" }) != null) { + _ = UpdateModelConfigToVertex(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath( + fromObject, new string[] { "config" }))), + toObject); + } + + return toObject; + } + internal JsonNode UpscaleImageAPIConfigToVertex(JsonNode fromObject, JsonObject parentObject) { JsonObject toObject = new JsonObject(); @@ -2613,7 +3166,7 @@ public Models(ApiClient apiClient) { } private async Task PrivateGenerateContentAsync( - string model, List contents, GenerateContentConfig config) { + string model, List contents, GenerateContentConfig? config = null) { GenerateContentParameters parameter = new GenerateContentParameters(); if (!Common.IsZero(model)) { @@ -2670,7 +3223,7 @@ private async Task PrivateGenerateContentAsync( } private async IAsyncEnumerable PrivateGenerateContentStreamAsync( - string model, List contents, GenerateContentConfig config) { + string model, List contents, GenerateContentConfig? config = null) { GenerateContentParameters parameter = new GenerateContentParameters(); if (!Common.IsZero(model)) { @@ -2722,8 +3275,76 @@ private async IAsyncEnumerable PrivateGenerateContentSt } } + /// + /// Calculates embeddings for the given contents. + /// + /// The model to use for embedding. + /// A to calculate embeddings for. + /// An instance that specifies the + /// optional configurations. + /// A that represents the asynchronous + /// operation. The task result contains a instance with + /// embeddings and other metadata. + + public async Task EmbedContentAsync(string model, List contents, + EmbedContentConfig? config = null) { + EmbedContentParameters parameter = new EmbedContentParameters(); + + if (!Common.IsZero(model)) { + parameter.Model = model; + } + if (!Common.IsZero(contents)) { + parameter.Contents = contents; + } + if (!Common.IsZero(config)) { + parameter.Config = config; + } + string jsonString = JsonSerializer.Serialize(parameter); + JsonNode? parameterNode = JsonNode.Parse(jsonString); + if (parameterNode == null) { + throw new NotSupportedException("Failed to parse EmbedContentParameters to JsonNode."); + } + + JsonNode body; + string path; + if (this._apiClient.VertexAI) { + body = EmbedContentParametersToVertex(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{model}:predict", body["_url"]); + } else { + body = EmbedContentParametersToMldev(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{model}:batchEmbedContents", body["_url"]); + } + JsonObject? bodyObj = body?.AsObject(); + bodyObj?.Remove("_url"); + // TODO: Handle "_query" in the body (for list support). + bodyObj?.Remove("_query"); + HttpOptions? requestHttpOptions = config?.HttpOptions; + + ApiResponse response = await this._apiClient.RequestAsync( + HttpMethod.Post, path, JsonSerializer.Serialize(body), requestHttpOptions); + HttpContent httpContent = response.GetEntity(); + string contentString = await httpContent.ReadAsStringAsync(); + JsonNode? httpContentNode = JsonNode.Parse(contentString); + if (httpContentNode == null) { + throw new NotSupportedException("Failed to parse response to JsonNode."); + } + JsonNode responseNode = httpContentNode; + + if (this._apiClient.VertexAI) { + responseNode = EmbedContentResponseFromVertex(httpContentNode, new JsonObject()); + } + + if (!this._apiClient.VertexAI) { + responseNode = EmbedContentResponseFromMldev(httpContentNode, new JsonObject()); + } + + return JsonSerializer.Deserialize(responseNode.ToString()) ?? + throw new InvalidOperationException( + "Failed to deserialize Task."); + } + private async Task PrivateGenerateImagesAsync( - string model, string prompt, GenerateImagesConfig config) { + string model, string prompt, GenerateImagesConfig? config = null) { GenerateImagesParameters parameter = new GenerateImagesParameters(); if (!Common.IsZero(model)) { @@ -2781,7 +3402,7 @@ private async Task PrivateGenerateImagesAsync( private async Task PrivateEditImageAsync( string model, string prompt, List referenceImages, - EditImageConfig config) { + EditImageConfig? config = null) { EditImageParameters parameter = new EditImageParameters(); if (!Common.IsZero(model)) { @@ -2839,7 +3460,7 @@ private async Task PrivateEditImageAsync( } private async Task PrivateUpscaleImageAsync( - string model, Image image, string upscaleFactor, UpscaleImageAPIConfig config) { + string model, Image image, string upscaleFactor, UpscaleImageAPIConfig? config = null) { UpscaleImageAPIParameters parameter = new UpscaleImageAPIParameters(); if (!Common.IsZero(model)) { @@ -2897,9 +3518,8 @@ private async Task PrivateUpscaleImageAsync( "Failed to deserialize Task."); } - public async Task RecontextImageAsync(string model, - RecontextImageSource source, - RecontextImageConfig config) { + public async Task RecontextImageAsync( + string model, RecontextImageSource source, RecontextImageConfig? config = null) { RecontextImageParameters parameter = new RecontextImageParameters(); if (!Common.IsZero(model)) { @@ -2956,7 +3576,7 @@ public async Task RecontextImageAsync(string model, public async Task SegmentImageAsync(string model, SegmentImageSource source, - SegmentImageConfig config) { + SegmentImageConfig? config = null) { SegmentImageParameters parameter = new SegmentImageParameters(); if (!Common.IsZero(model)) { @@ -3011,6 +3631,180 @@ public async Task SegmentImageAsync(string model, "Failed to deserialize Task."); } + /// + /// Retrieves a specific model resource by its name. + /// + + public async Task GetAsync(string model, GetModelConfig? config = null) { + GetModelParameters parameter = new GetModelParameters(); + + if (!Common.IsZero(model)) { + parameter.Model = model; + } + if (!Common.IsZero(config)) { + parameter.Config = config; + } + string jsonString = JsonSerializer.Serialize(parameter); + JsonNode? parameterNode = JsonNode.Parse(jsonString); + if (parameterNode == null) { + throw new NotSupportedException("Failed to parse GetModelParameters to JsonNode."); + } + + JsonNode body; + string path; + if (this._apiClient.VertexAI) { + body = GetModelParametersToVertex(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{name}", body["_url"]); + } else { + body = GetModelParametersToMldev(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{name}", body["_url"]); + } + JsonObject? bodyObj = body?.AsObject(); + bodyObj?.Remove("_url"); + // TODO: Handle "_query" in the body (for list support). + bodyObj?.Remove("_query"); + HttpOptions? requestHttpOptions = config?.HttpOptions; + + ApiResponse response = await this._apiClient.RequestAsync( + HttpMethod.Get, path, JsonSerializer.Serialize(body), requestHttpOptions); + HttpContent httpContent = response.GetEntity(); + string contentString = await httpContent.ReadAsStringAsync(); + JsonNode? httpContentNode = JsonNode.Parse(contentString); + if (httpContentNode == null) { + throw new NotSupportedException("Failed to parse response to JsonNode."); + } + JsonNode responseNode = httpContentNode; + + if (this._apiClient.VertexAI) { + responseNode = ModelFromVertex(httpContentNode, new JsonObject()); + } + + if (!this._apiClient.VertexAI) { + responseNode = ModelFromMldev(httpContentNode, new JsonObject()); + } + + return JsonSerializer.Deserialize(responseNode.ToString()) ?? + throw new InvalidOperationException("Failed to deserialize Task."); + } + + /// + /// Updates a specific model resource. + /// + /// The model to update. + /// An instance that specifies parameters + /// to update. A that represents the asynchronous + /// operation. The task result contains the updated instance. + + public async Task UpdateAsync(string model, UpdateModelConfig? config = null) { + UpdateModelParameters parameter = new UpdateModelParameters(); + + if (!Common.IsZero(model)) { + parameter.Model = model; + } + if (!Common.IsZero(config)) { + parameter.Config = config; + } + string jsonString = JsonSerializer.Serialize(parameter); + JsonNode? parameterNode = JsonNode.Parse(jsonString); + if (parameterNode == null) { + throw new NotSupportedException("Failed to parse UpdateModelParameters to JsonNode."); + } + + JsonNode body; + string path; + if (this._apiClient.VertexAI) { + body = UpdateModelParametersToVertex(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{model}", body["_url"]); + } else { + body = UpdateModelParametersToMldev(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{name}", body["_url"]); + } + JsonObject? bodyObj = body?.AsObject(); + bodyObj?.Remove("_url"); + // TODO: Handle "_query" in the body (for list support). + bodyObj?.Remove("_query"); + HttpOptions? requestHttpOptions = config?.HttpOptions; + + ApiResponse response = await this._apiClient.RequestAsync( + HttpMethod.Patch, path, JsonSerializer.Serialize(body), requestHttpOptions); + HttpContent httpContent = response.GetEntity(); + string contentString = await httpContent.ReadAsStringAsync(); + JsonNode? httpContentNode = JsonNode.Parse(contentString); + if (httpContentNode == null) { + throw new NotSupportedException("Failed to parse response to JsonNode."); + } + JsonNode responseNode = httpContentNode; + + if (this._apiClient.VertexAI) { + responseNode = ModelFromVertex(httpContentNode, new JsonObject()); + } + + if (!this._apiClient.VertexAI) { + responseNode = ModelFromMldev(httpContentNode, new JsonObject()); + } + + return JsonSerializer.Deserialize(responseNode.ToString()) ?? + throw new InvalidOperationException("Failed to deserialize Task."); + } + + /// + /// Deletes a specific model resource by its name. + /// + + public async Task DeleteAsync(string model, + DeleteModelConfig? config = null) { + DeleteModelParameters parameter = new DeleteModelParameters(); + + if (!Common.IsZero(model)) { + parameter.Model = model; + } + if (!Common.IsZero(config)) { + parameter.Config = config; + } + string jsonString = JsonSerializer.Serialize(parameter); + JsonNode? parameterNode = JsonNode.Parse(jsonString); + if (parameterNode == null) { + throw new NotSupportedException("Failed to parse DeleteModelParameters to JsonNode."); + } + + JsonNode body; + string path; + if (this._apiClient.VertexAI) { + body = DeleteModelParametersToVertex(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{name}", body["_url"]); + } else { + body = DeleteModelParametersToMldev(this._apiClient, parameterNode, new JsonObject()); + path = Common.FormatMap("{name}", body["_url"]); + } + JsonObject? bodyObj = body?.AsObject(); + bodyObj?.Remove("_url"); + // TODO: Handle "_query" in the body (for list support). + bodyObj?.Remove("_query"); + HttpOptions? requestHttpOptions = config?.HttpOptions; + + ApiResponse response = await this._apiClient.RequestAsync( + HttpMethod.Delete, path, JsonSerializer.Serialize(body), requestHttpOptions); + HttpContent httpContent = response.GetEntity(); + string contentString = await httpContent.ReadAsStringAsync(); + JsonNode? httpContentNode = JsonNode.Parse(contentString); + if (httpContentNode == null) { + throw new NotSupportedException("Failed to parse response to JsonNode."); + } + JsonNode responseNode = httpContentNode; + + if (this._apiClient.VertexAI) { + responseNode = DeleteModelResponseFromVertex(httpContentNode, new JsonObject()); + } + + if (!this._apiClient.VertexAI) { + responseNode = DeleteModelResponseFromMldev(httpContentNode, new JsonObject()); + } + + return JsonSerializer.Deserialize(responseNode.ToString()) ?? + throw new InvalidOperationException( + "Failed to deserialize Task."); + } + /// /// Counts the number of tokens in the provided content. /// @@ -3023,7 +3817,7 @@ public async Task SegmentImageAsync(string model, /// the total token count and other metadata. public async Task CountTokensAsync(string model, List contents, - CountTokensConfig config) { + CountTokensConfig? config = null) { CountTokensParameters parameter = new CountTokensParameters(); if (!Common.IsZero(model)) { @@ -3090,9 +3884,8 @@ public async Task CountTokensAsync(string model, List instance with token information. Thrown when called with a non-Vertex AI client. - public async Task ComputeTokensAsync(string model, - List contents, - ComputeTokensConfig config) { + public async Task ComputeTokensAsync( + string model, List contents, ComputeTokensConfig? config = null) { ComputeTokensParameters parameter = new ComputeTokensParameters(); if (!Common.IsZero(model)) { @@ -3371,5 +4164,33 @@ public async Task ComputeTokensAsync( List contentList = Transformers.TContents(contents) ?? new List(); return await ComputeTokensAsync(model, contentList, config); } + + /// + /// Calculates embeddings for the given content. Only text is supported. + /// + /// The model to use. + /// The content to embed. + /// Optional configuration for embeddings. + /// A that represents the asynchronous + /// operation. + public async Task EmbedContentAsync(string model, Content contents, + EmbedContentConfig? config = null) { + List contentList = Transformers.TContents(contents) ?? new List(); + return await EmbedContentAsync(model, contentList, config); + } + + /// + /// Calculates embeddings for the given text string. + /// + /// The model to use. + /// The text string to embed. + /// Optional configuration for embeddings. + /// A that represents the asynchronous + /// operation. + public async Task EmbedContentAsync(string model, String contents, + EmbedContentConfig? config = null) { + List contentList = Transformers.TContents(contents) ?? new List(); + return await EmbedContentAsync(model, contentList, config); + } } } diff --git a/Google.GenAI/README.md b/Google.GenAI/README.md index 7aa1083d..51ae0702 100644 --- a/Google.GenAI/README.md +++ b/Google.GenAI/README.md @@ -445,3 +445,83 @@ public class ComputeTokensExample { } ``` + +### Embed Content + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class EmbedContentExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + var response = await client.Models.EmbedContentAsync( + model: "text-embedding-004", + contents: "What is the capital of France?" + ); + + Console.WriteLine(response.Embeddings[0].Values); + } +} +``` + +### Get Tuned Model + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class GetModelExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + var response = await client.Models.GetAsync( + model: "models/your-tuned-model" + ); + + Console.WriteLine(response.DisplayName); + } +} +``` + +### Update Tuned Model + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class UpdateModelExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + var response = await client.Models.UpdateAsync( + model: "models/your-tuned-model", + config: new UpdateModelConfig { Description = "updated model description" } + ); + + Console.WriteLine(response.Description); + } +} +``` + +### Delete Tuned Model + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class DeleteModelExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + await client.Models.DeleteAsync( + model: "models/your-tuned-model" + ); + } +} +``` \ No newline at end of file diff --git a/Google.GenAI/Transformers.cs b/Google.GenAI/Transformers.cs index 593dacec..084de3d5 100644 --- a/Google.GenAI/Transformers.cs +++ b/Google.GenAI/Transformers.cs @@ -399,50 +399,50 @@ internal static object TBytes(object origin) /// Transforms an object to a list of Content for the embedding API. internal static List? TContentsForEmbed(ApiClient apiClient, object origin) { - if (origin == null) - { - return null; - } + if (origin == null) + { + return null; + } - List? contents; - if (origin is List contentList) - { - contents = contentList; - } - /*else if (origin is JsonObject jsonObject) - { - contents = jsonObject.ToObject>(); - }*/ - else - { - throw new ArgumentException($"Unsupported contents type: {origin.GetType()}"); - } + List? contents; + if (origin is List contentList) + { + contents = contentList; + } + else if (origin is JsonNode jsonNode) + { + contents = JsonSerializer.Deserialize>(jsonNode.ToJsonString()); + } + else + { + throw new ArgumentException($"Unsupported contents type: {origin.GetType()}"); + } - List result = new List(); - if (contents != null) - { - foreach (Content content in contents) + List result = new List(); + if (contents != null) { - if (!apiClient.VertexAI) - { - result.Add(content); - } - else - { - if (content.Parts != null) + foreach (Content content in contents) { - foreach (Part part in content.Parts) - { - if (part.Text != null) + if (!apiClient.VertexAI) { - result.Add(part.Text); + result.Add(content); + } + else + { + if (content.Parts != null) + { + foreach (Part part in content.Parts) + { + if (part.Text != null) + { + result.Add(part.Text); + } + } + } } - } } - } } - } - return result; + return result; } /// diff --git a/Google.GenAI/types/Checkpoint.cs b/Google.GenAI/types/Checkpoint.cs new file mode 100644 index 00000000..91070e0f --- /dev/null +++ b/Google.GenAI/types/Checkpoint.cs @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Describes the machine learning model version checkpoint. + /// + + public record Checkpoint { + /// + /// The ID of the checkpoint. + /// + [JsonPropertyName("checkpointId")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? CheckpointId { get; set; } + + /// + /// The epoch of the checkpoint. + /// + [JsonPropertyName("epoch")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonConverter(typeof(StringToNullableLongConverter))] + public long + ? Epoch { + get; set; + } + + /// + /// The step of the checkpoint. + /// + [JsonPropertyName("step")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonConverter(typeof(StringToNullableLongConverter))] + public long + ? Step { + get; set; + } + + /// + /// Deserializes a JSON string to a Checkpoint object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized Checkpoint object, or null if deserialization fails. + public static Checkpoint ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/DeleteModelConfig.cs b/Google.GenAI/types/DeleteModelConfig.cs new file mode 100644 index 00000000..9b753025 --- /dev/null +++ b/Google.GenAI/types/DeleteModelConfig.cs @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Configuration for deleting a tuned model. + /// + + public record DeleteModelConfig { + /// + /// Used to override HTTP request options. + /// + [JsonPropertyName("httpOptions")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public HttpOptions ? HttpOptions { get; set; } + + /// + /// Deserializes a JSON string to a DeleteModelConfig object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized DeleteModelConfig object, or null if deserialization + /// fails. + public static DeleteModelConfig + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/DeleteModelParameters.cs b/Google.GenAI/types/DeleteModelParameters.cs new file mode 100644 index 00000000..f1cc3c0e --- /dev/null +++ b/Google.GenAI/types/DeleteModelParameters.cs @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Parameters for deleting a tuned model. + /// + + internal record DeleteModelParameters { + /// + /// + /// + [JsonPropertyName("model")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? Model { get; set; } + + /// + /// Optional parameters for the request. + /// + [JsonPropertyName("config")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DeleteModelConfig + ? Config { + get; set; + } + + /// + /// Deserializes a JSON string to a DeleteModelParameters object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized DeleteModelParameters object, or null if deserialization + /// fails. + public static DeleteModelParameters + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/DeleteModelResponse.cs b/Google.GenAI/types/DeleteModelResponse.cs new file mode 100644 index 00000000..68608e08 --- /dev/null +++ b/Google.GenAI/types/DeleteModelResponse.cs @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + + public record DeleteModelResponse { + /// + /// Used to retain the full HTTP response. + /// + [JsonPropertyName("sdkHttpResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public HttpResponse ? SdkHttpResponse { get; set; } + + /// + /// Deserializes a JSON string to a DeleteModelResponse object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized DeleteModelResponse object, or null if deserialization + /// fails. + public static DeleteModelResponse + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/EmbedContentMetadata.cs b/Google.GenAI/types/EmbedContentMetadata.cs new file mode 100644 index 00000000..dcca53ae --- /dev/null +++ b/Google.GenAI/types/EmbedContentMetadata.cs @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Request-level metadata for the Vertex Embed Content API. + /// + + public record EmbedContentMetadata { + /// + /// Vertex API only. The total number of billable characters included in the request. + /// + [JsonPropertyName("billableCharacterCount")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int ? BillableCharacterCount { get; set; } + + /// + /// Deserializes a JSON string to a EmbedContentMetadata object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized EmbedContentMetadata object, or null if deserialization + /// fails. + public static EmbedContentMetadata + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/EmbedContentParameters.cs b/Google.GenAI/types/EmbedContentParameters.cs new file mode 100644 index 00000000..3d77e5a9 --- /dev/null +++ b/Google.GenAI/types/EmbedContentParameters.cs @@ -0,0 +1,75 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Parameters for the embed_content method. + /// + + internal record EmbedContentParameters { + /// + /// ID of the model to use. For a list of models, see Google models + /// (https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models). + /// + [JsonPropertyName("model")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? Model { get; set; } + + /// + /// The content to embed. Only the `parts.text` fields will be counted. + /// + [JsonPropertyName("contents")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List + ? Contents { + get; set; + } + + /// + /// Configuration that contains optional parameters. + /// + [JsonPropertyName("config")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public EmbedContentConfig + ? Config { + get; set; + } + + /// + /// Deserializes a JSON string to a EmbedContentParameters object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized EmbedContentParameters object, or null if deserialization + /// fails. + public static EmbedContentParameters + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/EmbedContentResponse.cs b/Google.GenAI/types/EmbedContentResponse.cs new file mode 100644 index 00000000..02c6ede1 --- /dev/null +++ b/Google.GenAI/types/EmbedContentResponse.cs @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Response for the embed_content method. + /// + + public record EmbedContentResponse { + /// + /// Used to retain the full HTTP response. + /// + [JsonPropertyName("sdkHttpResponse")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public HttpResponse ? SdkHttpResponse { get; set; } + + /// + /// The embeddings for each request, in the same order as provided in the batch request. + /// + [JsonPropertyName("embeddings")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List + ? Embeddings { + get; set; + } + + /// + /// Vertex API only. Metadata about the request. + /// + [JsonPropertyName("metadata")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public EmbedContentMetadata + ? Metadata { + get; set; + } + + /// + /// Deserializes a JSON string to a EmbedContentResponse object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized EmbedContentResponse object, or null if deserialization + /// fails. + public static EmbedContentResponse + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/Endpoint.cs b/Google.GenAI/types/Endpoint.cs new file mode 100644 index 00000000..04cf4b9b --- /dev/null +++ b/Google.GenAI/types/Endpoint.cs @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// An endpoint where you deploy models. + /// + + public record Endpoint { + /// + /// Resource name of the endpoint. + /// + [JsonPropertyName("name")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? Name { get; set; } + + /// + /// ID of the model that's deployed to the endpoint. + /// + [JsonPropertyName("deployedModelId")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? DeployedModelId { + get; set; + } + + /// + /// Deserializes a JSON string to a Endpoint object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized Endpoint object, or null if deserialization fails. + public static Endpoint ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/GetModelConfig.cs b/Google.GenAI/types/GetModelConfig.cs new file mode 100644 index 00000000..bbc82b16 --- /dev/null +++ b/Google.GenAI/types/GetModelConfig.cs @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Optional parameters for models.get method. + /// + + public record GetModelConfig { + /// + /// Used to override HTTP request options. + /// + [JsonPropertyName("httpOptions")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public HttpOptions ? HttpOptions { get; set; } + + /// + /// Deserializes a JSON string to a GetModelConfig object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized GetModelConfig object, or null if deserialization fails. + public static GetModelConfig + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/GetModelParameters.cs b/Google.GenAI/types/GetModelParameters.cs new file mode 100644 index 00000000..70b977f2 --- /dev/null +++ b/Google.GenAI/types/GetModelParameters.cs @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + + internal record GetModelParameters { + /// + /// + /// + [JsonPropertyName("model")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? Model { get; set; } + + /// + /// Optional parameters for the request. + /// + [JsonPropertyName("config")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public GetModelConfig + ? Config { + get; set; + } + + /// + /// Deserializes a JSON string to a GetModelParameters object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized GetModelParameters object, or null if deserialization + /// fails. + public static GetModelParameters + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/Model.cs b/Google.GenAI/types/Model.cs new file mode 100644 index 00000000..81631351 --- /dev/null +++ b/Google.GenAI/types/Model.cs @@ -0,0 +1,225 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// A trained machine learning model. + /// + + public record Model { + /// + /// Resource name of the model. + /// + [JsonPropertyName("name")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? Name { get; set; } + + /// + /// Display name of the model. + /// + [JsonPropertyName("displayName")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? DisplayName { + get; set; + } + + /// + /// Description of the model. + /// + [JsonPropertyName("description")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? Description { + get; set; + } + + /// + /// Version ID of the model. A new version is committed when a new model version is uploaded or + /// trained under an existing model ID. The version ID is an auto-incrementing decimal number in + /// string representation. + /// + [JsonPropertyName("version")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? Version { + get; set; + } + + /// + /// List of deployed models created from this base model. Note that a model could have been + /// deployed to endpoints in different locations. + /// + [JsonPropertyName("endpoints")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List + ? Endpoints { + get; set; + } + + /// + /// Labels with user-defined metadata to organize your models. + /// + [JsonPropertyName("labels")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Dictionary + ? Labels { + get; set; + } + + /// + /// Information about the tuned model from the base model. + /// + [JsonPropertyName("tunedModelInfo")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public TunedModelInfo + ? TunedModelInfo { + get; set; + } + + /// + /// The maximum number of input tokens that the model can handle. + /// + [JsonPropertyName("inputTokenLimit")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int + ? InputTokenLimit { + get; set; + } + + /// + /// The maximum number of output tokens that the model can generate. + /// + [JsonPropertyName("outputTokenLimit")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int + ? OutputTokenLimit { + get; set; + } + + /// + /// List of actions that are supported by the model. + /// + [JsonPropertyName("supportedActions")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List + ? SupportedActions { + get; set; + } + + /// + /// The default checkpoint id of a model version. + /// + [JsonPropertyName("defaultCheckpointId")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? DefaultCheckpointId { + get; set; + } + + /// + /// The checkpoints of the model. + /// + [JsonPropertyName("checkpoints")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List + ? Checkpoints { + get; set; + } + + /// + /// Temperature value used for sampling set when the dataset was saved. This value is used to + /// tune the degree of randomness. + /// + [JsonPropertyName("temperature")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double + ? Temperature { + get; set; + } + + /// + /// The maximum temperature value used for sampling set when the dataset was saved. This value + /// is used to tune the degree of randomness. + /// + [JsonPropertyName("maxTemperature")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double + ? MaxTemperature { + get; set; + } + + /// + /// Optional. Specifies the nucleus sampling threshold. The model considers only the smallest + /// set of tokens whose cumulative probability is at least `top_p`. This helps generate more + /// diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model + /// considers tokens until the cumulative probability of the tokens to select from reaches 0.9. + /// It's recommended to adjust either temperature or `top_p`, but not both. + /// + [JsonPropertyName("topP")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public double + ? TopP { + get; set; + } + + /// + /// Optional. Specifies the top-k sampling threshold. The model considers only the top k most + /// probable tokens for the next token. This can be useful for generating more coherent and less + /// random text. For example, a `top_k` of 40 means the model will choose the next word from the + /// 40 most likely words. + /// + [JsonPropertyName("topK")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public int + ? TopK { + get; set; + } + + /// + /// Whether the model supports thinking features. If true, thoughts are returned only if the + /// model supports thought and thoughts are available. + /// + [JsonPropertyName("thinking")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public bool + ? Thinking { + get; set; + } + + /// + /// Deserializes a JSON string to a Model object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized Model object, or null if deserialization fails. + public static Model ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/TunedModelInfo.cs b/Google.GenAI/types/TunedModelInfo.cs new file mode 100644 index 00000000..05850471 --- /dev/null +++ b/Google.GenAI/types/TunedModelInfo.cs @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// A tuned machine learning model. + /// + + public record TunedModelInfo { + /// + /// ID of the base model that you want to tune. + /// + [JsonPropertyName("baseModel")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? BaseModel { get; set; } + + /// + /// Date and time when the base model was created. + /// + [JsonPropertyName("createTime")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DateTime + ? CreateTime { + get; set; + } + + /// + /// Date and time when the base model was last updated. + /// + [JsonPropertyName("updateTime")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DateTime + ? UpdateTime { + get; set; + } + + /// + /// Deserializes a JSON string to a TunedModelInfo object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized TunedModelInfo object, or null if deserialization fails. + public static TunedModelInfo + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/UpdateModelConfig.cs b/Google.GenAI/types/UpdateModelConfig.cs new file mode 100644 index 00000000..cde6121b --- /dev/null +++ b/Google.GenAI/types/UpdateModelConfig.cs @@ -0,0 +1,84 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Configuration for updating a tuned model. + /// + + public record UpdateModelConfig { + /// + /// Used to override HTTP request options. + /// + [JsonPropertyName("httpOptions")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public HttpOptions ? HttpOptions { get; set; } + + /// + /// + /// + [JsonPropertyName("displayName")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? DisplayName { + get; set; + } + + /// + /// + /// + [JsonPropertyName("description")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? Description { + get; set; + } + + /// + /// + /// + [JsonPropertyName("defaultCheckpointId")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string + ? DefaultCheckpointId { + get; set; + } + + /// + /// Deserializes a JSON string to a UpdateModelConfig object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized UpdateModelConfig object, or null if deserialization + /// fails. + public static UpdateModelConfig + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/Google.GenAI/types/UpdateModelParameters.cs b/Google.GenAI/types/UpdateModelParameters.cs new file mode 100644 index 00000000..51f43c1b --- /dev/null +++ b/Google.GenAI/types/UpdateModelParameters.cs @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Auto-generated code. Do not edit. + +using System; +using System.Text.Json; +using System.Text.Json.Serialization; +using Google.GenAI.Serialization; + +namespace Google.GenAI.Types { + /// + /// Configuration for updating a tuned model. + /// + + internal record UpdateModelParameters { + /// + /// + /// + [JsonPropertyName("model")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ? Model { get; set; } + + /// + /// + /// + [JsonPropertyName("config")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public UpdateModelConfig + ? Config { + get; set; + } + + /// + /// Deserializes a JSON string to a UpdateModelParameters object. + /// + /// The JSON string to deserialize. + /// Optional JsonSerializerOptions. + /// The deserialized UpdateModelParameters object, or null if deserialization + /// fails. + public static UpdateModelParameters + ? FromJson(string jsonString, JsonSerializerOptions? options = null) { + try { + return JsonSerializer.Deserialize(jsonString, options); + } catch (JsonException e) { + Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}"); + return null; + } + } + } +} diff --git a/README.md b/README.md index 7aa1083d..51ae0702 100644 --- a/README.md +++ b/README.md @@ -445,3 +445,83 @@ public class ComputeTokensExample { } ``` + +### Embed Content + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class EmbedContentExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + var response = await client.Models.EmbedContentAsync( + model: "text-embedding-004", + contents: "What is the capital of France?" + ); + + Console.WriteLine(response.Embeddings[0].Values); + } +} +``` + +### Get Tuned Model + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class GetModelExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + var response = await client.Models.GetAsync( + model: "models/your-tuned-model" + ); + + Console.WriteLine(response.DisplayName); + } +} +``` + +### Update Tuned Model + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class UpdateModelExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + var response = await client.Models.UpdateAsync( + model: "models/your-tuned-model", + config: new UpdateModelConfig { Description = "updated model description" } + ); + + Console.WriteLine(response.Description); + } +} +``` + +### Delete Tuned Model + +```csharp +using Google.GenAI; +using Google.GenAI.Types; + +public class DeleteModelExample { + public static async Task main() { + // assuming credentials are set up in environment variables as instructed above. + var client = new Client(); + + await client.Models.DeleteAsync( + model: "models/your-tuned-model" + ); + } +} +``` \ No newline at end of file