feat(models): declare request APIs per preset
Bind API support and preference to the preset's provider and model. Carry the API declaration through factory selection, fallback chains, hot reload and WebUI persistence. Use Copilot endpoint metadata for automatic routing and keep reasoning replay and compaction defaults in provider capability profiles. Consolidate Responses follow-ups from #5906, #5935, #6020, #6051 and #5834; acknowledge equivalent contributions in #6105 and #5863. Co-authored-by: Parman Mohammadalizadeh <prmma23@gmail.com> Co-authored-by: Lanre Shittu <136805224+Shizoqua@users.noreply.github.com> Co-authored-by: kkkhoo <128304090+kkkhoo@users.noreply.github.com> Co-authored-by: pei711 <199601925+pei711@users.noreply.github.com> Co-authored-by: Steven Huang <134844631+remote-controlled-man@users.noreply.github.com> Co-authored-by: Louis Yue <179701714+selfucker@users.noreply.github.com> Co-authored-by: iuiuiu <92971770+iuiu-py@users.noreply.github.com>
This commit is contained in:
1 parent
3c866d63ac
commit
b5808e47de
23 files changed
+738
-63
No files matched your search
@@ -263,7 +263,7 @@ def test_xai_inference_classifies_typed_reauth() -> None:
|
||||
"responses_model",
|
||||
["gpt-5.4-mini", "gpt-6-astra", "gpt-6-sol", "gpt-6-luna"],
|
||||
)
|
||||
def test_github_copilot_catalog_only_lists_compatible_chat_models(
|
||||
def test_github_copilot_catalog_routes_advertised_model_apis(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
tmp_path: Path,
|
||||
responses_model: str,
|
||||
@@ -345,9 +345,17 @@ def test_github_copilot_catalog_only_lists_compatible_chat_models(
|
||||
assert [model.id for model in catalog.models] == [
|
||||
"github-copilot/claude-sonnet",
|
||||
f"github-copilot/{responses_model}",
|
||||
"github-copilot/unknown-responses-only",
|
||||
]
|
||||
assert catalog.models[0].context_window == 200_000
|
||||
assert catalog.models[0].reasoning_efforts == ("low", "high")
|
||||
assert catalog.models[0].api.supported_apis == ("chat_completions",)
|
||||
assert catalog.models[2].api.supported_apis == ("responses",)
|
||||
from nanobot.providers.github_copilot_provider import GitHubCopilotProvider
|
||||
|
||||
provider = GitHubCopilotProvider(default_model="github-copilot/unknown-responses-only")
|
||||
assert provider._should_use_responses_api(None, None)
|
||||
assert not provider._should_use_responses_api("github-copilot/claude-sonnet", "high")
|
||||
assert len(captured) == 2
|
||||
assert captured[0].headers["Authorization"] == "token github-secret"
|
||||
assert captured[1].headers["Authorization"] == "Bearer copilot-secret"
|
||||
|
||||
Reference in new issue
Block a user