mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-05 08:55:28 +08:00
16 lines
508 B
Go
16 lines
508 B
Go
package openai
|
|
|
|
import "net/http"
|
|
|
|
func writeUpstreamEmptyOutputError(w http.ResponseWriter, thinking, text string, contentFilter bool) bool {
|
|
if thinking != "" || text != "" {
|
|
return false
|
|
}
|
|
if contentFilter {
|
|
writeOpenAIErrorWithCode(w, http.StatusBadRequest, "Upstream content filtered the response and returned no output.", "content_filter")
|
|
return true
|
|
}
|
|
writeOpenAIErrorWithCode(w, http.StatusTooManyRequests, "Upstream model returned empty output.", "upstream_empty_output")
|
|
return true
|
|
}
|