mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-10 03:07:41 +08:00
- 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
19 lines
507 B
Go
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()
|
|
}
|
|
}
|