From 875eee1b5973c6b8c3db82dad91055a0fcbc1e61 Mon Sep 17 00:00:00 2001 From: gotyuo Date: Tue, 24 Mar 2026 08:10:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 "\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" diff --git "a/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" "b/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" new file mode 100644 index 00000000..733e2197 --- /dev/null +++ "b/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" @@ -0,0 +1,3 @@ +如果模型调用报错,需要去调整这个c文件 +大概是182 的文字 +有几个地方要调整 把硅基流动的调整为你使用的 \ No newline at end of file From 96670e759daffd40d42d9338fab43e0abf4b2b8b Mon Sep 17 00:00:00 2001 From: gotyuo Date: Tue, 31 Mar 2026 15:09:15 +0800 Subject: [PATCH 2/2] Adjust C file for model error handling and provider settings Updated the C file to adjust provider settings and API paths for model calls. --- ...m\346\226\207\344\273\266\344\270\213.txt" | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git "a/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" "b/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" index 733e2197..71b2a5c0 100644 --- "a/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" +++ "b/\345\246\202\346\236\234\344\270\215\345\245\275\347\224\250\357\274\214\351\234\200\350\246\201\350\260\203\346\225\264\350\277\231\344\270\252c\346\226\207\344\273\266\345\234\250mian\343\200\201llm\346\226\207\344\273\266\344\270\213.txt" @@ -1,3 +1,32 @@ -如果模型调用报错,需要去调整这个c文件 -大概是182 的文字 -有几个地方要调整 把硅基流动的调整为你使用的 \ No newline at end of file +如果模型调用报错,需要去调整这个c文件 mimiclaw/main/llm/ +大概是182 的位置 +有几个地方要调整 把硅基流动的调整为你使用的 +/* ── Provider helpers ──────────────────────────────────────────── */ + +static bool provider_is_openai(void) +{ + return strcmp(s_provider, "openai") == 0|| strcmp(s_provider, "siliconflow") == 0; +} + +static const char *llm_api_url(void) +{ + if (strcmp(s_provider, "siliconflow") == 0) return MIMI_SILICONFLOW_API_URL; + if (strcmp(s_provider, "openai") == 0) return MIMI_OPENAI_API_URL; + return MIMI_LLM_API_URL; +} + +static const char *llm_api_host(void) +{ + if (strcmp(s_provider, "siliconflow") == 0) return "api.siliconflow.cn"; + if (strcmp(s_provider, "openai") == 0) return "api.openai.com"; + return "api.anthropic.com"; +} + +static const char *llm_api_path(void) +{ + if (provider_is_openai()) return "/v1/chat/completions"; + return "/v1/messages"; +} + +/* ── Init ─────────────────────────────────────────────────────── */ +调整的意思大概得是 供应商替换siliconflow 20的位置 return "api.siliconflow.cn"; 27 的"/v1/chat/completions 这个v1 有的大模型用的是v4 v5