Skip to content

Commit c93c6fd

Browse files
jxblumilayaperumalg
authored andcommitted
Fix grammar and minor typos in documentation as well as Javadoc.
Closes #1652
1 parent 9cf6633 commit c93c6fd

File tree

7 files changed

+32
-34
lines changed

7 files changed

+32
-34
lines changed

spring-ai-core/src/main/java/org/springframework/ai/chat/messages/MessageType.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,36 @@
1717
package org.springframework.ai.chat.messages;
1818

1919
/**
20-
* The MessageType enum represents the type of message in a chat application. It can be
21-
* one of the following: USER, ASSISTANT, SYSTEM, FUNCTION.
20+
* Enumeration representing types of {@link Message Messages} in a chat application. It
21+
* can be one of the following: USER, ASSISTANT, SYSTEM, FUNCTION.
2222
*/
2323
public enum MessageType {
2424

2525
/**
26-
* A message of the type 'user' passed as input Messages with the user role are from
27-
* the end-user or developer.
26+
* A {@link Message} of type {@literal user}, having the user role and originating
27+
* from an end-user or developer.
2828
* @see UserMessage
2929
*/
3030
USER("user"),
3131

3232
/**
33-
* A message of the type 'assistant' passed as input Messages with the message is
34-
* generated as a response to the user.
33+
* A {@link Message} of type {@literal assistant} passed in subsequent input
34+
* {@link Message Messages} as the {@link Message} generated in response to the user.
3535
* @see AssistantMessage
3636
*/
3737
ASSISTANT("assistant"),
3838

3939
/**
40-
* A message of the type 'system' passed as input Messages with high level
41-
* instructions for the conversation, such as behave like a certain character or
42-
* provide answers in a specific format.
40+
* A {@link Message} of type {@literal system} passed as input {@link Message
41+
* Messages} containing high-level instructions for the conversation, such as behave
42+
* like a certain character or provide answers in a specific format.
4343
* @see SystemMessage
4444
*/
4545
SYSTEM("system"),
4646

4747
/**
48-
* A message of the type 'function' passed as input Messages with a function content
49-
* in a chat application.
48+
* A {@link Message} of type {@literal function} passed as input {@link Message
49+
* Messages} with function content in a chat application.
5050
* @see ToolResponseMessage
5151
*/
5252
TOOL("tool");

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
import org.springframework.lang.Nullable;
2323

2424
/**
25-
* The ChatOptions represent the common options, portable across different chat models.
25+
* {@link ModelOptions} representing the common options that are portable across different
26+
* chat models.
2627
*/
2728
public interface ChatOptions extends ModelOptions {
2829

spring-ai-core/src/main/java/org/springframework/ai/evaluation/FactCheckingEvaluator.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
import org.springframework.ai.chat.client.ChatClient;
2222

2323
/**
24-
* The FactCheckingEvaluator class implements a method for evaluating the factual accuracy
25-
* of Large Language Model (LLM) responses against provided context.
26-
*
24+
* Implementation of {@link Evaluator} used to evaluate the factual accuracy of Large
25+
* Language Model (LLM) responses against provided context.
26+
* <p/>
2727
* This evaluator addresses a specific type of potential error in LLM outputs known as
2828
* "hallucination" in the context of grounded factuality. It verifies whether a given
2929
* statement (the "claim") is logically supported by a provided context (the "document").
30-
*
30+
* <p/>
3131
* Key concepts: - Document: The context or grounding information against which the claim
3232
* is checked. - Claim: The statement to be verified against the document.
33-
*
33+
* <p/>
3434
* The evaluator uses a prompt-based approach with a separate, typically smaller and more
3535
* efficient LLM to perform the fact-checking. This design choice allows for
3636
* cost-effective and rapid verification, which is crucial when evaluating longer LLM
3737
* outputs that may require multiple verification steps.
38-
*
38+
* <p/>
3939
* Implementation note: For efficient and accurate fact-checking, consider using
4040
* specialized models like Bespoke-Minicheck, a grounded factuality checking model
4141
* developed by Bespoke Labs and available in Ollama. Such models are specifically
@@ -45,12 +45,12 @@
4545
* Hallucinations with Bespoke-Minicheck</a> and the research paper:
4646
* <a href="https://arxiv.org/pdf/2404.10774v1">MiniCheck: An Efficient Method for LLM
4747
* Hallucination Detection</a>
48-
*
48+
* <p/>
4949
* Note: This evaluator is specifically designed to fact-check statements against given
5050
* information. It's not meant for other types of accuracy tests, like quizzing an AI on
5151
* obscure facts without giving it any reference material to work with (so-called 'closed
5252
* book' scenarios).
53-
*
53+
* <p/>
5454
* The evaluation process aims to determine if the claim is supported by the document,
5555
* returning a boolean result indicating whether the fact-check passed or failed.
5656
*
@@ -79,7 +79,6 @@ public FactCheckingEvaluator(ChatClient.Builder chatClientBuilder) {
7979
this.chatClientBuilder = chatClientBuilder;
8080
}
8181

82-
@Override
8382
/**
8483
* Evaluates whether the response content in the EvaluationRequest is factually
8584
* supported by the context provided in the same request.
@@ -88,6 +87,7 @@ public FactCheckingEvaluator(ChatClient.Builder chatClientBuilder) {
8887
* @return An EvaluationResponse indicating whether the claim is supported by the
8988
* document
9089
*/
90+
@Override
9191
public EvaluationResponse evaluate(EvaluationRequest evaluationRequest) {
9292
var response = evaluationRequest.getResponseContent();
9393
var context = doGetSupportingData(evaluationRequest);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ static FunctionCallingOptionsBuilder builder() {
5353
void setFunctionCallbacks(List<FunctionCallback> functionCallbacks);
5454

5555
/**
56-
* @return List of function names from the ChatModel registry to be used in the next
57-
* chat completion requests.
56+
* @return <@link Set> of function names from the ChatModel registry to be used in the
57+
* next chat completion requests.
5858
*/
5959
Set<String> getFunctions();
6060

spring-ai-core/src/main/java/org/springframework/ai/observation/conventions/AiObservationMetricNames.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
package org.springframework.ai.observation.conventions;
1818

1919
/**
20-
* Collection of metric names used in AI observations. Based on the OpenTelemetry Semantic
21-
* Conventions for AI Systems.
20+
* Enumeration of metric names used in AI observations.
21+
* <p/>
22+
* Based on OpenTelemetry's Semantic Conventions for AI systems.
2223
*
2324
* @author Thomas Vitale
2425
* @since 1.0.0
@@ -28,10 +29,7 @@
2829
*/
2930
public enum AiObservationMetricNames {
3031

31-
// @formatter:off
32-
33-
OPERATION_DURATION("gen_ai.client.operation.duration"),
34-
TOKEN_USAGE("gen_ai.client.token.usage");
32+
OPERATION_DURATION("gen_ai.client.operation.duration"), TOKEN_USAGE("gen_ai.client.token.usage");
3533

3634
private final String value;
3735

@@ -43,6 +41,4 @@ public String value() {
4341
return this.value;
4442
}
4543

46-
// @formatter:on
47-
4844
}

spring-ai-core/src/main/java/org/springframework/ai/vectorstore/observation/VectorStoreObservationContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ public void setQueryResponse(@Nullable List<Document> queryResponse) {
152152
public enum Operation {
153153

154154
/**
155-
* VectorStore delete operation.
155+
* VectorStore add operation.
156156
*/
157157
ADD("add"),
158158
/**
159-
* VectorStore add operation.
159+
* VectorStore delete operation.
160160
*/
161161
DELETE("delete"),
162162
/**

spring-ai-docs/src/main/antora/modules/ROOT/pages/getting-started.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33

44
This section offers jumping off points for how to get started using Spring AI.
55

6-
You should follow the steps in each of the following section according to your needs.
6+
You should follow the steps in each of the following sections according to your needs.
77

88
NOTE: Spring AI supports Spring Boot 3.2.x and 3.3.x
99

10+
[[spring-initializr]]
1011
== Spring Initializr
1112

1213
Head on over to https://start.spring.io/[start.spring.io] and select the AI Models and Vector Stores that you want to use in your new applications.

0 commit comments

Comments
 (0)