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:
@@ -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()
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
----
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ImageGeneration implements ModelResult<Image> {
|
||||
|
||||
private Image image;
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public Image getOutput() {...}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
----
|
||||
|
||||
|
||||
Reference in New Issue
Block a user