Commit 7fe1b7791992fee313bbaad6db0d41f7e65f2d9e
1 parent
c3e36c19
增加 spring ai Image模块注释
Showing
3 changed files
with
10 additions
and
0 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/image/Image.java
| @@ -21,11 +21,15 @@ import java.util.Objects; | @@ -21,11 +21,15 @@ import java.util.Objects; | ||
| 21 | public class Image { | 21 | public class Image { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | + * 可以访问图像的URL。 | ||
| 25 | + * | ||
| 24 | * The URL where the image can be accessed. | 26 | * The URL where the image can be accessed. |
| 25 | */ | 27 | */ |
| 26 | private String url; | 28 | private String url; |
| 27 | 29 | ||
| 28 | /** | 30 | /** |
| 31 | + * Base64编码的图像字符串。 | ||
| 32 | + * | ||
| 29 | * Base64 encoded image string. | 33 | * Base64 encoded image string. |
| 30 | */ | 34 | */ |
| 31 | private String b64Json; | 35 | private String b64Json; |
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/image/ImageClient.java
| @@ -22,6 +22,11 @@ import cn.iocoder.yudao.framework.ai.model.ModelClient; | @@ -22,6 +22,11 @@ import cn.iocoder.yudao.framework.ai.model.ModelClient; | ||
| 22 | @FunctionalInterface | 22 | @FunctionalInterface |
| 23 | public interface ImageClient extends ModelClient<ImagePrompt, ImageResponse> { | 23 | public interface ImageClient extends ModelClient<ImagePrompt, ImageResponse> { |
| 24 | 24 | ||
| 25 | + /** | ||
| 26 | + * 跟 chat一样 | ||
| 27 | + * @param request the request object to be sent to the AI model | ||
| 28 | + * @return | ||
| 29 | + */ | ||
| 25 | ImageResponse call(ImagePrompt request); | 30 | ImageResponse call(ImagePrompt request); |
| 26 | 31 | ||
| 27 | } | 32 | } |
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/image/ImageGeneration.java
| @@ -21,6 +21,7 @@ import cn.iocoder.yudao.framework.ai.model.ModelResult; | @@ -21,6 +21,7 @@ import cn.iocoder.yudao.framework.ai.model.ModelResult; | ||
| 21 | 21 | ||
| 22 | public class ImageGeneration implements ModelResult<Image> { | 22 | public class ImageGeneration implements ModelResult<Image> { |
| 23 | 23 | ||
| 24 | + // metadata 信息为空现在 | ||
| 24 | private ImageGenerationMetadata imageGenerationMetadata; | 25 | private ImageGenerationMetadata imageGenerationMetadata; |
| 25 | 26 | ||
| 26 | private Image image; | 27 | private Image image; |