[codex] support openai extra request params#7
[codex] support openai extra request params#7Felix3322 wants to merge 3 commits intoscukeqi:mainfrom
Conversation
|
已按最新 review comment 处理:
本地已在独立干净 worktree 用真实 MSVC 环境重新编过 |
|
感谢极快的commit,可以考虑改变JSON和纯文本方式的顺序,因为有些提供商会主动拒绝不符合其规定格式的
如果您认为实现有困难或者就是觉得我事太多,可以忽略这个建议ovo |
你快速删除文本会出现性能问题吗? |
如果不是个例的话,backspace后就不计算候选了吧 |
我遇到的性能问题是在快速输入文本时卡顿,尤其是输入“`”符号时如果当前键入未上屏下一次键入一定无法输入,快速删除文本时没有遇到任何性能问题。 |
我输入`甚至没反应 |
|
可能是我cpu缩缸了 反正我这装了这个就卡 |
|
我鼠标都动不了了...神经 |
我笔记本液金涂歪了cpu上不了3.0G但是平常都还好,也就是有时候不太跟手,然后用本地模型经常报 |
我刚换完硅脂还是上不了4G(锁在65w了 国内还不管我这死地方的守候 |
|
已按这条最新建议调整:
本地已在干净 worktree 中重新用真实 MSVC 环境编过 对应提交: |
|
Closed as superseded by #10. |
Summary
This PR adds configurable passthrough request fields for the OpenAI-compatible backend so Wisdom-Weasel can talk to provider-specific OpenAI-style APIs that require extra parameters beyond the current fixed request body.
This is related to the follow-up discussion in #4 about supporting vendor-specific controls such as disabling thinking / reasoning output or limiting CoT / reasoning budgets on OpenAI-compatible services.
User impact
Before this change, the OpenAI-compatible request body was effectively hard-coded to:
modelmessagesmax_tokenstemperatureThat worked for basic OpenAI-compatible services, but it blocked or limited compatibility with providers that expect extra JSON fields or custom HTTP headers. In practice that means users could not cleanly pass options like:
reasoning_effortthinkingcontrolschat_template_kwargs.enable_thinkingthinking_budgetAs a result, some providers would either ignore the intended behavior, return overly expensive / verbose reasoning, or require users to patch the source code for every backend variation.
Root cause
The OpenAI-compatible provider and the memory-compression request path both constructed request payloads from a fixed set of fields in C++ and had no general mechanism to:
weasel.yamlFix
This PR introduces a reusable config-to-JSON helper and wires it into both OpenAI-style HTTP call paths.
Code changes
WeaselServer/ConfigJsonUtils.hOpenAICompatibleProviderwith:llm/openai/extra_bodyllm/openai/extra_headersMemoryCompressorwith:llm/memory/extra_bodyllm/memory/extra_headersContent-TypeandAuthorizationbehavior unless those headers are explicitly overridden in configREADME.mdwith concrete YAML examples for passing reasoning / thinking-related vendor parametersExample config enabled by this PR
Validation
I did not rely on CLion's project model for validation.
Checks performed:
gh auth statusmsvc-latest.bat x64cl.exeandMSBuild.exeare available in that environmentFull repository build was not completed locally because this workspace does not currently have
BOOST_ROOT/env.batconfigured for the project build script.Notes
This PR is intentionally scoped to the OpenAI-compatible / memory-compressor passthrough parameter work discussed in #4 comments. It does not attempt to implement the larger llama.cpp constrained decoding / beam search request from the issue title.