Skip to content
Open
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
34 changes: 34 additions & 0 deletions src/main/java/com/google/cloud/agentplatform/AgentEngines.java
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ ObjectNode reasoningEngineContextSpecFromVertex(JsonNode fromObject, ObjectNode
toObject));
}

if (Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"exampleStoreConfig"},
Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"}));
}

return toObject;
}

Expand Down Expand Up @@ -543,6 +550,13 @@ ObjectNode reasoningEngineContextSpecToVertex(JsonNode fromObject, ObjectNode pa
toObject));
}

if (Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"exampleStoreConfig"},
Common.getValueByPath(fromObject, new String[] {"exampleStoreConfig"}));
}

return toObject;
}

Expand Down Expand Up @@ -629,6 +643,26 @@ ObjectNode reasoningEngineFromVertex(JsonNode fromObject, ObjectNode parentObjec
Common.getValueByPath(fromObject, new String[] {"trafficConfig"}));
}

if (Common.getValueByPath(fromObject, new String[] {"experimentConfig"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"experimentConfig"},
Common.getValueByPath(fromObject, new String[] {"experimentConfig"}));
}

if (Common.getValueByPath(fromObject, new String[] {"revisionGarbageCollectionStrategy"})
!= null) {
Common.setValueByPath(
toObject,
new String[] {"revisionGarbageCollectionStrategy"},
Common.getValueByPath(fromObject, new String[] {"revisionGarbageCollectionStrategy"}));
}

if (Common.getValueByPath(fromObject, new String[] {"url"}) != null) {
Common.setValueByPath(
toObject, new String[] {"url"}, Common.getValueByPath(fromObject, new String[] {"url"}));
}

return toObject;
}

Expand Down
201 changes: 201 additions & 0 deletions src/main/java/com/google/cloud/agentplatform/types/Citation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
/*
* 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.

package com.google.cloud.agentplatform.types;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.auto.value.AutoValue;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.genai.JsonSerializable;
import java.util.Optional;

/** A citation for a piece of generatedcontent. */
@AutoValue
@JsonDeserialize(builder = Citation.Builder.class)
public abstract class Citation extends JsonSerializable {
/** Output only. The start index of the citation in the content. */
@JsonProperty("startIndex")
public abstract Optional<Integer> startIndex();

/** Output only. The end index of the citation in the content. */
@JsonProperty("endIndex")
public abstract Optional<Integer> endIndex();

/** Output only. The URI of the source of the citation. */
@JsonProperty("uri")
public abstract Optional<String> uri();

/** Output only. The title of the source of the citation. */
@JsonProperty("title")
public abstract Optional<String> title();

/** Output only. The license of the source of the citation. */
@JsonProperty("license")
public abstract Optional<String> license();

/** Output only. The publication date of the source of the citation. */
@JsonProperty("publicationDate")
public abstract Optional<GoogleTypeDate> publicationDate();

/** Instantiates a builder for Citation. */
@ExcludeFromGeneratedCoverageReport
public static Builder builder() {
return new AutoValue_Citation.Builder();
}

/** Creates a builder with the same values as this instance. */
public abstract Builder toBuilder();

/** Builder for Citation. */
@AutoValue.Builder
public abstract static class Builder {
/** For internal usage. Please use `Citation.builder()` for instantiation. */
@JsonCreator
private static Builder create() {
return new AutoValue_Citation.Builder();
}

/**
* Setter for startIndex.
*
* <p>startIndex: Output only. The start index of the citation in the content.
*/
@JsonProperty("startIndex")
public abstract Builder startIndex(Integer startIndex);

@ExcludeFromGeneratedCoverageReport
abstract Builder startIndex(Optional<Integer> startIndex);

/** Clears the value of startIndex field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearStartIndex() {
return startIndex(Optional.empty());
}

/**
* Setter for endIndex.
*
* <p>endIndex: Output only. The end index of the citation in the content.
*/
@JsonProperty("endIndex")
public abstract Builder endIndex(Integer endIndex);

@ExcludeFromGeneratedCoverageReport
abstract Builder endIndex(Optional<Integer> endIndex);

/** Clears the value of endIndex field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearEndIndex() {
return endIndex(Optional.empty());
}

/**
* Setter for uri.
*
* <p>uri: Output only. The URI of the source of the citation.
*/
@JsonProperty("uri")
public abstract Builder uri(String uri);

@ExcludeFromGeneratedCoverageReport
abstract Builder uri(Optional<String> uri);

/** Clears the value of uri field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearUri() {
return uri(Optional.empty());
}

/**
* Setter for title.
*
* <p>title: Output only. The title of the source of the citation.
*/
@JsonProperty("title")
public abstract Builder title(String title);

@ExcludeFromGeneratedCoverageReport
abstract Builder title(Optional<String> title);

/** Clears the value of title field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearTitle() {
return title(Optional.empty());
}

/**
* Setter for license.
*
* <p>license: Output only. The license of the source of the citation.
*/
@JsonProperty("license")
public abstract Builder license(String license);

@ExcludeFromGeneratedCoverageReport
abstract Builder license(Optional<String> license);

/** Clears the value of license field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearLicense() {
return license(Optional.empty());
}

/**
* Setter for publicationDate.
*
* <p>publicationDate: Output only. The publication date of the source of the citation.
*/
@JsonProperty("publicationDate")
public abstract Builder publicationDate(GoogleTypeDate publicationDate);

/**
* Setter for publicationDate builder.
*
* <p>publicationDate: Output only. The publication date of the source of the citation.
*/
@CanIgnoreReturnValue
public Builder publicationDate(GoogleTypeDate.Builder publicationDateBuilder) {
return publicationDate(publicationDateBuilder.build());
}

@ExcludeFromGeneratedCoverageReport
abstract Builder publicationDate(Optional<GoogleTypeDate> publicationDate);

/** Clears the value of publicationDate field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearPublicationDate() {
return publicationDate(Optional.empty());
}

public abstract Citation build();
}

/** Deserializes a JSON string to a Citation object. */
@ExcludeFromGeneratedCoverageReport
public static Citation fromJson(String jsonString) {
return JsonSerializable.fromJsonString(jsonString, Citation.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* 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.

package com.google.cloud.agentplatform.types;

import static com.google.common.collect.ImmutableList.toImmutableList;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.google.auto.value.AutoValue;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.genai.JsonSerializable;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;

/** A collection of citations that apply to a piece of generated content. */
@AutoValue
@JsonDeserialize(builder = CitationMetadata.Builder.class)
public abstract class CitationMetadata extends JsonSerializable {
/** Output only. A list of citations for the content. */
@JsonProperty("citations")
public abstract Optional<List<Citation>> citations();

/** Instantiates a builder for CitationMetadata. */
@ExcludeFromGeneratedCoverageReport
public static Builder builder() {
return new AutoValue_CitationMetadata.Builder();
}

/** Creates a builder with the same values as this instance. */
public abstract Builder toBuilder();

/** Builder for CitationMetadata. */
@AutoValue.Builder
public abstract static class Builder {
/** For internal usage. Please use `CitationMetadata.builder()` for instantiation. */
@JsonCreator
private static Builder create() {
return new AutoValue_CitationMetadata.Builder();
}

/**
* Setter for citations.
*
* <p>citations: Output only. A list of citations for the content.
*/
@JsonProperty("citations")
public abstract Builder citations(List<Citation> citations);

/**
* Setter for citations.
*
* <p>citations: Output only. A list of citations for the content.
*/
@CanIgnoreReturnValue
public Builder citations(Citation... citations) {
return citations(Arrays.asList(citations));
}

/**
* Setter for citations builder.
*
* <p>citations: Output only. A list of citations for the content.
*/
@CanIgnoreReturnValue
public Builder citations(Citation.Builder... citationsBuilders) {
return citations(
Arrays.asList(citationsBuilders).stream()
.map(Citation.Builder::build)
.collect(toImmutableList()));
}

@ExcludeFromGeneratedCoverageReport
abstract Builder citations(Optional<List<Citation>> citations);

/** Clears the value of citations field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearCitations() {
return citations(Optional.empty());
}

public abstract CitationMetadata build();
}

/** Deserializes a JSON string to a CitationMetadata object. */
@ExcludeFromGeneratedCoverageReport
public static CitationMetadata fromJson(String jsonString) {
return JsonSerializable.fromJsonString(jsonString, CitationMetadata.class);
}
}
Loading
Loading