Skip to content

Commit

Permalink
optimize code and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Sep 10, 2023
1 parent 3480728 commit 4153d69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The following example can view in the [langchain-example](langchain-examples/src
### 3.1 LLMs
- [OpenAI](langchain-examples/src/main/java/com/hw/langchain/examples/llms/OpenAIExample.java)
- [Azure OpenAI](openai-client/src/test/java/com/hw/openai/AzureOpenAiClientTest.java)
- [ChatGLM2-6B](langchain-examples/src/main/java/com/hw/langchain/examples/llms/ChatGLMExample.java)
- [ChatGLM2](langchain-examples/src/main/java/com/hw/langchain/examples/llms/ChatGLMExample.java)
- [Ollama](langchain-examples/src/main/java/com/hw/langchain/examples/llms/OllamaExample.java)

### 3.2 Vector stores
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* @author HamaWhite
*/
public abstract class BaseChatMemory extends BaseMemory {
public abstract class BaseChatMemory implements BaseMemory {

protected BaseChatMessageHistory chatMemory = new ChatMessageHistory();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@
*
* @author HamaWhite
*/
public abstract class BaseMemory {
public interface BaseMemory {

/**
* Input keys this memory class will load dynamically
*/
public abstract List<String> memoryVariables();
List<String> memoryVariables();

/**
* Return key-value pairs given the text input to the chain.
* If None, return all memories
*/
public abstract Map<String, Object> loadMemoryVariables(Map<String, Object> inputs);
Map<String, Object> loadMemoryVariables(Map<String, Object> inputs);

/**
* Save the context of this model run to memory.
*/
public abstract void saveContext(Map<String, Object> inputs, Map<String, String> outputs);
void saveContext(Map<String, Object> inputs, Map<String, String> outputs);

/**
* Clear memory contents.
*/
public abstract void clear();
void clear();
}

0 comments on commit 4153d69

Please sign in to comment.