feat(api, xai): add xAI Grok video model support with API integration
- Introduced new xAI `grok-imagine-video` model for video generation with configurable options (e.g., duration, size, resolution). - Implemented video-specific API endpoints (`/v1/videos`, `/v1/videos/generations`, `/v1/videos/edits`, `/v1/videos/extensions`), including request validation and model handling. - Enhanced model registry with `xaiBuiltinVideoModelID` and metadata for video capabilities. - Added unit tests to validate video model support, request structures, and API response handling. - Extended `XAIExecutor` to integrate video generation and retrieval via runtime requests.
This commit is contained in:
@@ -21,6 +21,7 @@ var aiAPIPrefixes = []string{
|
||||
"/v1/chat/completions",
|
||||
"/v1/completions",
|
||||
"/v1/images",
|
||||
"/v1/videos",
|
||||
"/v1/messages",
|
||||
"/v1/responses",
|
||||
"/v1beta/models/",
|
||||
|
||||
@@ -66,4 +66,10 @@ func TestIsAIAPIPathIncludesImages(t *testing.T) {
|
||||
if !isAIAPIPath("/v1/images/edits") {
|
||||
t.Fatalf("expected /v1/images/edits to be treated as AI API path")
|
||||
}
|
||||
if !isAIAPIPath("/v1/videos") {
|
||||
t.Fatalf("expected /v1/videos to be treated as AI API path")
|
||||
}
|
||||
if !isAIAPIPath("/v1/videos/video_123") {
|
||||
t.Fatalf("expected /v1/videos/video_123 to be treated as AI API path")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user