|
16 | 16 |
|
17 | 17 | namespace Google.Cloud.AIPlatform.V1.Snippets
|
18 | 18 | {
|
| 19 | + using Google.Api; |
19 | 20 | using Google.Protobuf.WellKnownTypes;
|
20 | 21 | using System.Collections.Generic;
|
21 | 22 | using System.Threading.Tasks;
|
@@ -121,5 +122,205 @@ public async Task PredictResourceNamesAsync()
|
121 | 122 | PredictResponse response = await predictionServiceClient.PredictAsync(endpoint, instances, parameters);
|
122 | 123 | // End snippet
|
123 | 124 | }
|
| 125 | + |
| 126 | + //github.com/ <summary>Snippet for RawPredict</summary> |
| 127 | + public void RawPredictRequestObject() |
| 128 | + { |
| 129 | + // Snippet: RawPredict(RawPredictRequest, CallSettings) |
| 130 | + // Create client |
| 131 | + PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create(); |
| 132 | + // Initialize request argument(s) |
| 133 | + RawPredictRequest request = new RawPredictRequest |
| 134 | + { |
| 135 | + EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"), |
| 136 | + HttpBody = new HttpBody(), |
| 137 | + }; |
| 138 | + // Make the request |
| 139 | + HttpBody response = predictionServiceClient.RawPredict(request); |
| 140 | + // End snippet |
| 141 | + } |
| 142 | + |
| 143 | + //github.com/ <summary>Snippet for RawPredictAsync</summary> |
| 144 | + public async Task RawPredictRequestObjectAsync() |
| 145 | + { |
| 146 | + // Snippet: RawPredictAsync(RawPredictRequest, CallSettings) |
| 147 | + // Additional: RawPredictAsync(RawPredictRequest, CancellationToken) |
| 148 | + // Create client |
| 149 | + PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync(); |
| 150 | + // Initialize request argument(s) |
| 151 | + RawPredictRequest request = new RawPredictRequest |
| 152 | + { |
| 153 | + EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"), |
| 154 | + HttpBody = new HttpBody(), |
| 155 | + }; |
| 156 | + // Make the request |
| 157 | + HttpBody response = await predictionServiceClient.RawPredictAsync(request); |
| 158 | + // End snippet |
| 159 | + } |
| 160 | + |
| 161 | + //github.com/ <summary>Snippet for RawPredict</summary> |
| 162 | + public void RawPredict() |
| 163 | + { |
| 164 | + // Snippet: RawPredict(string, HttpBody, CallSettings) |
| 165 | + // Create client |
| 166 | + PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create(); |
| 167 | + // Initialize request argument(s) |
| 168 | + string endpoint = "projects/[PROJECT]/locations/[LOCATION]/endpoints/[ENDPOINT]"; |
| 169 | + HttpBody httpBody = new HttpBody(); |
| 170 | + // Make the request |
| 171 | + HttpBody response = predictionServiceClient.RawPredict(endpoint, httpBody); |
| 172 | + // End snippet |
| 173 | + } |
| 174 | + |
| 175 | + //github.com/ <summary>Snippet for RawPredictAsync</summary> |
| 176 | + public async Task RawPredictAsync() |
| 177 | + { |
| 178 | + // Snippet: RawPredictAsync(string, HttpBody, CallSettings) |
| 179 | + // Additional: RawPredictAsync(string, HttpBody, CancellationToken) |
| 180 | + // Create client |
| 181 | + PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync(); |
| 182 | + // Initialize request argument(s) |
| 183 | + string endpoint = "projects/[PROJECT]/locations/[LOCATION]/endpoints/[ENDPOINT]"; |
| 184 | + HttpBody httpBody = new HttpBody(); |
| 185 | + // Make the request |
| 186 | + HttpBody response = await predictionServiceClient.RawPredictAsync(endpoint, httpBody); |
| 187 | + // End snippet |
| 188 | + } |
| 189 | + |
| 190 | + //github.com/ <summary>Snippet for RawPredict</summary> |
| 191 | + public void RawPredictResourceNames() |
| 192 | + { |
| 193 | + // Snippet: RawPredict(EndpointName, HttpBody, CallSettings) |
| 194 | + // Create client |
| 195 | + PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create(); |
| 196 | + // Initialize request argument(s) |
| 197 | + EndpointName endpoint = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); |
| 198 | + HttpBody httpBody = new HttpBody(); |
| 199 | + // Make the request |
| 200 | + HttpBody response = predictionServiceClient.RawPredict(endpoint, httpBody); |
| 201 | + // End snippet |
| 202 | + } |
| 203 | + |
| 204 | + //github.com/ <summary>Snippet for RawPredictAsync</summary> |
| 205 | + public async Task RawPredictResourceNamesAsync() |
| 206 | + { |
| 207 | + // Snippet: RawPredictAsync(EndpointName, HttpBody, CallSettings) |
| 208 | + // Additional: RawPredictAsync(EndpointName, HttpBody, CancellationToken) |
| 209 | + // Create client |
| 210 | + PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync(); |
| 211 | + // Initialize request argument(s) |
| 212 | + EndpointName endpoint = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); |
| 213 | + HttpBody httpBody = new HttpBody(); |
| 214 | + // Make the request |
| 215 | + HttpBody response = await predictionServiceClient.RawPredictAsync(endpoint, httpBody); |
| 216 | + // End snippet |
| 217 | + } |
| 218 | + |
| 219 | + //github.com/ <summary>Snippet for Explain</summary> |
| 220 | + public void ExplainRequestObject() |
| 221 | + { |
| 222 | + // Snippet: Explain(ExplainRequest, CallSettings) |
| 223 | + // Create client |
| 224 | + PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create(); |
| 225 | + // Initialize request argument(s) |
| 226 | + ExplainRequest request = new ExplainRequest |
| 227 | + { |
| 228 | + EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"), |
| 229 | + Instances = { new Value(), }, |
| 230 | + DeployedModelId = "", |
| 231 | + Parameters = new Value(), |
| 232 | + ExplanationSpecOverride = new ExplanationSpecOverride(), |
| 233 | + }; |
| 234 | + // Make the request |
| 235 | + ExplainResponse response = predictionServiceClient.Explain(request); |
| 236 | + // End snippet |
| 237 | + } |
| 238 | + |
| 239 | + //github.com/ <summary>Snippet for ExplainAsync</summary> |
| 240 | + public async Task ExplainRequestObjectAsync() |
| 241 | + { |
| 242 | + // Snippet: ExplainAsync(ExplainRequest, CallSettings) |
| 243 | + // Additional: ExplainAsync(ExplainRequest, CancellationToken) |
| 244 | + // Create client |
| 245 | + PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync(); |
| 246 | + // Initialize request argument(s) |
| 247 | + ExplainRequest request = new ExplainRequest |
| 248 | + { |
| 249 | + EndpointAsEndpointName = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"), |
| 250 | + Instances = { new Value(), }, |
| 251 | + DeployedModelId = "", |
| 252 | + Parameters = new Value(), |
| 253 | + ExplanationSpecOverride = new ExplanationSpecOverride(), |
| 254 | + }; |
| 255 | + // Make the request |
| 256 | + ExplainResponse response = await predictionServiceClient.ExplainAsync(request); |
| 257 | + // End snippet |
| 258 | + } |
| 259 | + |
| 260 | + //github.com/ <summary>Snippet for Explain</summary> |
| 261 | + public void Explain() |
| 262 | + { |
| 263 | + // Snippet: Explain(string, IEnumerable<Value>, Value, string, CallSettings) |
| 264 | + // Create client |
| 265 | + PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create(); |
| 266 | + // Initialize request argument(s) |
| 267 | + string endpoint = "projects/[PROJECT]/locations/[LOCATION]/endpoints/[ENDPOINT]"; |
| 268 | + IEnumerable<Value> instances = new Value[] { new Value(), }; |
| 269 | + Value parameters = new Value(); |
| 270 | + string deployedModelId = ""; |
| 271 | + // Make the request |
| 272 | + ExplainResponse response = predictionServiceClient.Explain(endpoint, instances, parameters, deployedModelId); |
| 273 | + // End snippet |
| 274 | + } |
| 275 | + |
| 276 | + //github.com/ <summary>Snippet for ExplainAsync</summary> |
| 277 | + public async Task ExplainAsync() |
| 278 | + { |
| 279 | + // Snippet: ExplainAsync(string, IEnumerable<Value>, Value, string, CallSettings) |
| 280 | + // Additional: ExplainAsync(string, IEnumerable<Value>, Value, string, CancellationToken) |
| 281 | + // Create client |
| 282 | + PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync(); |
| 283 | + // Initialize request argument(s) |
| 284 | + string endpoint = "projects/[PROJECT]/locations/[LOCATION]/endpoints/[ENDPOINT]"; |
| 285 | + IEnumerable<Value> instances = new Value[] { new Value(), }; |
| 286 | + Value parameters = new Value(); |
| 287 | + string deployedModelId = ""; |
| 288 | + // Make the request |
| 289 | + ExplainResponse response = await predictionServiceClient.ExplainAsync(endpoint, instances, parameters, deployedModelId); |
| 290 | + // End snippet |
| 291 | + } |
| 292 | + |
| 293 | + //github.com/ <summary>Snippet for Explain</summary> |
| 294 | + public void ExplainResourceNames() |
| 295 | + { |
| 296 | + // Snippet: Explain(EndpointName, IEnumerable<Value>, Value, string, CallSettings) |
| 297 | + // Create client |
| 298 | + PredictionServiceClient predictionServiceClient = PredictionServiceClient.Create(); |
| 299 | + // Initialize request argument(s) |
| 300 | + EndpointName endpoint = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); |
| 301 | + IEnumerable<Value> instances = new Value[] { new Value(), }; |
| 302 | + Value parameters = new Value(); |
| 303 | + string deployedModelId = ""; |
| 304 | + // Make the request |
| 305 | + ExplainResponse response = predictionServiceClient.Explain(endpoint, instances, parameters, deployedModelId); |
| 306 | + // End snippet |
| 307 | + } |
| 308 | + |
| 309 | + //github.com/ <summary>Snippet for ExplainAsync</summary> |
| 310 | + public async Task ExplainResourceNamesAsync() |
| 311 | + { |
| 312 | + // Snippet: ExplainAsync(EndpointName, IEnumerable<Value>, Value, string, CallSettings) |
| 313 | + // Additional: ExplainAsync(EndpointName, IEnumerable<Value>, Value, string, CancellationToken) |
| 314 | + // Create client |
| 315 | + PredictionServiceClient predictionServiceClient = await PredictionServiceClient.CreateAsync(); |
| 316 | + // Initialize request argument(s) |
| 317 | + EndpointName endpoint = EndpointName.FromProjectLocationEndpoint("[PROJECT]", "[LOCATION]", "[ENDPOINT]"); |
| 318 | + IEnumerable<Value> instances = new Value[] { new Value(), }; |
| 319 | + Value parameters = new Value(); |
| 320 | + string deployedModelId = ""; |
| 321 | + // Make the request |
| 322 | + ExplainResponse response = await predictionServiceClient.ExplainAsync(endpoint, instances, parameters, deployedModelId); |
| 323 | + // End snippet |
| 324 | + } |
124 | 325 | }
|
125 | 326 | }
|
0 commit comments