feat(logging): add AI API path support for image routes
- Included `/v1/images` in AI API path prefixes. - Introduced tests to validate `/v1/images/generations` and `/v1/images/edits` as AI API paths.
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
var aiAPIPrefixes = []string{
|
||||
"/v1/chat/completions",
|
||||
"/v1/completions",
|
||||
"/v1/images",
|
||||
"/v1/messages",
|
||||
"/v1/responses",
|
||||
"/v1beta/models/",
|
||||
|
||||
@@ -58,3 +58,12 @@ func TestGinLogrusRecoveryHandlesRegularPanic(t *testing.T) {
|
||||
t.Fatalf("expected 500, got %d", recorder.Code)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsAIAPIPathIncludesImages(t *testing.T) {
|
||||
if !isAIAPIPath("/v1/images/generations") {
|
||||
t.Fatalf("expected /v1/images/generations to be treated as AI API path")
|
||||
}
|
||||
if !isAIAPIPath("/v1/images/edits") {
|
||||
t.Fatalf("expected /v1/images/edits to be treated as AI API path")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user