Skip to content

Commit 39b7e6c

Browse files
speedstorm1copybara-github
authored andcommitted
feat: Add support for Tunings.tune() and Tunings.get() in Dotnet SDK
PiperOrigin-RevId: 835366384
1 parent a3b8c21 commit 39b7e6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5299
-14
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"recordID": "GetTest.GetGeminiTest",
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "GET",
7+
"url": "/v1beta/tuningJobs/4028554580617854976",
8+
"request": "GET /v1beta/tuningJobs/4028554580617854976 HTTP/1.1",
9+
"headers": {
10+
"Test-Name": "GetTest.GetGeminiTest"
11+
},
12+
"bodySegments": [
13+
null
14+
],
15+
"previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d",
16+
"serverAddress": "generativelanguage.googleapis.com",
17+
"port": 443,
18+
"protocol": "https"
19+
},
20+
"shaSum": "cdc7bc88a3dfc9a0fbe3a9d68508b68a6749698c6d893d3c79b8526873c83237",
21+
"response": {
22+
"statusCode": 404,
23+
"headers": {
24+
"Content-Length": "0",
25+
"Content-Type": "text/html",
26+
"Date": "Thu, 20 Nov 2025 19:13:02 GMT",
27+
"Server": "scaffolding on HTTPServer2",
28+
"Server-Timing": "gfet4t7; dur=213",
29+
"X-Content-Type-Options": "nosniff",
30+
"X-Frame-Options": "SAMEORIGIN",
31+
"X-Xss-Protection": "0"
32+
}
33+
}
34+
}
35+
]
36+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"recordID": "GetTest.GetVertexTest",
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "GET",
7+
"url": "/v1beta1/projects/REDACTED/locations/us-central1/tuningJobs/4028554580617854976",
8+
"request": "GET /v1beta1/projects/REDACTED/locations/us-central1/tuningJobs/4028554580617854976 HTTP/1.1",
9+
"headers": {
10+
"Test-Name": "GetTest.GetVertexTest"
11+
},
12+
"bodySegments": [
13+
null
14+
],
15+
"previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d",
16+
"serverAddress": "us-central1-aiplatform.googleapis.com",
17+
"port": 443,
18+
"protocol": "https"
19+
},
20+
"shaSum": "ee365c42714172af1f334519b30ae1521a880c29224242e8ac34776e86c506bd",
21+
"response": {
22+
"statusCode": 200,
23+
"headers": {
24+
"Content-Type": "application/json; charset=UTF-8",
25+
"Date": "Thu, 20 Nov 2025 19:13:01 GMT",
26+
"Server": "ESF",
27+
"Vary": "Origin, X-Origin, Referer",
28+
"X-Content-Type-Options": "nosniff",
29+
"X-Frame-Options": "SAMEORIGIN",
30+
"X-Xss-Protection": "0"
31+
},
32+
"bodySegments": [
33+
{
34+
"baseModel": "gemini-2.5-flash",
35+
"createTime": "2025-11-20T18:58:05.081466Z",
36+
"name": "projects/REDACTED/locations/us-central1/tuningJobs/4028554580617854976",
37+
"preferenceOptimizationSpec": {
38+
"hyperParameters": {
39+
"beta": 0.5,
40+
"epochCount": "1"
41+
},
42+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
43+
},
44+
"startTime": "2025-11-20T18:58:05.418818Z",
45+
"state": "JOB_STATE_RUNNING",
46+
"tunedModelDisplayName": "Model display name",
47+
"updateTime": "2025-11-20T18:58:05.418818Z"
48+
}
49+
]
50+
}
51+
}
52+
]
53+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"recordID": "TuneTest.TunePreferenceTuningVertexTest",
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "POST",
7+
"url": "/v1beta1/projects/REDACTED/locations/us-central1/tuningJobs",
8+
"request": "POST /v1beta1/projects/REDACTED/locations/us-central1/tuningJobs HTTP/1.1",
9+
"headers": {
10+
"Content-Length": "253",
11+
"Content-Type": "application/json; charset=utf-8",
12+
"Test-Name": "TuneTest.TunePreferenceTuningVertexTest"
13+
},
14+
"bodySegments": [
15+
{
16+
"baseModel": "gemini-2.5-flash",
17+
"preferenceOptimizationSpec": {
18+
"hyperParameters": {
19+
"epochCount": 1
20+
},
21+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
22+
},
23+
"tunedModelDisplayName": "Model display name"
24+
}
25+
],
26+
"previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d",
27+
"serverAddress": "us-central1-aiplatform.googleapis.com",
28+
"port": 443,
29+
"protocol": "https"
30+
},
31+
"shaSum": "be0987809227c8ca68f9e2afbcdf6c1b92f1c726facc682c3df359d1feb77f81",
32+
"response": {
33+
"statusCode": 200,
34+
"headers": {
35+
"Content-Type": "application/json; charset=UTF-8",
36+
"Date": "Thu, 20 Nov 2025 18:58:04 GMT",
37+
"Server": "ESF",
38+
"Vary": "Origin, X-Origin, Referer",
39+
"X-Content-Type-Options": "nosniff",
40+
"X-Frame-Options": "SAMEORIGIN",
41+
"X-Xss-Protection": "0"
42+
},
43+
"bodySegments": [
44+
{
45+
"baseModel": "gemini-2.5-flash",
46+
"createTime": "2025-11-20T18:58:04.754729Z",
47+
"name": "projects/REDACTED/locations/us-central1/tuningJobs/5580044652246990848",
48+
"preferenceOptimizationSpec": {
49+
"hyperParameters": {
50+
"epochCount": "1"
51+
},
52+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
53+
},
54+
"state": "JOB_STATE_PENDING",
55+
"tunedModelDisplayName": "Model display name",
56+
"updateTime": "2025-11-20T18:58:04.754729Z"
57+
}
58+
]
59+
}
60+
}
61+
]
62+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"recordID": "TuneTest.TunePreferenceTuningWithBetaVertexTest",
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "POST",
7+
"url": "/v1beta1/projects/REDACTED/locations/us-central1/tuningJobs",
8+
"request": "POST /v1beta1/projects/REDACTED/locations/us-central1/tuningJobs HTTP/1.1",
9+
"headers": {
10+
"Content-Length": "264",
11+
"Content-Type": "application/json; charset=utf-8",
12+
"Test-Name": "TuneTest.TunePreferenceTuningWithBetaVertexTest"
13+
},
14+
"bodySegments": [
15+
{
16+
"baseModel": "gemini-2.5-flash",
17+
"preferenceOptimizationSpec": {
18+
"hyperParameters": {
19+
"beta": 0.5,
20+
"epochCount": 1
21+
},
22+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
23+
},
24+
"tunedModelDisplayName": "Model display name"
25+
}
26+
],
27+
"previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d",
28+
"serverAddress": "us-central1-aiplatform.googleapis.com",
29+
"port": 443,
30+
"protocol": "https"
31+
},
32+
"shaSum": "6c7a9deeb35512f1467afb832d222665cb13a9cfb2c046ab9da915f3d872f34f",
33+
"response": {
34+
"statusCode": 200,
35+
"headers": {
36+
"Content-Type": "application/json; charset=UTF-8",
37+
"Date": "Thu, 20 Nov 2025 18:58:05 GMT",
38+
"Server": "ESF",
39+
"Vary": "Origin, X-Origin, Referer",
40+
"X-Content-Type-Options": "nosniff",
41+
"X-Frame-Options": "SAMEORIGIN",
42+
"X-Xss-Protection": "0"
43+
},
44+
"bodySegments": [
45+
{
46+
"baseModel": "gemini-2.5-flash",
47+
"createTime": "2025-11-20T18:58:05.081466Z",
48+
"name": "projects/REDACTED/locations/us-central1/tuningJobs/4028554580617854976",
49+
"preferenceOptimizationSpec": {
50+
"hyperParameters": {
51+
"beta": 0.5,
52+
"epochCount": "1"
53+
},
54+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
55+
},
56+
"state": "JOB_STATE_PENDING",
57+
"tunedModelDisplayName": "Model display name",
58+
"updateTime": "2025-11-20T18:58:05.081466Z"
59+
}
60+
]
61+
}
62+
}
63+
]
64+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"recordID": "TuneTest.TuneSimpleVertexTest",
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "POST",
7+
"url": "/v1beta1/projects/REDACTED/locations/us-central1/tuningJobs",
8+
"request": "POST /v1beta1/projects/REDACTED/locations/us-central1/tuningJobs HTTP/1.1",
9+
"headers": {
10+
"Content-Length": "202",
11+
"Content-Type": "application/json; charset=utf-8",
12+
"Test-Name": "TuneTest.TuneSimpleVertexTest"
13+
},
14+
"bodySegments": [
15+
{
16+
"baseModel": "gemini-2.5-flash",
17+
"supervisedTuningSpec": {
18+
"hyperParameters": {
19+
"epochCount": 1
20+
},
21+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
22+
}
23+
}
24+
],
25+
"previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d",
26+
"serverAddress": "us-central1-aiplatform.googleapis.com",
27+
"port": 443,
28+
"protocol": "https"
29+
},
30+
"shaSum": "57ef9e2e4aa06e088fd0f98d0d03e37f42947e397674a600c72a2f8f601e68ab",
31+
"response": {
32+
"statusCode": 200,
33+
"headers": {
34+
"Content-Type": "application/json; charset=UTF-8",
35+
"Date": "Thu, 20 Nov 2025 18:58:04 GMT",
36+
"Server": "ESF",
37+
"Vary": "Origin, X-Origin, Referer",
38+
"X-Content-Type-Options": "nosniff",
39+
"X-Frame-Options": "SAMEORIGIN",
40+
"X-Xss-Protection": "0"
41+
},
42+
"bodySegments": [
43+
{
44+
"baseModel": "gemini-2.5-flash",
45+
"createTime": "2025-11-20T18:58:04.300134Z",
46+
"name": "projects/REDACTED/locations/us-central1/tuningJobs/6185778802128322560",
47+
"state": "JOB_STATE_PENDING",
48+
"supervisedTuningSpec": {
49+
"hyperParameters": {
50+
"epochCount": "1"
51+
},
52+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl"
53+
},
54+
"tunedModelDisplayName": "gemini-2.5-flash-814842ca-424a-4473-b198-a1f07dfb02f5",
55+
"updateTime": "2025-11-20T18:58:04.300134Z"
56+
}
57+
]
58+
}
59+
}
60+
]
61+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"recordID": "TuneTest.TuneWithConfigVertexTest",
3+
"interactions": [
4+
{
5+
"request": {
6+
"method": "POST",
7+
"url": "/v1beta1/projects/REDACTED/locations/us-central1/tuningJobs",
8+
"request": "POST /v1beta1/projects/REDACTED/locations/us-central1/tuningJobs HTTP/1.1",
9+
"headers": {
10+
"Content-Length": "386",
11+
"Content-Type": "application/json; charset=utf-8",
12+
"Test-Name": "TuneTest.TuneWithConfigVertexTest"
13+
},
14+
"bodySegments": [
15+
{
16+
"baseModel": "gemini-2.5-flash",
17+
"supervisedTuningSpec": {
18+
"hyperParameters": {
19+
"epochCount": 3,
20+
"learningRateMultiplier": 0.5
21+
},
22+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_train_data.jsonl",
23+
"validationDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_validation_data.jsonl"
24+
},
25+
"tunedModelDisplayName": "Tuned Model"
26+
}
27+
],
28+
"previousRequest": "b4d6e60a9b97e7b98c63df9308728c5c88c0b40c398046772c63447b94608b4d",
29+
"serverAddress": "us-central1-aiplatform.googleapis.com",
30+
"port": 443,
31+
"protocol": "https"
32+
},
33+
"shaSum": "98b4981830e9c437a3c86d6167fa96d03a9c07fa3120cdfc80b5ff5cb1b6ec2d",
34+
"response": {
35+
"statusCode": 200,
36+
"headers": {
37+
"Content-Type": "application/json; charset=UTF-8",
38+
"Date": "Thu, 20 Nov 2025 18:58:05 GMT",
39+
"Server": "ESF",
40+
"Vary": "Origin, X-Origin, Referer",
41+
"X-Content-Type-Options": "nosniff",
42+
"X-Frame-Options": "SAMEORIGIN",
43+
"X-Xss-Protection": "0"
44+
},
45+
"bodySegments": [
46+
{
47+
"baseModel": "gemini-2.5-flash",
48+
"createTime": "2025-11-20T18:58:05.448945Z",
49+
"name": "projects/REDACTED/locations/us-central1/tuningJobs/1981668549977964544",
50+
"state": "JOB_STATE_PENDING",
51+
"supervisedTuningSpec": {
52+
"hyperParameters": {
53+
"epochCount": "3",
54+
"learningRateMultiplier": 0.5
55+
},
56+
"trainingDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_train_data.jsonl",
57+
"validationDatasetUri": "gs://cloud-samples-data/ai-platform/generative_ai/gemini-2_0/text/sft_validation_data.jsonl"
58+
},
59+
"tunedModelDisplayName": "Tuned Model",
60+
"updateTime": "2025-11-20T18:58:05.448945Z"
61+
}
62+
]
63+
}
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)