From 0e0d453e2bea9ddca062b6e32435944833847589 Mon Sep 17 00:00:00 2001 From: devholic22 Date: Thu, 23 May 2024 19:15:51 +0900 Subject: [PATCH] Add javadoc and clean up method names in OpenAiImageModel * remove getDefaultOptions method as it is not used. --- .../ai/openai/OpenAiImageModel.java | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiImageModel.java b/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiImageModel.java index a0b7ae811..a74dafe86 100644 --- a/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiImageModel.java +++ b/models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiImageModel.java @@ -15,18 +15,9 @@ */ package org.springframework.ai.openai; -import java.util.List; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import org.springframework.ai.image.Image; -import org.springframework.ai.image.ImageModel; -import org.springframework.ai.image.ImageGeneration; -import org.springframework.ai.image.ImageOptions; -import org.springframework.ai.image.ImagePrompt; -import org.springframework.ai.image.ImageResponse; -import org.springframework.ai.image.ImageResponseMetadata; +import org.springframework.ai.image.*; import org.springframework.ai.model.ModelOptionsUtils; import org.springframework.ai.openai.api.OpenAiImageApi; import org.springframework.ai.openai.metadata.OpenAiImageGenerationMetadata; @@ -36,6 +27,8 @@ import org.springframework.http.ResponseEntity; import org.springframework.retry.support.RetryTemplate; import org.springframework.util.Assert; +import java.util.List; + /** * OpenAiImageModel is a class that implements the ImageModel interface. It provides a * client for calling the OpenAI image generation API. @@ -66,8 +59,8 @@ public class OpenAiImageModel implements ImageModel { /** * Creates an instance of the OpenAiImageModel. - * @param openAiImageApi The OpenAiImageApi instance to be used for interacting with the OpenAI - * Image API. + * @param openAiImageApi The OpenAiImageApi instance to be used for interacting with + * the OpenAI Image API. * @throws IllegalArgumentException if openAiImageApi is null */ public OpenAiImageModel(OpenAiImageApi openAiImageApi) { @@ -76,13 +69,12 @@ public class OpenAiImageModel implements ImageModel { /** * Initializes a new instance of the OpenAiImageModel. - * @param openAiImageApi The OpenAiImageApi instance to be used for interacting with the OpenAI - * Image API. + * @param openAiImageApi The OpenAiImageApi instance to be used for interacting with + * the OpenAI Image API. * @param options The OpenAiImageOptions to configure the image model. * @param retryTemplate The retry template. */ - public OpenAiImageModel(OpenAiImageApi openAiImageApi, OpenAiImageOptions options, - RetryTemplate retryTemplate) { + public OpenAiImageModel(OpenAiImageApi openAiImageApi, OpenAiImageOptions options, RetryTemplate retryTemplate) { Assert.notNull(openAiImageApi, "OpenAiImageApi must not be null"); Assert.notNull(options, "options must not be null"); Assert.notNull(retryTemplate, "retryTemplate must not be null"); @@ -177,7 +169,4 @@ public class OpenAiImageModel implements ImageModel { return openAiImageOptionsBuilder.build(); } - public OpenAiImageOptions getDefaultOptions() { - return this.defaultOptions; - } }