Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions agentic_security/routes/_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@
{"role": "user", "content": "<<PROMPT>>"}
]
}
""",
"""POST https://api.teamorouter.com/v1/chat/completions
Authorization: Bearer $TEAMOROUTER_API_KEY
Content-Type: application/json

{
"model": "deepseek-v4-flash",
"messages": [
{"role": "user", "content": "<<PROMPT>>"}
]
}
""",
]

Expand Down Expand Up @@ -452,6 +463,7 @@
{"name": "UberLLM", "prompts": 40000, "logo": "/icons/myshell.png"},
{"name": "Requesty", "prompts": 40000, "logo": "/icons/myshell.png"},
{"name": "AbliteratedLLM", "prompts": 40000, "logo": "/icons/myshell.png"},
{"name": "TeamoRouter", "prompts": 40000, "logo": "/icons/myshell.png"},
]

LLM_SPECS = [dict(spec=spec, **d) for spec, d in zip(_SPECS, LLM_CONFIGS)]
13 changes: 13 additions & 0 deletions agentic_security/static/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ Content-Type: application/json
{"role": "user", "content": "<<PROMPT>>"}
]
}
`,

`POST https://api.teamorouter.com/v1/chat/completions
Authorization: Bearer $TEAMOROUTER_API_KEY
Content-Type: application/json

{
"model": "deepseek-v4-flash",
"messages": [
{"role": "user", "content": "<<PROMPT>>"}
]
}
`,

]
Expand All @@ -271,6 +283,7 @@ let LLM_CONFIGS = [
{ name: 'UberLLM', prompts: 40000, logo: fallbackIcon },
{ name: 'Requesty', prompts: 40000, logo: fallbackIcon },
{ name: 'AbliteratedLLM', prompts: 40000, logo: fallbackIcon },
{ name: 'TeamoRouter', prompts: 40000, logo: fallbackIcon },

];
function has_image(spec) {
Expand Down
42 changes: 42 additions & 0 deletions tests/unit/test_teamorouter_spec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import json

import httpx
import pytest

from agentic_security.http_spec import LLMSpec, Modality
from agentic_security.routes._specs import LLM_SPECS


def teamorouter_spec() -> LLMSpec:
entry = next(item for item in LLM_SPECS if item["name"] == "TeamoRouter")
return LLMSpec.from_string(entry["spec"])


def test_teamorouter_preset_parses_to_chat_completions():
spec = teamorouter_spec()

assert spec.method == "POST"
assert spec.url == "https://api.teamorouter.com/v1/chat/completions"
assert spec.headers["Authorization"] == "Bearer $TEAMOROUTER_API_KEY"
assert spec.model_name == "deepseek-v4-flash"
assert spec.modality == Modality.TEXT


@pytest.mark.asyncio
async def test_teamorouter_preset_probe_sends_prompt_as_user_message(monkeypatch):
captured = {}

async def fake_request(self, method, url, headers=None, content=None, timeout=None):
captured.update(method=method, url=url, content=content)
return httpx.Response(200, json={"choices": [{"message": {"content": "ok"}}]})

monkeypatch.setattr(httpx.AsyncClient, "request", fake_request)

response = await teamorouter_spec().probe('Say "hi"')

assert response.status_code == 200
assert captured["method"] == "POST"
assert captured["url"] == "https://api.teamorouter.com/v1/chat/completions"
body = json.loads(captured["content"])
assert body["model"] == "deepseek-v4-flash"
assert body["messages"] == [{"role": "user", "content": 'Say "hi"'}]
Loading