Connect to Discord, switch to NVIDIA NIM providers
- Enable Discord channel, respond to all messages from allowed users - Switch all agents to NVIDIA NIM (Kimi K2.5, DeepSeek V3.1) - Auto-approve all tools for non-interactive Docker deployment - Fix tool call arguments serialization (dict → JSON string) - Fix Dockerfile to copy source before uv sync Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,9 +4,8 @@ RUN pip install uv
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml .
|
||||
RUN uv sync --no-dev
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN uv sync --no-dev
|
||||
|
||||
CMD ["uv", "run", "xtrm-agent", "serve"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: coder
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4-5-20250929
|
||||
provider: kimi
|
||||
model: nvidia_nim/moonshotai/kimi-k2.5
|
||||
temperature: 0.3
|
||||
max_iterations: 30
|
||||
tools:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: researcher
|
||||
provider: deepseek
|
||||
model: deepseek/deepseek-chat-v3.1
|
||||
model: nvidia_nim/deepseek-ai/deepseek-v3.1
|
||||
temperature: 0.5
|
||||
max_iterations: 20
|
||||
tools:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: reviewer
|
||||
provider: anthropic
|
||||
model: claude-sonnet-4-5-20250929
|
||||
provider: kimi
|
||||
model: nvidia_nim/moonshotai/kimi-k2.5
|
||||
temperature: 0.2
|
||||
max_iterations: 15
|
||||
tools:
|
||||
|
||||
@@ -4,10 +4,7 @@ services:
|
||||
container_name: xtrm-agent
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
||||
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
|
||||
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
|
||||
- MINIMAX_API_KEY=${MINIMAX_API_KEY}
|
||||
- NVIDIA_NIM_API_KEY=${NVIDIA_NIM_API_KEY}
|
||||
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
|
||||
volumes:
|
||||
- ./config.yaml:/app/config.yaml:ro
|
||||
|
||||
21
config.yaml
21
config.yaml
@@ -1,27 +1,25 @@
|
||||
llm:
|
||||
providers:
|
||||
anthropic:
|
||||
model: claude-sonnet-4-5-20250929
|
||||
max_tokens: 8192
|
||||
deepseek:
|
||||
provider: litellm
|
||||
model: deepseek/deepseek-chat-v3.1
|
||||
kimi:
|
||||
provider: litellm
|
||||
model: openrouter/moonshotai/kimi-k2.5
|
||||
model: nvidia_nim/moonshotai/kimi-k2.5
|
||||
deepseek:
|
||||
provider: litellm
|
||||
model: nvidia_nim/deepseek-ai/deepseek-v3.1
|
||||
minimax:
|
||||
provider: litellm
|
||||
model: minimax/MiniMax-M2.1
|
||||
model: nvidia_nim/minimaxai/minimax-m2.1
|
||||
|
||||
channels:
|
||||
cli:
|
||||
enabled: true
|
||||
default_agent: coder
|
||||
discord:
|
||||
enabled: false
|
||||
enabled: true
|
||||
token_env: DISCORD_BOT_TOKEN
|
||||
default_agent: coder
|
||||
allowed_users: []
|
||||
allowed_users:
|
||||
- "1367816056244273243"
|
||||
|
||||
tools:
|
||||
workspace: ./data
|
||||
@@ -30,10 +28,9 @@ tools:
|
||||
- list_dir
|
||||
- web_fetch
|
||||
- delegate
|
||||
require_approval:
|
||||
- bash
|
||||
- write_file
|
||||
- edit_file
|
||||
- bash
|
||||
|
||||
mcp_servers: {}
|
||||
|
||||
|
||||
@@ -45,16 +45,10 @@ class DiscordChannel(BaseChannel):
|
||||
if message.author.bot:
|
||||
return
|
||||
|
||||
# Check allowlist
|
||||
# Check allowlist — if set, only respond to listed users
|
||||
if self.allowed_users and str(message.author.id) not in self.allowed_users:
|
||||
return
|
||||
|
||||
# Only respond to mentions or DMs
|
||||
is_dm = isinstance(message.channel, discord.DMChannel)
|
||||
is_mentioned = self.client.user in message.mentions if self.client.user else False
|
||||
if not is_dm and not is_mentioned:
|
||||
return
|
||||
|
||||
content = message.content
|
||||
# Strip bot mention from content
|
||||
if self.client.user:
|
||||
|
||||
@@ -7,6 +7,8 @@ from typing import Any
|
||||
from loguru import logger
|
||||
|
||||
from xtrm_agent.config import AgentFileConfig
|
||||
import json
|
||||
|
||||
from xtrm_agent.llm.provider import LLMProvider, LLMResponse
|
||||
from xtrm_agent.tools.approval import ApprovalEngine
|
||||
from xtrm_agent.tools.registry import ToolRegistry
|
||||
@@ -100,7 +102,7 @@ class Engine:
|
||||
{
|
||||
"id": tc.id,
|
||||
"type": "function",
|
||||
"function": {"name": tc.name, "arguments": tc.arguments},
|
||||
"function": {"name": tc.name, "arguments": json.dumps(tc.arguments)},
|
||||
}
|
||||
for tc in response.tool_calls
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user