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
|
WORKDIR /app
|
||||||
|
|
||||||
COPY pyproject.toml .
|
|
||||||
RUN uv sync --no-dev
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
RUN uv sync --no-dev
|
||||||
|
|
||||||
CMD ["uv", "run", "xtrm-agent", "serve"]
|
CMD ["uv", "run", "xtrm-agent", "serve"]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: coder
|
name: coder
|
||||||
provider: anthropic
|
provider: kimi
|
||||||
model: claude-sonnet-4-5-20250929
|
model: nvidia_nim/moonshotai/kimi-k2.5
|
||||||
temperature: 0.3
|
temperature: 0.3
|
||||||
max_iterations: 30
|
max_iterations: 30
|
||||||
tools:
|
tools:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: researcher
|
name: researcher
|
||||||
provider: deepseek
|
provider: deepseek
|
||||||
model: deepseek/deepseek-chat-v3.1
|
model: nvidia_nim/deepseek-ai/deepseek-v3.1
|
||||||
temperature: 0.5
|
temperature: 0.5
|
||||||
max_iterations: 20
|
max_iterations: 20
|
||||||
tools:
|
tools:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
name: reviewer
|
name: reviewer
|
||||||
provider: anthropic
|
provider: kimi
|
||||||
model: claude-sonnet-4-5-20250929
|
model: nvidia_nim/moonshotai/kimi-k2.5
|
||||||
temperature: 0.2
|
temperature: 0.2
|
||||||
max_iterations: 15
|
max_iterations: 15
|
||||||
tools:
|
tools:
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ services:
|
|||||||
container_name: xtrm-agent
|
container_name: xtrm-agent
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
- NVIDIA_NIM_API_KEY=${NVIDIA_NIM_API_KEY}
|
||||||
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
|
|
||||||
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
|
|
||||||
- MINIMAX_API_KEY=${MINIMAX_API_KEY}
|
|
||||||
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
|
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
|
||||||
volumes:
|
volumes:
|
||||||
- ./config.yaml:/app/config.yaml:ro
|
- ./config.yaml:/app/config.yaml:ro
|
||||||
|
|||||||
21
config.yaml
21
config.yaml
@@ -1,27 +1,25 @@
|
|||||||
llm:
|
llm:
|
||||||
providers:
|
providers:
|
||||||
anthropic:
|
|
||||||
model: claude-sonnet-4-5-20250929
|
|
||||||
max_tokens: 8192
|
|
||||||
deepseek:
|
|
||||||
provider: litellm
|
|
||||||
model: deepseek/deepseek-chat-v3.1
|
|
||||||
kimi:
|
kimi:
|
||||||
provider: litellm
|
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:
|
minimax:
|
||||||
provider: litellm
|
provider: litellm
|
||||||
model: minimax/MiniMax-M2.1
|
model: nvidia_nim/minimaxai/minimax-m2.1
|
||||||
|
|
||||||
channels:
|
channels:
|
||||||
cli:
|
cli:
|
||||||
enabled: true
|
enabled: true
|
||||||
default_agent: coder
|
default_agent: coder
|
||||||
discord:
|
discord:
|
||||||
enabled: false
|
enabled: true
|
||||||
token_env: DISCORD_BOT_TOKEN
|
token_env: DISCORD_BOT_TOKEN
|
||||||
default_agent: coder
|
default_agent: coder
|
||||||
allowed_users: []
|
allowed_users:
|
||||||
|
- "1367816056244273243"
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
workspace: ./data
|
workspace: ./data
|
||||||
@@ -30,10 +28,9 @@ tools:
|
|||||||
- list_dir
|
- list_dir
|
||||||
- web_fetch
|
- web_fetch
|
||||||
- delegate
|
- delegate
|
||||||
require_approval:
|
|
||||||
- bash
|
|
||||||
- write_file
|
- write_file
|
||||||
- edit_file
|
- edit_file
|
||||||
|
- bash
|
||||||
|
|
||||||
mcp_servers: {}
|
mcp_servers: {}
|
||||||
|
|
||||||
|
|||||||
@@ -45,16 +45,10 @@ class DiscordChannel(BaseChannel):
|
|||||||
if message.author.bot:
|
if message.author.bot:
|
||||||
return
|
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:
|
if self.allowed_users and str(message.author.id) not in self.allowed_users:
|
||||||
return
|
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
|
content = message.content
|
||||||
# Strip bot mention from content
|
# Strip bot mention from content
|
||||||
if self.client.user:
|
if self.client.user:
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ from typing import Any
|
|||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from xtrm_agent.config import AgentFileConfig
|
from xtrm_agent.config import AgentFileConfig
|
||||||
|
import json
|
||||||
|
|
||||||
from xtrm_agent.llm.provider import LLMProvider, LLMResponse
|
from xtrm_agent.llm.provider import LLMProvider, LLMResponse
|
||||||
from xtrm_agent.tools.approval import ApprovalEngine
|
from xtrm_agent.tools.approval import ApprovalEngine
|
||||||
from xtrm_agent.tools.registry import ToolRegistry
|
from xtrm_agent.tools.registry import ToolRegistry
|
||||||
@@ -100,7 +102,7 @@ class Engine:
|
|||||||
{
|
{
|
||||||
"id": tc.id,
|
"id": tc.id,
|
||||||
"type": "function",
|
"type": "function",
|
||||||
"function": {"name": tc.name, "arguments": tc.arguments},
|
"function": {"name": tc.name, "arguments": json.dumps(tc.arguments)},
|
||||||
}
|
}
|
||||||
for tc in response.tool_calls
|
for tc in response.tool_calls
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user