Skip to content

Commit f955fd7

Browse files
committed
Fix code style and javadoc
- update spring boot to 3.2.5. - fix Content's JavaDoc. - remove wildcard java imports.
1 parent 1145060 commit f955fd7

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119

120120
<!-- production dependencies -->
121121
<spring-cloud-function-context.version>4.1.1</spring-cloud-function-context.version>
122-
<spring-boot.version>3.2.4</spring-boot.version>
122+
<spring-boot.version>3.2.5</spring-boot.version>
123123
<spring-framework.version>6.1.4</spring-framework.version>
124124
<stringtemplate.version>4.0.2</stringtemplate.version>
125125
<azure-open-ai-client.version>1.0.0-beta.8</azure-open-ai-client.version>

spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/transformer/PromptContext.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,22 @@
1616

1717
package org.springframework.ai.chat.prompt.transformer;
1818

19+
import java.util.ArrayList;
20+
import java.util.HashMap;
21+
import java.util.List;
22+
import java.util.Map;
23+
import java.util.Objects;
24+
1925
import org.springframework.ai.chat.prompt.Prompt;
2026
import org.springframework.ai.model.Content;
2127

22-
import java.util.*;
23-
2428
/**
2529
* The shared, at the moment, mutable, data structure that can be used to implement
2630
* ChatBot functionality.
2731
*
2832
* @author Mark Pollack
2933
* @author Christian Tzolov
30-
* @since 1.0 M1
34+
* @since 1.0.0
3135
*/
3236
public class PromptContext {
3337

spring-ai-core/src/main/java/org/springframework/ai/model/Content.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,29 @@
66
import java.util.Map;
77

88
/**
9-
* A simple data structure that contains content and metadata.
9+
* Data structure that contains content and metadata. Common parent for the
10+
* {@link org.springframework.ai.document.Document} and the
11+
* {@link org.springframework.ai.chat.messages.Message} classes.
1012
*
11-
* @param <T> the type of content in the node
1213
* @author Mark Pollack
13-
* @since 1.0 M1
14+
* @author Christian Tzolov
15+
* @since 1.0.0
1416
*/
1517
public interface Content {
1618

19+
/**
20+
* Get the content of the message.
21+
*/
1722
String getContent();
1823

24+
/**
25+
* Get the media associated with the content.
26+
*/
1927
List<Media> getMedia();
2028

29+
/**
30+
* return Get the metadata associated with the content.
31+
*/
2132
Map<String, Object> getMetadata();
2233

2334
}

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/structured-output-converter.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,12 @@ image::structured-output-hierarchy4.jpg[Structured Output Class Hierarchy, width
9191
* `MapOutputConverter` - Extends the functionality of `AbstractMessageOutputConverter` with a `FormatProvider` implementation that guides the AI Model to generate an RFC8259 compliant JSON response. Additionally, it incorporates a converter implementation that utilizes the provided `MessageConverter` to translate the JSON payload into a `java.util.Map<String, Object>` instance.
9292
* `ListOutputConverter` - Extends the `AbstractConversionServiceOutputConverter` and includes a `FormatProvider` implementation tailored for comma-delimited list output. The converter implementation employs the provided `ConversionService` to transform the model text output into a `java.util.List`.
9393

94-
9594
== Using Converters
9695

9796
The following sections provide guides how to use the available converters to generate structured outputs.
9897

9998
=== Bean Output Converter
10099

101-
102100
The following example shows how to use `BeanOutputConverter` to generate the filmography for an actor.
103101

104102
The target record representing actor's filmography:
@@ -113,7 +111,7 @@ Here is how to apply the BeanOutputConverter:
113111

114112
[source,java]
115113
----
116-
BeanConverter<ActorsFilms> beanOutputConverter =
114+
BeanOutputConverter<ActorsFilms> beanOutputConverter =
117115
new BeanOutputConverter<>(ActorsFilms.class);
118116
119117
String format = beanOutputConverter.getFormat();

0 commit comments

Comments
 (0)