#154·go-stock

模型使用 GPT5.4 时出现错误,使用 DeepSeek 和 Qwen 模型正常

作者: kaka008创建于 2026年4月18日更新于 2026年4月18日
  1. Add model filtering function in backend/agent/agent.go:
  • isFixedSamplingReasoningModel(aiConfig.ModelName)
  • buildOpenAIChatModelConfig(aiConfig)
  1. Modify createChatModel(aiConfig) in backend/agent/agent.go to no longer hardcode:
  • MaxTokens: &aiConfig.MaxTokens
  • Temperature: &temperature
  1. Use the new model filtering function to construct different OpenAI ChatModelConfig for different models:
  • For GPT-5/o1/o3/o4 family, do not pass temperature.
  • For GPT-5 family, use MaxCompletionTokens.
  • For normal models, continue to use MaxTokens + Temperature.

内容来源: ArvinLovegood/go-stock