unit-mesh / auto-dev-vscode

AutoDev - 🧙‍the AI-powered coding wizard . Put the most loved AutoDev AI assistant into your VSCode, and have things done quickly
http://vscode.unitmesh.cc/
MIT License
224 stars 35 forks source link

The `temperature` settings not work #65

Open LeoLiuYan opened 1 month ago

LeoLiuYan commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: macOS 14.1
- AutoDev VSCode: v0.5.0
- IDE: VSCode 1.91.0 (Universal)

Description

When set the temperature parameter in settings.json, and restart the VSCode. But when using autoCompletion, the real value of temperature is not changed.

The VSCode settings: image

The real value captured in LLM Server: image

To reproduce

  1. Change the value of temperature in settings.json file
  2. Restart the IDE
  3. Capturing the network packages in LLM Server
  4. Use autoCompletion

Log output

No response

meteor199 commented 1 month ago

{
    "autodev.completions.parameters": {
        "temperature": 0,
        "top_p": 0.9,
        "max_tokens": 500
    }
}

这样试下呢

zhengxs2018 commented 1 month ago

@meteor199 autodev.chat.models 是 webview 下方的模型列表,不是代码补全或内部生成的配置。

发送配置到 webview

webview 启动时,会发送 config/getBrowserSerialized 事件,然后通过 listModels 获取配置的 json 模型并发送过去。

webview 发送对话请求到编辑器

webview 发送 llm/streamChat 事件,传递的参数大概是:

{
   "title": "配置的 chat 模型的 title",
   "completionOptions": {}, // 对话配置
   "messages": [] // 消息列表
}

我用 title 去 autodev.chat.models 匹配,获得真正的模型名称,然后调用 LanguageModelService

image

我把 autodev.chat.models 上的参数和 completionOptions 的参数都丢过去了,但用的浅合并。

问题应该出现在浅合并上,可能哪里有 temperature 属性?我还没去检查

后续的逻辑中,参数时一直在透传的:

image

最近忙公司项目,偷懒没去查,你们要是有空,可以按我的提示去试试改。。。