agent.py hinzugefügt
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import json
|
||||
import re
|
||||
|
||||
from config import OPENROUTER_MODEL
|
||||
from openrouter_client import client
|
||||
from mcp_client import MCPClient
|
||||
|
||||
|
||||
class Agent:
|
||||
def __init__(self):
|
||||
self.mcp = MCPClient()
|
||||
self.tools = []
|
||||
self.messages = [
|
||||
{
|
||||
"role": "system",
|
||||
"content": (
|
||||
"Du bist JARVIS, ein Smart-Home Assistent.\n"
|
||||
"Du kannst MCP Tools verwenden.\n\n"
|
||||
"Wenn du ein Tool benutzen willst, antworte STRICT als JSON:\n"
|
||||
"{\n"
|
||||
' "tool": "tool_name",\n'
|
||||
' "args": {...}\n'
|
||||
"}\n\n"
|
||||
"Wenn kein Tool nötig ist:\n"
|
||||
"{\n"
|
||||
' "response": "Text"\n'
|
||||
"}\n\n"
|
||||
"WICHTIG:\n"
|
||||
"- KEIN Markdown\n"
|
||||
"- KEIN zusätzlicher Text\n"
|
||||
"- NUR JSON\n"
|
||||
)
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user