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:
Luis Pater
2026-05-17 02:53:50 +08:00
parent 2ff9e33e26
commit 53d1fd6c5c
9 changed files with 1130 additions and 2 deletions
@@ -33,6 +33,22 @@ func TestCodexStaticModelsIncludeGPT55(t *testing.T) {
assertGPT55ModelInfo(t, "lookup", model)
}
func TestWithXAIBuiltinsAddsVideoModel(t *testing.T) {
models := WithXAIBuiltins(nil)
found := false
for _, model := range models {
if model != nil && model.ID == xaiBuiltinVideoModelID {
found = true
if model.OwnedBy != "xai" {
t.Fatalf("OwnedBy = %q, want xai", model.OwnedBy)
}
}
}
if !found {
t.Fatalf("expected %s builtin model", xaiBuiltinVideoModelID)
}
}
func findModelInfo(models []*ModelInfo, id string) *ModelInfo {
for _, model := range models {
if model != nil && model.ID == id {