BAEL-7142, fix minor comment

This commit is contained in:
kateryna.hrytsaenko 2023-12-26 21:35:19 +02:00
parent bd1ded4d6e
commit bf45a052f4
6 changed files with 7 additions and 8 deletions

View File

@ -9,4 +9,4 @@
# Packaged files # # Packaged files #
*.jar *.jar
*.war *.war
*.ear *.ear

View File

@ -60,5 +60,4 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project>
</project>

View File

@ -1,3 +1,3 @@
package com.baeldung.spring.ai.dto; package com.baeldung.spring.ai.dto;
public record PoetryDto (String title, String poetry, String genre, String theme){} public record PoetryDto (String title, String poetry, String genre, String theme) {}

View File

@ -32,12 +32,12 @@ public class PoetryServiceImpl implements PoetryService {
public PoetryDto getPoetryByGenreAndTheme(String genre, String theme) { public PoetryDto getPoetryByGenreAndTheme(String genre, String theme) {
BeanOutputParser<PoetryDto> poetryDtoBeanOutputParser = new BeanOutputParser<>(PoetryDto.class); BeanOutputParser<PoetryDto> poetryDtoBeanOutputParser = new BeanOutputParser<>(PoetryDto.class);
String promtString = """ String promptString = """
Write me {genre} poetry about {theme} Write me {genre} poetry about {theme}
{format} {format}
"""; """;
PromptTemplate promptTemplate = new PromptTemplate(promtString); PromptTemplate promptTemplate = new PromptTemplate(promptString);
promptTemplate.add("genre", genre); promptTemplate.add("genre", genre);
promptTemplate.add("theme", theme); promptTemplate.add("theme", theme);
promptTemplate.add("format", poetryDtoBeanOutputParser.getFormat()); promptTemplate.add("format", poetryDtoBeanOutputParser.getFormat());

View File

@ -1,3 +1,3 @@
spring: spring:
ai: ai:
openai.api-key: ${OPEN_AI_KEY} openai.api-key: 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

View File

@ -1,3 +1,3 @@
spring: spring:
ai: ai:
openai.api-key: "mock-key-token" openai.api-key: "mock-key-token"