diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplate.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplate.java index db74d9aaaad..6e6155fe651 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplate.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplate.java @@ -18,6 +18,7 @@ import org.antlr.runtime.Token; import org.antlr.runtime.TokenStream; import org.springframework.ai.parser.OutputParser; +import org.springframework.ai.chat.messages.Media; import org.springframework.ai.chat.messages.Message; import org.springframework.ai.chat.messages.UserMessage; import org.springframework.core.io.Resource; @@ -173,6 +174,11 @@ public Message createMessage() { return new UserMessage(render()); } + @Override + public Message createMessage(List mediaList) { + return new UserMessage(render(), mediaList); + } + @Override public Message createMessage(Map model) { return new UserMessage(render(model)); diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplateMessageActions.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplateMessageActions.java index 37caa5df888..0df0dcc084d 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplateMessageActions.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplateMessageActions.java @@ -15,14 +15,18 @@ */ package org.springframework.ai.chat.prompt; +import org.springframework.ai.chat.messages.Media; import org.springframework.ai.chat.messages.Message; +import java.util.List; import java.util.Map; public interface PromptTemplateMessageActions { Message createMessage(); + Message createMessage(List mediaList); + Message createMessage(Map model); }