mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-07 09:55:29 +08:00
16 lines
480 B
Go
16 lines
480 B
Go
package openai
|
|
|
|
import "net/http"
|
|
|
|
func writeUpstreamEmptyOutputError(w http.ResponseWriter, text string, contentFilter bool) bool {
|
|
if 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
|
|
}
|