diff --git a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/AiPromptTemplate.java b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/AiPromptTemplate.java index 9343e94cba1..665ca6ab653 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/AiPromptTemplate.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/AiPromptTemplate.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package org.springframework.ai.core.prompts; import java.util.Map; diff --git a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/ChatPromptTemplate.java b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/ChatPromptTemplate.java index 6176dc75a49..86c04029fe7 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/ChatPromptTemplate.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/ChatPromptTemplate.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package org.springframework.ai.core.prompts; import java.util.Map; @@ -44,5 +43,4 @@ public Prompt create(Map model) { return new Prompt(new ChatMessage(render(model), this.role)); } - } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/FunctionPromptTemplate.java b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/FunctionPromptTemplate.java index d27a9132baf..881db0948cc 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/FunctionPromptTemplate.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/FunctionPromptTemplate.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package org.springframework.ai.core.prompts; public class FunctionPromptTemplate extends PromptTemplate { @@ -25,5 +24,4 @@ public FunctionPromptTemplate(String template) { super(template); } - } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/PromptTemplate.java b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/PromptTemplate.java index 73cb172ed26..1e9595a0864 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/PromptTemplate.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/PromptTemplate.java @@ -107,4 +107,5 @@ protected void validate(Map model) { "All template variables were not replaced. Missing variable names are " + missingEntries); } } + } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/SystemPromptTemplate.java b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/SystemPromptTemplate.java index 9a7783ffdfa..f992b4e453a 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/SystemPromptTemplate.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/SystemPromptTemplate.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package org.springframework.ai.core.prompts; import java.util.Map; @@ -36,4 +35,5 @@ public Prompt create() { public Prompt create(Map model) { return new Prompt(new SystemMessage(render(model))); } + } diff --git a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/messages/Message.java b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/messages/Message.java index 79511222cb6..4b98e9349c1 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/messages/Message.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/core/prompts/messages/Message.java @@ -22,7 +22,8 @@ public interface Message { String getContent(); - //TODO investigate use of "function_name" and "name" - maybe cna be first class representation vs. map. + // TODO investigate use of "function_name" and "name" - maybe cna be first class + // representation vs. map. Map getProperties(); MessageType getMessageType(); diff --git a/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/ChatTests.java b/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/ChatTests.java index a9518154acc..20c75558e07 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/ChatTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/ChatTests.java @@ -14,25 +14,25 @@ * limitations under the License. */ - package org.springframework.ai.core.prompts; import org.junit.jupiter.api.Test; public class ChatTests { -// @Test -// void testChat() { -// -// String customerStyle = "American English in a calm and respectful tone"; -// String customerEmail = "Arrr, I be fuming that me blender lid " -// + "flew off and splattered me kitchen walls " -// + "with smoothie! And to make matters worse, " -// + "the warranty don't cover the cost of " -// + "cleaning up me kitchen. I need yer help " -// + "right now, matey!"; -// ChatOpenAi chatOpenAi = new ChatOpenAi(); -// chatOpenAi -// -// } + // @Test + // void testChat() { + // + // String customerStyle = "American English in a calm and respectful tone"; + // String customerEmail = "Arrr, I be fuming that me blender lid " + // + "flew off and splattered me kitchen walls " + // + "with smoothie! And to make matters worse, " + // + "the warranty don't cover the cost of " + // + "cleaning up me kitchen. I need yer help " + // + "right now, matey!"; + // ChatOpenAi chatOpenAi = new ChatOpenAi(); + // chatOpenAi + // + // } + } diff --git a/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/PromptTests.java b/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/PromptTests.java index 39c9bd224b3..3d67b4bdef0 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/PromptTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/core/prompts/PromptTests.java @@ -56,8 +56,6 @@ void newApiPlaygroundTests() { assertThat(prompt.getMessages()).isNotEmpty().hasSize(1); System.out.println(prompt.getContents()); - - String systemTemplate = "You are a helpful assistant that translates {input_language} to {output_language}."; // system_message_prompt = SystemMessagePromptTemplate.from_template(template) @@ -81,7 +79,8 @@ void newApiPlaygroundTests() { PromptTemplate promptTemplate = new SystemPromptTemplate(systemTemplate); Prompt systemPrompt = promptTemplate.create(systemModel); - promptTemplate = new PromptTemplate(humanTemplate); // creates a Prompt with HumanMessage + promptTemplate = new PromptTemplate(humanTemplate); // creates a Prompt with + // HumanMessage Prompt humanPrompt = promptTemplate.create(humanModel); // ChatPromptTemplate chatPromptTemplate = new ChatPromptTemplate(systemPrompt,