Repository: ai-shifu/ChatALL (language: javascript)

Issue:
[BUG] OpenAI reasoning models return "Unsupported parameter: 'temperature'" error
### Describe the bug / 描述问题

When temperature is set to anything other than 1.0, all OpenAI API reasoning models (specifically o1, o3-mini, o1-mini) consistently return error messages stating that the 'temperature' parameter is not supported with these models. For `o1` and `o3-mini`, this error appears every time these models are used:

`Error: 400 Unsupported parameter: 'temperature' is not supported with this model.`

For `o1-mini`, this error appears, with `0.5` simply being an example:

`Error: 400 Unsupported value: 'temperature' does not support 0.5 with this model. Only the default (1) value is supported.`

### To Reproduce / 复现步骤

1. Open ChatALL application
2. Attempt to use o1@OpenAI API, o3-mini@OpenAI, o1-mini@OpenAI API models with temperature set to anything except for `1.0`
3. Send any message
4. Error appears as shown in the screenshot

### Expected behavior / 期望行为

Application should:
- Automatically send API request with temperature set as 1.0 for reasoning models

Which should then yield:
- A non-error response from the OpenAI reasoning models

### Screenshots / 截图

![Image](https://github.com/user-attachments/assets/bc27b7a6-4a60-46b0-8590-a5d962ee9bfe)

### Devtools Info / 开发者工具信息

```
Error send prompt to o1@OpenAI API: H: 400 Bot.js:204
Unsupported parameter: 'temperature' is not supported with this model.
    at T.generate (app://./js/chunk-vendors.2a32a44f.js:30717:5236)
    at T.makeStatusError
    at T.makeRequest (
app://./js/chunk-vendors.2a32a44f.js:30717:2094)
    at async n (app://./js/chunk-vendors.2a32a44f.js:30717:1949
    at async r._fn (app://./js/chunk-vendors.2a32a44f.js:31417:2097)
sendPrompt @ Bot.js:204
```

```
Error send prompt to o1-mini@OpenAI API: H: 400 Bot.js:204
Unsupported value: 'temperature' does not support 0.7 with this model. Only 'null' value is supported.
    at T.generate (app://./js/chunk-vendors.2a32a44f.js:30717:5636)
    at T.makeStatusError (
app://./js/chunk-vendors.2a32a44f.js:30717:7044)
    at T.makeRequest (
app://./js/chunk-vendors.2a32a44f.js:30717:1900)
    at async n (app://./js/chunk-vendors.2a32a44f.js:30717:1949
    at async r._fn (app://./js/chunk-vendors.2a32a44f.js:31417:2097)
```

```
Error send prompt to o3-mini@OpenAI API: H: 400 Bot.js:204
Unsupported parameter: 'temperature' is not supported with this model.
    at T.generate (app://./js/chunk-vendors.2a32a44f.js:30717:5636)
    at T.makeStatusError (
app://./js/chunk-vendors.2a32a44f.js:30717:7044)
    at T.makeRequest (
app://./js/chunk-vendors.2a32a44f.js:30717:1900)
    at async n (app://./js/chunk-vendors.2a32a44f.js:30717:1949
    at async r._fn (app://./js/chunk-vendors.2a32a44f.js:31417:2097)
```

### OS and version / 操作系统版本

Windows 11, x64

### ChatALL version / ChatALL 版本

v1.36.53

### Network / 网络

No VPN/proxy

### Additional context / 其它相关信息

Error can only be "bypassed" by setting the temperature in settings to 1.0.


Discussion / hints:
Maybe we should just remove temperature for them 🤔 

Fix patch:
diff --git a/src/bots/openai/OpenAIAPIBot.js b/src/bots/openai/OpenAIAPIBot.js
index 0085212bd..62b173899 100644
--- a/src/bots/openai/OpenAIAPIBot.js
+++ b/src/bots/openai/OpenAIAPIBot.js
@@ -29,7 +29,9 @@ export default class OpenAIAPIBot extends LangChainBot {
       },
       openAIApiKey: store.state.openaiApi.apiKey,
       modelName: this.constructor._model ? this.constructor._model : "",
-      temperature: store.state.openaiApi.temperature,
+      temperature: this.constructor._model.startsWith("o")
+        ? undefined
+        : store.state.openaiApi.temperature,
       streaming: true,
     });
     return chatModel;


Test patch: