@@ -19523,6 +19523,168 @@ public UndeployModel set(String parameterName, Object value) {
19523
19523
}
19524
19524
}
19525
19525
19526
+ /**
19527
+ * An accessor for creating requests from the Chat collection.
19528
+ *
19529
+ * <p>The typical use is:</p>
19530
+ * <pre>
19531
+ * {@code Aiplatform aiplatform = new Aiplatform(...);}
19532
+ * {@code Aiplatform.Chat.List request = aiplatform.chat().list(parameters ...)}
19533
+ * </pre>
19534
+ *
19535
+ * @return the resource collection
19536
+ */
19537
+ public Chat chat() {
19538
+ return new Chat();
19539
+ }
19540
+
19541
+ /**
19542
+ * The "chat" collection of methods.
19543
+ */
19544
+ public class Chat {
19545
+
19546
+ /**
19547
+ * Exposes an OpenAI-compatible endpoint for chat completions.
19548
+ *
19549
+ * Create a request for the method "chat.completions".
19550
+ *
19551
+ * This request holds the parameters needed by the aiplatform server. After setting any optional
19552
+ * parameters, call the {@link Completions#execute()} method to invoke the remote operation.
19553
+ *
19554
+ * @param endpoint Required. The name of the endpoint requested to serve the prediction. Format:
19555
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
19556
+ * @param content the {@link com.google.api.services.aiplatform.v1.model.GoogleApiHttpBody}
19557
+ * @return the request
19558
+ */
19559
+ public Completions completions(java.lang.String endpoint, com.google.api.services.aiplatform.v1.model.GoogleApiHttpBody content) throws java.io.IOException {
19560
+ Completions result = new Completions(endpoint, content);
19561
+ initialize(result);
19562
+ return result;
19563
+ }
19564
+
19565
+ public class Completions extends AiplatformRequest<com.google.api.services.aiplatform.v1.model.GoogleApiHttpBody> {
19566
+
19567
+ private static final String REST_PATH = "v1/{+endpoint}/chat/completions";
19568
+
19569
+ private final java.util.regex.Pattern ENDPOINT_PATTERN =
19570
+ java.util.regex.Pattern.compile("^projects/[^/]+/locations/[^/]+/endpoints/[^/]+$");
19571
+
19572
+ /**
19573
+ * Exposes an OpenAI-compatible endpoint for chat completions.
19574
+ *
19575
+ * Create a request for the method "chat.completions".
19576
+ *
19577
+ * This request holds the parameters needed by the the aiplatform server. After setting any
19578
+ * optional parameters, call the {@link Completions#execute()} method to invoke the remote
19579
+ * operation. <p> {@link
19580
+ * Completions#initialize(com.google.api.client.googleapis.services.AbstractGoogleClientRequest)}
19581
+ * must be called to initialize this instance immediately after invoking the constructor. </p>
19582
+ *
19583
+ * @param endpoint Required. The name of the endpoint requested to serve the prediction. Format:
19584
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
19585
+ * @param content the {@link com.google.api.services.aiplatform.v1.model.GoogleApiHttpBody}
19586
+ * @since 1.13
19587
+ */
19588
+ protected Completions(java.lang.String endpoint, com.google.api.services.aiplatform.v1.model.GoogleApiHttpBody content) {
19589
+ super(Aiplatform.this, "POST", REST_PATH, content, com.google.api.services.aiplatform.v1.model.GoogleApiHttpBody.class);
19590
+ this.endpoint = com.google.api.client.util.Preconditions.checkNotNull(endpoint, "Required parameter endpoint must be specified.");
19591
+ if (!getSuppressPatternChecks()) {
19592
+ com.google.api.client.util.Preconditions.checkArgument(ENDPOINT_PATTERN.matcher(endpoint).matches(),
19593
+ "Parameter endpoint must conform to the pattern " +
19594
+ "^projects/[^/]+/locations/[^/]+/endpoints/[^/]+$");
19595
+ }
19596
+ }
19597
+
19598
+ @Override
19599
+ public Completions set$Xgafv(java.lang.String $Xgafv) {
19600
+ return (Completions) super.set$Xgafv($Xgafv);
19601
+ }
19602
+
19603
+ @Override
19604
+ public Completions setAccessToken(java.lang.String accessToken) {
19605
+ return (Completions) super.setAccessToken(accessToken);
19606
+ }
19607
+
19608
+ @Override
19609
+ public Completions setAlt(java.lang.String alt) {
19610
+ return (Completions) super.setAlt(alt);
19611
+ }
19612
+
19613
+ @Override
19614
+ public Completions setCallback(java.lang.String callback) {
19615
+ return (Completions) super.setCallback(callback);
19616
+ }
19617
+
19618
+ @Override
19619
+ public Completions setFields(java.lang.String fields) {
19620
+ return (Completions) super.setFields(fields);
19621
+ }
19622
+
19623
+ @Override
19624
+ public Completions setKey(java.lang.String key) {
19625
+ return (Completions) super.setKey(key);
19626
+ }
19627
+
19628
+ @Override
19629
+ public Completions setOauthToken(java.lang.String oauthToken) {
19630
+ return (Completions) super.setOauthToken(oauthToken);
19631
+ }
19632
+
19633
+ @Override
19634
+ public Completions setPrettyPrint(java.lang.Boolean prettyPrint) {
19635
+ return (Completions) super.setPrettyPrint(prettyPrint);
19636
+ }
19637
+
19638
+ @Override
19639
+ public Completions setQuotaUser(java.lang.String quotaUser) {
19640
+ return (Completions) super.setQuotaUser(quotaUser);
19641
+ }
19642
+
19643
+ @Override
19644
+ public Completions setUploadType(java.lang.String uploadType) {
19645
+ return (Completions) super.setUploadType(uploadType);
19646
+ }
19647
+
19648
+ @Override
19649
+ public Completions setUploadProtocol(java.lang.String uploadProtocol) {
19650
+ return (Completions) super.setUploadProtocol(uploadProtocol);
19651
+ }
19652
+
19653
+ /**
19654
+ * Required. The name of the endpoint requested to serve the prediction. Format:
19655
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
19656
+ */
19657
+ @com.google.api.client.util.Key
19658
+ private java.lang.String endpoint;
19659
+
19660
+ /** Required. The name of the endpoint requested to serve the prediction. Format:
19661
+ `projects/{project}/locations/{location}/endpoints/{endpoint}`
19662
+ */
19663
+ public java.lang.String getEndpoint() {
19664
+ return endpoint;
19665
+ }
19666
+
19667
+ /**
19668
+ * Required. The name of the endpoint requested to serve the prediction. Format:
19669
+ * `projects/{project}/locations/{location}/endpoints/{endpoint}`
19670
+ */
19671
+ public Completions setEndpoint(java.lang.String endpoint) {
19672
+ if (!getSuppressPatternChecks()) {
19673
+ com.google.api.client.util.Preconditions.checkArgument(ENDPOINT_PATTERN.matcher(endpoint).matches(),
19674
+ "Parameter endpoint must conform to the pattern " +
19675
+ "^projects/[^/]+/locations/[^/]+/endpoints/[^/]+$");
19676
+ }
19677
+ this.endpoint = endpoint;
19678
+ return this;
19679
+ }
19680
+
19681
+ @Override
19682
+ public Completions set(String parameterName, Object value) {
19683
+ return (Completions) super.set(parameterName, value);
19684
+ }
19685
+ }
19686
+
19687
+ }
19526
19688
/**
19527
19689
* An accessor for creating requests from the Operations collection.
19528
19690
*
0 commit comments