mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-01 17:10:24 +08:00
* fix: merge system messages for custom OpenAI endpoints (fixes #734) When using the OpenAI provider with a custom base URL (e.g., vLLM, LMStudio), the app sends two system messages to the API. Open-source model chat templates (Qwen, Llama, etc.) enforce that system messages must appear at the beginning and reject multiple system message blocks, causing the error: 'System message must be at the beginning.' Treat custom OpenAI endpoints (client-provided base URL or OPENAI_BASE_URL env var) the same as other known single-system providers by merging both system messages into one before sending. * fix: also detect custom OpenAI endpoint from serverModelConfig.baseUrlEnv --------- Co-authored-by: dayuan.jiang <jdy.toh@gmail.com>
34 KiB
34 KiB