Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions nextjs_frontend_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ def evaluate_dccd_schema_guard(self, schema_type: str, data: dict) -> bool:
return required_keys.issubset(data.keys())
return False

def _check_adjectival_bound(self, intent: str) -> bool:
words = intent.split()
banned_adj = ["revolutionary", "fast", "seamless",
"disruptive", "amazing"]
adjective_count = sum(1 for word in words if word.lower()
in banned_adj)
return adjective_count <= 2

def _determine_target_agent(self, intent: str) -> str:
if "security" in intent or "trust" in intent:
return "cipher"
elif "developer" in intent or "code" in intent:
return "dax-01"
elif "validation" in intent or "ingress" in intent:
return "kira-7"
return "vulcan"

def route_request(self, user_id: str, data: dict) -> dict:
"""
Routes the user request to the appropriate agent \
Expand All @@ -55,25 +72,14 @@ def route_request(self, user_id: str, data: dict) -> dict:
intent = data.get("agent_intent", "")

# Enforce AdjectivalBound (max 2 limit)
words = intent.split()
banned_adj = ["revolutionary", "fast", "seamless",
"disruptive", "amazing"]
adjective_count = sum(1 for word in words if word.lower()
in banned_adj)
if adjective_count > 2:
if not self._check_adjectival_bound(intent):
return {
"error": "AdjectivalBound exceeded. "
"Too many evaluative adjectives."
}

# Determine the target agent
target_agent = "vulcan" # Default fallback
if "security" in intent or "trust" in intent:
target_agent = "cipher"
elif "developer" in intent or "code" in intent:
target_agent = "dax-01"
elif "validation" in intent or "ingress" in intent:
target_agent = "kira-7"
target_agent = self._determine_target_agent(intent)

# Log the request
self.request_logs.append({
Expand Down
Loading