-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrun_client_sample.py
More file actions
23 lines (20 loc) · 967 Bytes
/
Copy pathrun_client_sample.py
File metadata and controls
23 lines (20 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from memengine.utils.Client import Client
from default_config.DefaultMemoryConfig import DEFAULT_FUMEMORY
ServerAddress = 'http://127.0.0.1:8426'
def sample_client():
# Create a client to connect with the server.
memory = Client(ServerAddress)
# Initialize the memory model.
memory.initilize_memory('FUMemory', DEFAULT_FUMEMORY)
# Below is as same as the local usage.
memory.reset()
memory.store('Alice is 28 years old and works as a university lecturer.')
memory.store('Alice holds a master\'s degree in English Literature.')
memory.display()
memory.store('Alice loves reading and jogging.')
memory.store('Alice has a pet cat named Whiskers.')
memory.store('Last year, Alice traveled to New York to attend a literary conference.')
memory.store('Bob is Alice\'s best friend, who is an excellent engineer.')
print(memory.recall('What are Alice\'s hobbies?'))
if __name__ == "__main__":
sample_client()