refactor: optimize matrix channel — optional deps, trim comments, simplify methods
This commit is contained in:
@@ -312,7 +312,11 @@ nanobot gateway
|
||||
<details>
|
||||
<summary><b>Matrix (Element)</b></summary>
|
||||
|
||||
Uses Matrix sync via `matrix-nio` (inbound media + outbound file attachments).
|
||||
Install Matrix dependencies first:
|
||||
|
||||
```bash
|
||||
pip install nanobot-ai[matrix]
|
||||
```
|
||||
|
||||
**1. Create/choose a Matrix account**
|
||||
|
||||
|
||||
@@ -229,8 +229,6 @@ class AgentLoop:
|
||||
)
|
||||
else:
|
||||
clean = self._strip_think(response.content)
|
||||
if on_progress and clean:
|
||||
await on_progress(clean)
|
||||
messages = self.context.add_assistant_message(
|
||||
messages, clean, reasoning_content=response.reasoning_content,
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,12 +42,14 @@ dependencies = [
|
||||
"prompt-toolkit>=3.0.50,<4.0.0",
|
||||
"mcp>=1.26.0,<2.0.0",
|
||||
"json-repair>=0.57.0,<1.0.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
matrix = [
|
||||
"matrix-nio[e2e]>=0.25.2",
|
||||
"mistune>=3.0.0,<4.0.0",
|
||||
"nh3>=0.2.17,<1.0.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=9.0.0,<10.0.0",
|
||||
"pytest-asyncio>=1.3.0,<2.0.0",
|
||||
|
||||
Reference in New Issue
Block a user