Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
lwaekfjlk committed Nov 1, 2023
1 parent 9686111 commit 66f58df
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions llm_generate/test_redis2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from redis_om import JsonModel, get_redis_connection

class Person(JsonModel):
name: str
age: int

# Create an instance of your model
person = Person(name="John", age=30)

# Save to Redis
person.save()

# Retrieve from Redis
retrieved_person = Person.load(person.id)

# Print the retrieved data
print(retrieved_person.name) # Output: John
print(retrieved_person.age) # Output: 30

0 comments on commit 66f58df

Please sign in to comment.