Files
ds2api/internal/adapter/openai/history_split_error.go
CJACK 131ca7d398 feat: revamp DeepSeek v4 model handling
- replace legacy DeepSeek ids with the new deepseek-v4 model family\n- move thinking control to request parameters and preserve assistant reasoning content\n- switch history split to IGNORE transcript injection and map upload auth failures to 401\n- update admin defaults, API docs, samples, and tests for the new model scheme
2026-04-26 00:02:14 +08:00

19 lines
507 B
Go

package openai
import (
"net/http"
"ds2api/internal/deepseek"
)
func mapHistorySplitError(err error) (int, string) {
switch {
case deepseek.IsManagedUnauthorizedError(err):
return http.StatusUnauthorized, "Account token is invalid. Please re-login the account in admin."
case deepseek.IsDirectUnauthorizedError(err):
return http.StatusUnauthorized, "Invalid token. If this should be a DS2API key, add it to config.keys first."
default:
return http.StatusInternalServerError, err.Error()
}
}