feat: add Tencent Cloud TokenHub provider with auto model sync
Fetch GET /v1/models on provider/key switch, activate online chat models, and accept HERMIT_/CST_ key env aliases plus tencent* provider names. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-1
@@ -143,7 +143,15 @@ int main(void) {
|
||||
"{\"id\":\"vllm-model\",\"max_model_len\":32768,"
|
||||
"\"modalities\":{\"input\":[\"text\"]}},"
|
||||
"{\"id\":\"plain\"}]}");
|
||||
g_nresp = 6;
|
||||
/* TokenHub-style: status + non-chat ids */
|
||||
g_responses[6] = RESP(
|
||||
"200 OK",
|
||||
"{\"object\":\"list\",\"data\":["
|
||||
"{\"id\":\"hy3\",\"status\":\"online\"},"
|
||||
"{\"id\":\"gone\",\"status\":\"offline\"},"
|
||||
"{\"id\":\"text-embedding-v1\",\"status\":\"online\"},"
|
||||
"{\"id\":\"deepseek-v4-pro\",\"status\":\"pre-offline\"}]}");
|
||||
g_nresp = 7;
|
||||
int port = start_server();
|
||||
pthread_t th;
|
||||
CHECK(pthread_create(&th, NULL, serve, NULL) == 0);
|
||||
@@ -185,6 +193,11 @@ int main(void) {
|
||||
CHECK(meta[2].context == 32768 && meta[2].vision == 0);
|
||||
CHECK(meta[3].vision == -1 && meta[3].context == 0 && !meta[3].has_price);
|
||||
|
||||
n = cst_llm_list_models(base, "sk-test", ids, 8, err, sizeof(err));
|
||||
CHECK(n == 2);
|
||||
CHECK(strcmp(ids[0], "hy3") == 0);
|
||||
CHECK(strcmp(ids[1], "deepseek-v4-pro") == 0);
|
||||
|
||||
pthread_join(th, NULL);
|
||||
test_sock_close(g_listen);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user