Skip to content

Commit c836303

Browse files
committed
Docs cleanup in chat memory section
1 parent 52ce565 commit c836303

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ ChatResponse response = ChatClient.builder(chatModel)
341341
.chatResponse();
342342
----
343343

344-
Is this example, the `SearchRequest.defaults()` will perform a similarity search over all documents in the Vector Database.
344+
In this example, the `SearchRequest.defaults()` will perform a similarity search over all documents in the Vector Database.
345345
To restrict the types of documents that are searched, the `SearchRequest` takes a SQL like filter expression that is portable across all `VectorStores`.
346346

347347
==== Dynamic Filter Expressions
@@ -366,24 +366,21 @@ The `FILTER_EXPRESSION` parameter allows you to dynamically filter the search re
366366

367367
=== Chat Memory
368368

369-
The interface `ChatMemory` represents a storage for chat conversation history. It provides methods to add messages to a
370-
* conversation, retrieve messages from a conversation, and clear the conversation history.
369+
The interface `ChatMemory` represents a storage for chat conversation history. It provides methods to add messages to a conversation, retrieve messages from a conversation, and clear the conversation history.
371370

372-
There are two implementations `InMemoryChatMemory` and `CassandraChatMemory` that provides storage for chat conversation history, in-memory and persisted with time-to-live correspondingly.
371+
There are two implementations `InMemoryChatMemory` and `CassandraChatMemory` that provides storage for chat conversation history, in-memory and persisted with `time-to-live` correspondingly.
373372

374-
To create a CassandraChatMemory with time-to-live
373+
To create a `CassandraChatMemory` with `time-to-live`
375374
[source,java]
376375
----
377376
CassandraChatMemory.create(CassandraChatMemoryConfig.builder().withTimeToLive(Duration.ofDays(1)).build());
378377
----
379378

380-
Two advisor implementations use the `ChatMemory` interface to advice the prompt with conversation history which differ in the details of how the memory is added to the prompt
379+
The following advisor implementations use the `ChatMemory` interface to advice the prompt with conversation history which differ in the details of how the memory is added to the prompt
381380

382-
* `MessageChatMemoryAdvisor` : Memory is retrieved added as a collection of messages to the prompt
383-
* `PromptChatMemoryAdvisor` : Memory is retrieved added into the prompt's system text.
384-
385-
386-
* `VectorStoreChatMemoryAdvisor` : The construtor ` VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId, int chatHistoryWindowSize)` lets you specify the VectorStore to retrieve the chat history from, the unqiue conversation ID, the size of the chat history to be retreived in token size.
381+
* `MessageChatMemoryAdvisor` : Memory is retrieved and added as a collection of messages to the prompt
382+
* `PromptChatMemoryAdvisor` : Memory is retrieved and added into the prompt's system text.
383+
* `VectorStoreChatMemoryAdvisor` : The constructor `VectorStoreChatMemoryAdvisor(VectorStore vectorStore, String defaultConversationId, int chatHistoryWindowSize)` lets you specify the VectorStore to retrieve the chat history from, the unique conversation ID, the size of the chat history to be retrieved in token size.
387384

388385
A sample `@Service` implementation that uses several advisors is shown below
389386

0 commit comments

Comments
 (0)