providers: add teamorouter; pick the first /models id when no default model

This commit is contained in:
WHC
2026-10-08 14:30:00 +08:00
parent 1772c26d43
commit 0226f417ff
6 changed files with 52 additions and 5 deletions
+6
View File
@@ -72,6 +72,12 @@ static int start_server(void) {
"Connection: close\r\n\r\n" body
int main(void) {
const cst_provider_t *tr = cst_provider_find("teamorouter");
CHECK(tr && strcmp(tr->api_base, "https://api.teamorouter.com/v1") == 0);
CHECK(tr->model[0] == 0); /* picked from GET /models */
CHECK(cst_model_context_tokens("anthropic/claude-sonnet-4") == 200000);
CHECK(cst_model_context_tokens("deepseek-flash") == 128000);
g_responses[0] = RESP("200 OK", "{\"object\":\"list\",\"data\":["
"{\"id\":\"deepseek-flash\"},"
"{\"id\":\"deepseek-v4-pro\"},"