Skip to content

Commit 6a1b92b

Browse files
jitokimleijendary
authored andcommitted
Fix example code in ref docs (spring-projects#1618)
chatclient.adoc - Replaced javaCopySimpleLoggerAdvisor with SimpleLoggerAdvisor - Fixed typo in the multiline String for ChatClient example etl-pipeline.adoc - Fixed indent in the ParagraphPdfDocumentReader example imageclient.adoc - Fixed indent of override annotation in the ImageGeneration example testing.adoc - Added a semicolon to the Evaluator interface Signed-off-by: jitokim <[email protected]> Signed-off-by: leijendary <[email protected]>
1 parent 707183a commit 6a1b92b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/chatclient.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ public class CustomerSupportAssistant {
457457
458458
this.chatClient = builder
459459
.defaultSystem("""
460-
You are a customer chat support agent of an airline named "Funnair".", Respond in a friendly,
460+
You are a customer chat support agent of an airline named "Funnair". Respond in a friendly,
461461
helpful, and joyful manner.
462462
463463
Before providing information about a booking or cancelling a booking, you MUST always
@@ -531,7 +531,7 @@ Example usage:
531531

532532
[source,java]
533533
----
534-
javaCopySimpleLoggerAdvisor customLogger = new SimpleLoggerAdvisor(
534+
SimpleLoggerAdvisor customLogger = new SimpleLoggerAdvisor(
535535
request -> "Custom request: " + request.userText,
536536
response -> "Custom response: " + response.getResult()
537537
);

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/etl-pipeline.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ class MyTextReader {
235235
MyTextReader(@Value("classpath:text-source.txt") Resource resource) {
236236
this.resource = resource;
237237
}
238+
238239
List<Document> loadText() {
239240
TextReader textReader = new TextReader(this.resource);
240241
textReader.getCustomMetadata().put("filename", "text-source.txt");
@@ -447,7 +448,7 @@ dependencies {
447448
@Component
448449
public class MyPagePdfDocumentReader {
449450
450-
List<Document> getDocsFromPdfwithCatalog() {
451+
List<Document> getDocsFromPdfWithCatalog() {
451452
452453
ParagraphPdfDocumentReader pdfReader = new ParagraphPdfDocumentReader("classpath:/sample1.pdf",
453454
PdfDocumentReaderConfig.builder()
@@ -458,7 +459,7 @@ public class MyPagePdfDocumentReader {
458459
.withPagesPerDocument(1)
459460
.build());
460461
461-
return pdfReader.read();
462+
return pdfReader.read();
462463
}
463464
}
464465
----

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/imageclient.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public class ImageGeneration implements ModelResult<Image> {
144144
145145
private Image image;
146146
147-
@Override
147+
@Override
148148
public Image getOutput() {...}
149149
150150
@Override

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/testing.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Spring AI interface for evaluating responses is `Evaluator`, defined as:
1212
----
1313
@FunctionalInterface
1414
public interface Evaluator {
15-
EvaluationResponse evaluate(EvaluationRequest evaluationRequest)
15+
EvaluationResponse evaluate(EvaluationRequest evaluationRequest);
1616
}
1717
----
1818

0 commit comments

Comments
 (0)