* feat(images): 接入 OpenAI 图片生成与编辑 * fix(images): 补齐响应容量与边界处理 * fix(images): 修正协议观测与响应上限覆盖 * fix(stream): 保证取消优先于流关闭 * fix(images): 修正空 SSE 错误对象判定 * fix(images): 避免媒体数据触发凭据误判 * fix(images): 阻止流式响应泄漏凭据 * fix(images): 校验完整流事件后再转发 * fix(images): 修正响应模型观测
23 lines
633 B
Go
23 lines
633 B
Go
package execution
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gpt-load/internal/protocol"
|
|
)
|
|
|
|
func TestProtocolResourceLimits(t *testing.T) {
|
|
if got := UnaryResponseBodyLimit(protocol.OpenAICompletions); got != 32<<20 {
|
|
t.Fatalf("default unary response body limit = %d", got)
|
|
}
|
|
if got := UnaryResponseBodyLimit(protocol.OpenAIImages); got != 64<<20 {
|
|
t.Fatalf("Images unary response body limit = %d", got)
|
|
}
|
|
if got := SSEEventLimit(protocol.OpenAICompletions); got != 10<<20 {
|
|
t.Fatalf("default SSE event limit = %d", got)
|
|
}
|
|
if got := SSEEventLimit(protocol.OpenAIImages); got != 32<<20 {
|
|
t.Fatalf("Images SSE event limit = %d", got)
|
|
}
|
|
}
|