mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: updated docstrings of all _files (#1107)
* updated docstrings of all _files * fix mypy * fixed codeblocks in workflows and some other files --------- Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
d6c40edbc6
commit
8b80a03fbb
@@ -168,10 +168,10 @@ class RedisChatMessageStore:
|
||||
- LTRIM operation is atomic for consistent message limits
|
||||
|
||||
Example:
|
||||
```python
|
||||
messages = [ChatMessage(role=Role.USER, text="Hello"), ChatMessage(role=Role.ASSISTANT, text="Hi there!")]
|
||||
await store.add_messages(messages)
|
||||
```
|
||||
.. code-block:: python
|
||||
|
||||
messages = [ChatMessage(role="user", text="Hello"), ChatMessage(role="assistant", text="Hi there!")]
|
||||
await store.add_messages(messages)
|
||||
"""
|
||||
if not messages:
|
||||
return
|
||||
@@ -200,10 +200,10 @@ class RedisChatMessageStore:
|
||||
Returns empty list if no messages exist or if Redis connection fails.
|
||||
|
||||
Example:
|
||||
```python
|
||||
# Get all conversation history
|
||||
messages = await store.list_messages()
|
||||
```
|
||||
.. code-block:: python
|
||||
|
||||
# Get all conversation history
|
||||
messages = await store.list_messages()
|
||||
"""
|
||||
# Ensure any initial messages are persisted to Redis first
|
||||
await self._ensure_initial_messages_added()
|
||||
@@ -320,14 +320,14 @@ class RedisChatMessageStore:
|
||||
- Consider exporting messages before clearing if backup is needed
|
||||
|
||||
Example:
|
||||
```python
|
||||
# Clear conversation history
|
||||
await store.clear()
|
||||
.. code-block:: python
|
||||
|
||||
# Verify messages are gone
|
||||
messages = await store.list_messages()
|
||||
assert len(messages) == 0
|
||||
```
|
||||
# Clear conversation history
|
||||
await store.clear()
|
||||
|
||||
# Verify messages are gone
|
||||
messages = await store.list_messages()
|
||||
assert len(messages) == 0
|
||||
"""
|
||||
await self._redis_client.delete(self.redis_key)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user