Skip to content

Commit 780ea22

Browse files
Update ai_assistant.md
1 parent cecbf6b commit 780ea22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/uc/ai_assistant.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ AI assistants need context from previous messages to provide coherent responses.
1414

1515
```redis:[run_confirmation=true] Store conversation history
1616
// Add user message to session
17-
LPUSH user:alice:history:session_001 '{"type": "human", "content": "What's the weather like?", "timestamp": 1717935001}'
17+
LPUSH user:alice:history:session_001 '{"type": "human", "content": "What is the weather like?", "timestamp": 1717935001}'
1818
1919
// Add AI response
20-
LPUSH user:alice:history:session_001 '{"type": "ai", "content": "It's sunny with 75°F temperature.", "timestamp": 1717935002}'
20+
LPUSH user:alice:history:session_001 '{"type": "ai", "content": "It is sunny with 75°F temperature.", "timestamp": 1717935002}'
2121
2222
// Add another user message
2323
LPUSH user:alice:history:session_001 '{"type": "human", "content": "Should I bring an umbrella?", "timestamp": 1717935003}'
@@ -73,7 +73,7 @@ The `HINCR` command allows you to atomically increment the counter, preventing r
7373

7474
```redis:[run_confirmation=true] Increment Requests
7575
// Increment request counter
76-
HINCR user:alice:rate_limit requests_per_minute
76+
HINCRBY user:alice:rate_limit requests_per_minute 1
7777
7878
// Check if field exists and get count
7979
HEXISTS user:alice:rate_limit requests_per_minute
@@ -164,7 +164,7 @@ FT.SEARCH idx:knowledge
164164
FT.SEARCH idx:knowledge
165165
"(@user_id:{alice} @timestamp:[1717935000 +inf]) => [KNN 5 @embedding $vec AS score]"
166166
PARAMS 2 vec "\x3f\x80\x00\x00\x40\x40\x00\x00\x40\x00\x00\x00\x3f\x40\x00\x00\x40\x80\x00\x00\x40\x20\x00\x00\x3f\x00\x00\x00\x40\x60\x00\x00"
167-
RETURN 4 content timestamp score
167+
RETURN 3 content timestamp score
168168
SORTBY score ASC
169169
DIALECT 2
170170
```

0 commit comments

Comments
 (0)