@@ -96,6 +96,7 @@ public Builder() {}
9696 private Object responseFormat ;
9797 private String responseMimeType ;
9898 private String previousInteractionId ;
99+ private Config .ImageConfig imageConfig ;
99100
100101 /**
101102 * Sets the model.
@@ -259,13 +260,40 @@ public Builder responseFormat(Schema schema) {
259260 */
260261 public Builder previousInteractionId (String previousInteractionId ) { this .previousInteractionId = previousInteractionId ; return this ; }
261262
263+ /**
264+ * Sets the image config.
265+ *
266+ * @param imageConfig The image configuration.
267+ * @return This builder.
268+ */
269+ public Builder imageConfig (Config .ImageConfig imageConfig ) { this .imageConfig = imageConfig ; return this ; }
270+
262271 /**
263272 * Builds the CreateModelInteractionParams.
264273 *
265274 * @return The CreateModelInteractionParams parameters.
266275 */
267276 public ModelInteractionParams build () {
268- return new ModelInteractionParams (model , input , generationConfig , tools , stream , store , background , systemInstruction , responseModalities , responseFormat , responseMimeType , previousInteractionId );
277+ Config .GenerationConfig finalConfig = generationConfig ;
278+ if (imageConfig != null ) {
279+ if (finalConfig == null ) {
280+ finalConfig = new Config .GenerationConfig (null , null , null , null , null , null , null , null , null , imageConfig );
281+ } else {
282+ finalConfig = new Config .GenerationConfig (
283+ finalConfig .temperature (),
284+ finalConfig .topP (),
285+ finalConfig .seed (),
286+ finalConfig .stopSequences (),
287+ finalConfig .toolChoice (),
288+ finalConfig .thinkingLevel (),
289+ finalConfig .thinkingSummaries (),
290+ finalConfig .maxOutputTokens (),
291+ finalConfig .speechConfig (),
292+ imageConfig
293+ );
294+ }
295+ }
296+ return new ModelInteractionParams (model , input , finalConfig , tools , stream , store , background , systemInstruction , responseModalities , responseFormat , responseMimeType , previousInteractionId );
269297 }
270298 }
271299 }
@@ -316,6 +344,7 @@ public Builder() {}
316344 private String agent ;
317345 private Object input ;
318346 private Config .AgentConfig agentConfig ;
347+ private Config .GenerationConfig generationConfig ;
319348 private List <Tool > tools ;
320349 private Boolean stream ;
321350 private Boolean store ;
@@ -325,6 +354,7 @@ public Builder() {}
325354 private Object responseFormat ;
326355 private String responseMimeType ;
327356 private String previousInteractionId ;
357+ private Config .ImageConfig imageConfig ;
328358
329359 /**
330360 * Sets the agent.
@@ -381,6 +411,14 @@ public Builder() {}
381411 * @return This builder.
382412 */
383413 public Builder agentConfig (Config .AgentConfig agentConfig ) { this .agentConfig = agentConfig ; return this ; }
414+
415+ /**
416+ * Sets the generation config.
417+ *
418+ * @param generationConfig The generation configuration.
419+ * @return This builder.
420+ */
421+ public Builder generationConfig (Config .GenerationConfig generationConfig ) { this .generationConfig = generationConfig ; return this ; }
384422 /**
385423 * Sets the tools.
386424 *
@@ -494,13 +532,40 @@ public Builder responseFormat(String responseFormat) {
494532 */
495533 public Builder previousInteractionId (String previousInteractionId ) { this .previousInteractionId = previousInteractionId ; return this ; }
496534
535+ /**
536+ * Sets the image config.
537+ *
538+ * @param imageConfig The image configuration.
539+ * @return This builder.
540+ */
541+ public Builder imageConfig (Config .ImageConfig imageConfig ) { this .imageConfig = imageConfig ; return this ; }
542+
497543 /**
498544 * Builds the CreateAgentInteractionParams.
499545 *
500546 * @return The CreateAgentInteractionParams parameters.
501547 */
502548 public AgentInteractionParams build () {
503- return new AgentInteractionParams (agent , input , agentConfig , null , tools , stream , store , background , systemInstruction , responseModalities , responseFormat , responseMimeType , previousInteractionId );
549+ Config .GenerationConfig finalConfig = generationConfig ;
550+ if (imageConfig != null ) {
551+ if (finalConfig == null ) {
552+ finalConfig = new Config .GenerationConfig (null , null , null , null , null , null , null , null , null , imageConfig );
553+ } else {
554+ finalConfig = new Config .GenerationConfig (
555+ finalConfig .temperature (),
556+ finalConfig .topP (),
557+ finalConfig .seed (),
558+ finalConfig .stopSequences (),
559+ finalConfig .toolChoice (),
560+ finalConfig .thinkingLevel (),
561+ finalConfig .thinkingSummaries (),
562+ finalConfig .maxOutputTokens (),
563+ finalConfig .speechConfig (),
564+ imageConfig
565+ );
566+ }
567+ }
568+ return new AgentInteractionParams (agent , input , agentConfig , finalConfig , tools , stream , store , background , systemInstruction , responseModalities , responseFormat , responseMimeType , previousInteractionId );
504569 }
505570 }
506571 }
0 commit comments