Fix example code in ref docs (#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 <pigberger70@gmail.com>
This commit is contained in:
jito
2024-10-31 06:12:06 +09:00
committed by GitHub
parent 1e980d13b2
commit cf17a6dccb
4 changed files with 7 additions and 6 deletions

View File

@@ -450,7 +450,7 @@ public class CustomerSupportAssistant {
this.chatClient = builder
.defaultSystem("""
You are a customer chat support agent of an airline named "Funnair".", Respond in a friendly,
You are a customer chat support agent of an airline named "Funnair". Respond in a friendly,
helpful, and joyful manner.
Before providing information about a booking or cancelling a booking, you MUST always
@@ -524,7 +524,7 @@ Example usage:
[source,java]
----
javaCopySimpleLoggerAdvisor customLogger = new SimpleLoggerAdvisor(
SimpleLoggerAdvisor customLogger = new SimpleLoggerAdvisor(
request -> "Custom request: " + request.userText,
response -> "Custom response: " + response.getResult()
);

View File

@@ -235,6 +235,7 @@ class MyTextReader {
MyTextReader(@Value("classpath:text-source.txt") Resource resource) {
this.resource = resource;
}
List<Document> loadText() {
TextReader textReader = new TextReader(this.resource);
textReader.getCustomMetadata().put("filename", "text-source.txt");
@@ -447,7 +448,7 @@ dependencies {
@Component
public class MyPagePdfDocumentReader {
List<Document> getDocsFromPdfwithCatalog() {
List<Document> getDocsFromPdfWithCatalog() {
ParagraphPdfDocumentReader pdfReader = new ParagraphPdfDocumentReader("classpath:/sample1.pdf",
PdfDocumentReaderConfig.builder()
@@ -458,7 +459,7 @@ public class MyPagePdfDocumentReader {
.withPagesPerDocument(1)
.build());
return pdfReader.read();
return pdfReader.read();
}
}
----

View File

@@ -144,7 +144,7 @@ public class ImageGeneration implements ModelResult<Image> {
private Image image;
@Override
@Override
public Image getOutput() {...}
@Override

View File

@@ -12,7 +12,7 @@ The Spring AI interface for evaluating responses is `Evaluator`, defined as:
----
@FunctionalInterface
public interface Evaluator {
EvaluationResponse evaluate(EvaluationRequest evaluationRequest)
EvaluationResponse evaluate(EvaluationRequest evaluationRequest);
}
----