Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public async Task EvaluateInstancesRequestObjectAsync()
LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ExactMatchInput = new ExactMatchInput(),
AutoraterConfig = new AutoraterConfig(),
Metrics = { new Metric(), },
Instance = new EvaluationInstance(),
MetricSources = { new MetricSource(), },
};
// Make the request
EvaluateInstancesResponse response = await evaluationServiceClient.EvaluateInstancesAsync(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public void EvaluateInstancesRequestObject()
LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
ExactMatchInput = new ExactMatchInput(),
AutoraterConfig = new AutoraterConfig(),
Metrics = { new Metric(), },
Instance = new EvaluationInstance(),
MetricSources = { new MetricSource(), },
};
// Make the request
EvaluateInstancesResponse response = evaluationServiceClient.EvaluateInstances(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright 2026 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.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_async]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.AIPlatform.V1Beta1;
using System.Threading.Tasks;

public sealed partial class GeneratedEvaluationServiceClientSnippets
{
/// <summary>Snippet for GenerateInstanceRubricsAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task GenerateInstanceRubricsRequestObjectAsync()
{
// Create client
EvaluationServiceClient evaluationServiceClient = await EvaluationServiceClient.CreateAsync();
// Initialize request argument(s)
GenerateInstanceRubricsRequest request = new GenerateInstanceRubricsRequest
{
LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Contents = { new Content(), },
RubricGenerationSpec = new RubricGenerationSpec(),
PredefinedRubricGenerationSpec = new PredefinedMetricSpec(),
#pragma warning disable CS0612
AgentConfig = new EvaluationInstance.Types.DeprecatedAgentConfig(),
#pragma warning restore CS0612
};
// Make the request
GenerateInstanceRubricsResponse response = await evaluationServiceClient.GenerateInstanceRubricsAsync(request);
}
}
// [END aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright 2026 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.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_sync]
using Google.Api.Gax.ResourceNames;
using Google.Cloud.AIPlatform.V1Beta1;

public sealed partial class GeneratedEvaluationServiceClientSnippets
{
/// <summary>Snippet for GenerateInstanceRubrics</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void GenerateInstanceRubricsRequestObject()
{
// Create client
EvaluationServiceClient evaluationServiceClient = EvaluationServiceClient.Create();
// Initialize request argument(s)
GenerateInstanceRubricsRequest request = new GenerateInstanceRubricsRequest
{
LocationAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Contents = { new Content(), },
RubricGenerationSpec = new RubricGenerationSpec(),
PredefinedRubricGenerationSpec = new PredefinedMetricSpec(),
#pragma warning disable CS0612
AgentConfig = new EvaluationInstance.Types.DeprecatedAgentConfig(),
#pragma warning restore CS0612
};
// Make the request
GenerateInstanceRubricsResponse response = evaluationServiceClient.GenerateInstanceRubrics(request);
}
}
// [END aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2026 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.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async_flattened]
using Google.Cloud.AIPlatform.V1Beta1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedOnlineEvaluatorServiceClientSnippets
{
/// <summary>Snippet for ActivateOnlineEvaluatorAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task ActivateOnlineEvaluatorAsync()
{
// Create client
OnlineEvaluatorServiceClient onlineEvaluatorServiceClient = await OnlineEvaluatorServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/onlineEvaluators/[ONLINE_EVALUATOR]";
// Make the request
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> response = await onlineEvaluatorServiceClient.ActivateOnlineEvaluatorAsync(name);

// Poll until the returned long-running operation is complete
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OnlineEvaluator result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> retrievedResponse = await onlineEvaluatorServiceClient.PollOnceActivateOnlineEvaluatorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
OnlineEvaluator retrievedResult = retrievedResponse.Result;
}
}
}
// [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2026 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.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async]
using Google.Cloud.AIPlatform.V1Beta1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedOnlineEvaluatorServiceClientSnippets
{
/// <summary>Snippet for ActivateOnlineEvaluatorAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task ActivateOnlineEvaluatorRequestObjectAsync()
{
// Create client
OnlineEvaluatorServiceClient onlineEvaluatorServiceClient = await OnlineEvaluatorServiceClient.CreateAsync();
// Initialize request argument(s)
ActivateOnlineEvaluatorRequest request = new ActivateOnlineEvaluatorRequest
{
OnlineEvaluatorName = OnlineEvaluatorName.FromProjectLocationOnlineEvaluator("[PROJECT]", "[LOCATION]", "[ONLINE_EVALUATOR]"),
};
// Make the request
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> response = await onlineEvaluatorServiceClient.ActivateOnlineEvaluatorAsync(request);

// Poll until the returned long-running operation is complete
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OnlineEvaluator result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> retrievedResponse = await onlineEvaluatorServiceClient.PollOnceActivateOnlineEvaluatorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
OnlineEvaluator retrievedResult = retrievedResponse.Result;
}
}
}
// [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2026 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.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_sync]
using Google.Cloud.AIPlatform.V1Beta1;
using Google.LongRunning;

public sealed partial class GeneratedOnlineEvaluatorServiceClientSnippets
{
/// <summary>Snippet for ActivateOnlineEvaluator</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void ActivateOnlineEvaluatorRequestObject()
{
// Create client
OnlineEvaluatorServiceClient onlineEvaluatorServiceClient = OnlineEvaluatorServiceClient.Create();
// Initialize request argument(s)
ActivateOnlineEvaluatorRequest request = new ActivateOnlineEvaluatorRequest
{
OnlineEvaluatorName = OnlineEvaluatorName.FromProjectLocationOnlineEvaluator("[PROJECT]", "[LOCATION]", "[ONLINE_EVALUATOR]"),
};
// Make the request
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> response = onlineEvaluatorServiceClient.ActivateOnlineEvaluator(request);

// Poll until the returned long-running operation is complete
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
OnlineEvaluator result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> retrievedResponse = onlineEvaluatorServiceClient.PollOnceActivateOnlineEvaluator(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
OnlineEvaluator retrievedResult = retrievedResponse.Result;
}
}
}
// [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2026 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.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async_flattened_resourceNames]
using Google.Cloud.AIPlatform.V1Beta1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedOnlineEvaluatorServiceClientSnippets
{
/// <summary>Snippet for ActivateOnlineEvaluatorAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task ActivateOnlineEvaluatorResourceNamesAsync()
{
// Create client
OnlineEvaluatorServiceClient onlineEvaluatorServiceClient = await OnlineEvaluatorServiceClient.CreateAsync();
// Initialize request argument(s)
OnlineEvaluatorName name = OnlineEvaluatorName.FromProjectLocationOnlineEvaluator("[PROJECT]", "[LOCATION]", "[ONLINE_EVALUATOR]");
// Make the request
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> response = await onlineEvaluatorServiceClient.ActivateOnlineEvaluatorAsync(name);

// Poll until the returned long-running operation is complete
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
OnlineEvaluator result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<OnlineEvaluator, ActivateOnlineEvaluatorOperationMetadata> retrievedResponse = await onlineEvaluatorServiceClient.PollOnceActivateOnlineEvaluatorAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
OnlineEvaluator retrievedResult = retrievedResponse.Result;
}
}
}
// [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async_flattened_resourceNames]
}
Loading
Loading