eca icon indicating copy to clipboard operation
eca copied to clipboard

Different think tags for openai-chat

Open zrubing opened this issue 1 year ago • 6 comments

Image

  "providers": {
    "bigmodel": {
      "api": "openai-chat",
      "url": "https://open.bigmodel.cn",
      "keyRc": "open.bigmodel.cn",
      "models": {
        "GLM-4.6": {
          "modelName": "GLM-4.6"
        }
      },
      "completionUrlRelativePath": "/api/coding/paas/v4/chat/completions"
    }

zrubing avatar Oct 30 '25 15:10 zrubing

@zrubing can you (setq eca-extra-args '("--log-level debug")) and restart eca and repro again, it should print the LLM response in eca-show-stderr so we can understand LLM behavior.

ericdallo avatar Oct 30 '25 16:10 ericdallo

ps -aux | grep eca jojo 641615 0.6 0.6 39342324 175240 ? Ssl 01:24 0:01 /etc/profiles/per-user/jojo/bin/eca server --log-level debug

i have set this flag , no llm message , only tool calls

Image

zrubing avatar Oct 30 '25 17:10 zrubing

sorry, it needs to be (setq eca-extra-args '("--log-level" "debug"))

ericdallo avatar Oct 30 '25 18:10 ericdallo

[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning_content "\n"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "现在我"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "需要"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "添加"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content " `"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "getTime"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "Zone"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "By"}}]}
[OPENAI-CHAT] [2031]  {:id "202510310937484d531a3920694072", :created 1761874668, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "Locale"}}]}


[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "", :reasoning_content "\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "</think>"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "##"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content " 总结"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "\n\n"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "我已经"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "成功"}}]}
[OPENAI-CHAT] [1188]  {:id "202510310943183bd72828dc2b42a6", :created 1761874999, :model "glm-4.6", :choices [{:index 0, :delta {:role "assistant", :content "实现了"}}]}

zrubing avatar Oct 31 '25 01:10 zrubing

@zrubing I may know what is happening here, it seems this model outputs thinking tags in a different way not following the standard of <think> and then </think>, it always does </think> and then </think>.

I think we can make configuration generic to make that work, so you can test it

ericdallo avatar Oct 31 '25 12:10 ericdallo

@zrubing I released 0.75.4 which allows you configure custom start and end think tags, your config should look something like:

 "providers": {
    "bigmodel": {
      "api": "openai-chat",
      "url": "https://open.bigmodel.cn",
      "keyRc": "open.bigmodel.cn",
      "models": {
        "GLM-4.6": {
          "modelName": "GLM-4.6"
        }
      },
      "completionUrlRelativePath": "/api/coding/paas/v4/chat/completions",
      "thinkTagStart": "</think>",
      "thinkTagEnd": "</think>"
    }

LMK if it works!

ericdallo avatar Oct 31 '25 13:10 ericdallo