Skip to content

Commit 376df51

Browse files
wanlin31copybara-github
authored andcommitted
chore: change the async_request_streamed to be consistent with request_streamed
PiperOrigin-RevId: 772564167
1 parent d80d23b commit 376df51

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

src/main/java/com/google/genai/Models.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4487,6 +4487,7 @@ ObjectNode candidateFromMldev(ApiClient apiClient, JsonNode fromObject, ObjectNo
44874487
ObjectNode generateContentResponseFromMldev(
44884488
ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) {
44894489
ObjectNode toObject = JsonSerializable.objectMapper.createObjectNode();
4490+
44904491
if (Common.getValueByPath(fromObject, new String[] {"candidates"}) != null) {
44914492
ArrayNode keyArray =
44924493
(ArrayNode) Common.getValueByPath(fromObject, new String[] {"candidates"});
@@ -5337,6 +5338,7 @@ ObjectNode candidateFromVertex(
53375338
ObjectNode generateContentResponseFromVertex(
53385339
ApiClient apiClient, JsonNode fromObject, ObjectNode parentObject) {
53395340
ObjectNode toObject = JsonSerializable.objectMapper.createObjectNode();
5341+
53405342
if (Common.getValueByPath(fromObject, new String[] {"candidates"}) != null) {
53415343
ArrayNode keyArray =
53425344
(ArrayNode) Common.getValueByPath(fromObject, new String[] {"candidates"});

src/main/java/com/google/genai/types/GenerateContentConfig.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public abstract class GenerateContentConfig extends JsonSerializable {
4444
@JsonProperty("httpOptions")
4545
public abstract Optional<HttpOptions> httpOptions();
4646

47+
/** If true, the raw HTTP response will be returned in the 'sdk_http_response' field. */
48+
@JsonProperty("shouldReturnHttpResponse")
49+
public abstract Optional<Boolean> shouldReturnHttpResponse();
50+
4751
/**
4852
* Instructions for the model to steer it toward better performance. For example, "Answer as
4953
* concisely as possible" or "Don't use technical terms in your response".
@@ -233,6 +237,15 @@ public Builder httpOptions(HttpOptions.Builder httpOptionsBuilder) {
233237
return httpOptions(httpOptionsBuilder.build());
234238
}
235239

240+
/**
241+
* Setter for shouldReturnHttpResponse.
242+
*
243+
* <p>shouldReturnHttpResponse: If true, the raw HTTP response will be returned in the
244+
* 'sdk_http_response' field.
245+
*/
246+
@JsonProperty("shouldReturnHttpResponse")
247+
public abstract Builder shouldReturnHttpResponse(boolean shouldReturnHttpResponse);
248+
236249
/**
237250
* Setter for systemInstruction.
238251
*

src/main/java/com/google/genai/types/GenerateContentResponse.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
@AutoValue
4242
@JsonDeserialize(builder = GenerateContentResponse.Builder.class)
4343
public abstract class GenerateContentResponse extends JsonSerializable {
44+
/** Used to retain the full HTTP response. */
45+
@JsonProperty("sdkHttpResponse")
46+
public abstract Optional<HttpResponse> sdkHttpResponse();
47+
4448
/** Response variations returned by the model. */
4549
@JsonProperty("candidates")
4650
public abstract Optional<List<Candidate>> candidates();
@@ -89,6 +93,23 @@ private static Builder create() {
8993
return new AutoValue_GenerateContentResponse.Builder();
9094
}
9195

96+
/**
97+
* Setter for sdkHttpResponse.
98+
*
99+
* <p>sdkHttpResponse: Used to retain the full HTTP response.
100+
*/
101+
@JsonProperty("sdkHttpResponse")
102+
public abstract Builder sdkHttpResponse(HttpResponse sdkHttpResponse);
103+
104+
/**
105+
* Setter for sdkHttpResponse builder.
106+
*
107+
* <p>sdkHttpResponse: Used to retain the full HTTP response.
108+
*/
109+
public Builder sdkHttpResponse(HttpResponse.Builder sdkHttpResponseBuilder) {
110+
return sdkHttpResponse(sdkHttpResponseBuilder.build());
111+
}
112+
92113
/**
93114
* Setter for candidates.
94115
*

0 commit comments

Comments
 (0)