@gaia-framework/backend-core 7.0.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/build/openapi/openapi.json +502 -2
- package/build/openapi/openapi.yaml +362 -9
- package/build/openapi/voice-media-worker.json +1 -1
- package/build/openapi/voice-media-worker.yaml +1 -1
- package/build/openapi/worker-health.json +1 -1
- package/build/openapi/worker-health.yaml +1 -1
- package/build/src/config/schema.d.ts +87 -0
- package/build/src/config/schema.d.ts.map +1 -1
- package/build/src/config/schema.js +57 -1
- package/build/src/config/schema.js.map +1 -1
- package/build/src/core/application/dtos/llms/responses/LLMInfoDto.d.ts +2 -1
- package/build/src/core/application/dtos/llms/responses/LLMInfoDto.d.ts.map +1 -1
- package/build/src/core/application/mappers/llms/LLMInfoMapper.d.ts.map +1 -1
- package/build/src/core/application/mappers/llms/LLMInfoMapper.js +2 -0
- package/build/src/core/application/mappers/llms/LLMInfoMapper.js.map +1 -1
- package/build/src/core/application/services/media/VideoGenerationRequestService.js +2 -2
- package/build/src/core/application/services/media/VideoGenerationRequestService.js.map +1 -1
- package/build/src/core/application/services/runs/RunAppServiceImpl.d.ts.map +1 -1
- package/build/src/core/application/services/runs/RunAppServiceImpl.js +16 -4
- package/build/src/core/application/services/runs/RunAppServiceImpl.js.map +1 -1
- package/build/src/core/application/services/tasks/ScheduledRunDispatchService.d.ts.map +1 -1
- package/build/src/core/application/services/tasks/ScheduledRunDispatchService.js +9 -2
- package/build/src/core/application/services/tasks/ScheduledRunDispatchService.js.map +1 -1
- package/build/src/core/application/services/voice/session/VoiceContextService.js +1 -1
- package/build/src/core/application/services/voice/session/VoiceContextService.js.map +1 -1
- package/build/src/core/domain/models/llms/LLMInfo.d.ts +2 -1
- package/build/src/core/domain/models/llms/LLMInfo.d.ts.map +1 -1
- package/build/src/core/domain/models/runs/RunApproval.d.ts +1 -1
- package/build/src/core/domain/models/runs/RunApproval.d.ts.map +1 -1
- package/build/src/core/domain/models/runs/RunApproval.js.map +1 -1
- package/build/src/core/domain/models/speech/Transcription.d.ts +1 -0
- package/build/src/core/domain/models/speech/Transcription.d.ts.map +1 -1
- package/build/src/core/domain/models/videos/VideoGenerationRequest.d.ts +2 -0
- package/build/src/core/domain/models/videos/VideoGenerationRequest.d.ts.map +1 -1
- package/build/src/core/domain/models/videos/VideoGenerationRequest.js +5 -1
- package/build/src/core/domain/models/videos/VideoGenerationRequest.js.map +1 -1
- package/build/src/core/domain/services/chat/ConversationContextService.d.ts +1 -1
- package/build/src/core/domain/services/chat/ConversationContextService.d.ts.map +1 -1
- package/build/src/core/domain/services/chat/ConversationContextServiceImpl.d.ts +1 -1
- package/build/src/core/domain/services/chat/ConversationContextServiceImpl.d.ts.map +1 -1
- package/build/src/core/domain/services/chat/ConversationContextServiceImpl.js +12 -3
- package/build/src/core/domain/services/chat/ConversationContextServiceImpl.js.map +1 -1
- package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.d.ts.map +1 -1
- package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js +4 -1
- package/build/src/core/domain/services/chat/LLMExecutionServiceImpl.js.map +1 -1
- package/build/src/core/domain/services/chat/VideoInputPolicy.d.ts +5 -0
- package/build/src/core/domain/services/chat/VideoInputPolicy.d.ts.map +1 -0
- package/build/src/core/domain/services/chat/VideoInputPolicy.js +14 -0
- package/build/src/core/domain/services/chat/VideoInputPolicy.js.map +1 -0
- package/build/src/core/domain/services/media/TranscriptionPolicy.js +1 -1
- package/build/src/core/domain/services/media/TranscriptionPolicy.js.map +1 -1
- package/build/src/core/domain/services/models/ModelServiceImpl.d.ts.map +1 -1
- package/build/src/core/domain/services/models/ModelServiceImpl.js +4 -2
- package/build/src/core/domain/services/models/ModelServiceImpl.js.map +1 -1
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.d.ts.map +1 -1
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js +4 -2
- package/build/src/core/domain/services/runs/RunToolApprovalProviderCapability.js.map +1 -1
- package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.d.ts +8 -0
- package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.js +16 -0
- package/build/src/core/infrastructure/ai/alibaba/AlibabaWorkspace.js.map +1 -0
- package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.d.ts +2 -3
- package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.js +42 -17
- package/build/src/core/infrastructure/ai/embedding/providers/google/GoogleAIEmbeddingService.js.map +1 -1
- package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.d.ts +15 -0
- package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.js +21 -0
- package/build/src/core/infrastructure/ai/google/GoogleGenAiConnection.js.map +1 -0
- package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.d.ts +36 -0
- package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.js +108 -0
- package/build/src/core/infrastructure/ai/images/alibaba/QwenImageProviders.js.map +1 -0
- package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.d.ts +3 -3
- package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.js +36 -25
- package/build/src/core/infrastructure/ai/images/google/GoogleAIImageGenerationProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.d.ts +12 -0
- package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.js +97 -0
- package/build/src/core/infrastructure/ai/images/togetherai/TogetherImageGenerationProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/context/codecs/RunMediaContextCodecs.js +3 -1
- package/build/src/core/infrastructure/ai/llm/context/codecs/RunMediaContextCodecs.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.d.ts +12 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.js +46 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaCatalog.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.d.ts +24 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.js +100 -0
- package/build/src/core/infrastructure/ai/llm/providers/alibaba/AlibabaLLMProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.d.ts +53 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.js +178 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockCatalog.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.d.ts +19 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.js +59 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockLLMProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.d.ts +8 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.js +72 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockMessages.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.d.ts +28 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.js +117 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockOutput.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.d.ts +44 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.js +148 -0
- package/build/src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.d.ts +6 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.js +47 -37
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleAIService.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.d.ts +3 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.js +16 -8
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.d.ts +12 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.js +12 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js +6 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.js +12 -6
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleLLMProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js +3 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleStructuredOutputPolicy.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.js +14 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleTokenCountRequest.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.d.ts +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.js +2 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleToolLoop.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.d.ts +19 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.js +170 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/GoogleVideoFiles.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.d.ts +4 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.js +42 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatProfiles.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.d.ts +25 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.js +106 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/VertexChatVideo.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts +5 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js +37 -5
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleLiveSocket.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts +2 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js +4 -0
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeConfig.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js +2 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeEventHandlerREgistry.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts +6 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js +29 -12
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js +2 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeToolApprovals.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts +13 -2
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js +22 -9
- package/build/src/core/infrastructure/ai/llm/providers/google/realtime/GoogleRealtimeTranslationProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.d.ts +10 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.js +74 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceCatalog.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.d.ts +25 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.js +104 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.d.ts +40 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.js +39 -0
- package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.js +2 -30
- package/build/src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.d.ts +9 -0
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.js +87 -0
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.d.ts +2 -2
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.js +7 -10
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.js.map +1 -1
- package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.d.ts +5 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.js +33 -0
- package/build/src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.d.ts +13 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.js +95 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.js.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.d.ts +29 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.js +167 -0
- package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.d.ts +5 -0
- package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.js +26 -0
- package/build/src/core/infrastructure/ai/speech/GoogleSpeechConnection.js.map +1 -0
- package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.d.ts +7 -7
- package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.js +159 -63
- package/build/src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.d.ts +6 -2
- package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.js +22 -13
- package/build/src/core/infrastructure/ai/speech/stt/GoogleLiveTranscriptionProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.d.ts +12 -6
- package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.js +64 -15
- package/build/src/core/infrastructure/ai/speech/stt/GoogleSpeechToTextProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.d.ts +15 -0
- package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.js +81 -0
- package/build/src/core/infrastructure/ai/speech/stt/TogetherSpeechToTextProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.d.ts +26 -0
- package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.js +80 -0
- package/build/src/core/infrastructure/ai/speech/tts/TogetherTextToSpeechProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.d.ts +20 -17
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.js +20 -9
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTextToSpeechProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.d.ts +2 -1
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.js +6 -4
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsProtocol.js.map +1 -1
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsWorker.js +24 -8
- package/build/src/core/infrastructure/ai/speech/tts/google/GoogleTtsWorker.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/ImageEditingTool.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.d.ts +2 -2
- package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js +2 -2
- package/build/src/core/infrastructure/ai/tools/implementations/images/schemas.js.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/videos/VideoGenerationToolService.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/tools/implementations/videos/VideoGenerationToolService.js +5 -4
- package/build/src/core/infrastructure/ai/tools/implementations/videos/VideoGenerationToolService.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/VideoGenerationProviderRegistryImpl.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/videos/VideoGenerationProviderRegistryImpl.js +4 -1
- package/build/src/core/infrastructure/ai/videos/VideoGenerationProviderRegistryImpl.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.d.ts +18 -0
- package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.js +88 -0
- package/build/src/core/infrastructure/ai/videos/alibaba/HappyHorseVideoProvider.js.map +1 -0
- package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.d.ts +4 -2
- package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.js +109 -45
- package/build/src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.d.ts +10 -0
- package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.js +43 -0
- package/build/src/core/infrastructure/ai/videos/google/VertexVeoOutput.js.map +1 -0
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.d.ts +3 -2
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.js +7 -7
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.js +4 -4
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.d.ts +3 -2
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.d.ts.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.js +13 -4
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoWorker.js +27 -23
- package/build/src/core/infrastructure/ai/videos/google/omni/OmniVideoWorker.js.map +1 -1
- package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.d.ts +14 -0
- package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.d.ts.map +1 -0
- package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.js +113 -0
- package/build/src/core/infrastructure/ai/videos/togetherai/TogetherVideoGenerationProvider.js.map +1 -0
- package/build/src/core/infrastructure/api/v1/controllers/models/ModelsController.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/controllers/models/ModelsController.js +12 -2
- package/build/src/core/infrastructure/api/v1/controllers/models/ModelsController.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.d.ts +1 -0
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js +1 -0
- package/build/src/core/infrastructure/api/v1/routers/media/audio/openapi/SpeechRouter.openapi.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.d.ts +36 -34
- package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.d.ts.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.js +51 -17
- package/build/src/core/infrastructure/api/v1/routers/models/ModelsRouter.openapi.js.map +1 -1
- package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.d.ts +4 -0
- package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.d.ts.map +1 -0
- package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.js +4 -0
- package/build/src/core/infrastructure/api/v1/routers/models/catalogRepresentation.js.map +1 -0
- package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.js +1 -1
- package/build/src/core/infrastructure/api/v1/routers/runs/openapi/RunsRouter.openapi.js.map +1 -1
- package/build/src/core/infrastructure/di/builtInLLMProviders.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/builtInLLMProviders.js +17 -2
- package/build/src/core/infrastructure/di/builtInLLMProviders.js.map +1 -1
- package/build/src/core/infrastructure/di/index.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/index.js +56 -8
- package/build/src/core/infrastructure/di/index.js.map +1 -1
- package/build/src/core/infrastructure/di/types.d.ts +1 -0
- package/build/src/core/infrastructure/di/types.d.ts.map +1 -1
- package/build/src/core/infrastructure/di/types.js +1 -0
- package/build/src/core/infrastructure/di/types.js.map +1 -1
- package/build/src/core/infrastructure/mappers/chat/default/BasicChatMessageMapper.d.ts.map +1 -1
- package/build/src/core/infrastructure/mappers/chat/default/BasicChatMessageMapper.js +4 -6
- package/build/src/core/infrastructure/mappers/chat/default/BasicChatMessageMapper.js.map +1 -1
- package/build/src/core/infrastructure/mappers/chat/google/GeminiChatMessageMapper.d.ts.map +1 -1
- package/build/src/core/infrastructure/mappers/chat/google/GeminiChatMessageMapper.js +9 -0
- package/build/src/core/infrastructure/mappers/chat/google/GeminiChatMessageMapper.js.map +1 -1
- package/build/src/core/infrastructure/persistence/dao/knex/KnexMessageDao.d.ts.map +1 -1
- package/build/src/core/infrastructure/persistence/dao/knex/KnexMessageDao.js +6 -0
- package/build/src/core/infrastructure/persistence/dao/knex/KnexMessageDao.js.map +1 -1
- package/build/src/core/infrastructure/services/audio/TranscriptionWav.js +1 -1
- package/build/src/core/infrastructure/services/audio/TranscriptionWav.js.map +1 -1
- package/build/src/core/infrastructure/services/chat/ProviderRequestUsage.js +1 -1
- package/build/src/core/infrastructure/services/chat/ProviderRequestUsage.js.map +1 -1
- package/build/src/core/infrastructure/services/runs/approval/RunToolInvocationLifecycleImpl.js +1 -0
- package/build/src/core/infrastructure/services/runs/approval/RunToolInvocationLifecycleImpl.js.map +1 -1
- package/build/src/infrastructure/websockets/adapters/ws/WSAdapter.d.ts.map +1 -1
- package/build/src/infrastructure/websockets/adapters/ws/WSAdapter.js +2 -1
- package/build/src/infrastructure/websockets/adapters/ws/WSAdapter.js.map +1 -1
- package/build/src/modules/workspaces/infrastructure/recovery/operator/authority/observer/ExecutionSources.js +1 -1
- package/package.json +2 -1
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.d.ts +0 -3
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.d.ts.map +0 -1
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js +0 -27
- package/build/src/core/infrastructure/ai/llm/providers/nvidia/NvidiaConfig.js.map +0 -1
|
@@ -10,72 +10,105 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
-
import { GoogleGenAI } from '@google/genai';
|
|
14
13
|
import { ConfigService } from '@gaia-framework/config';
|
|
15
14
|
import CoreTypes from '../../../di/types.js';
|
|
16
15
|
import { inject } from 'inversify';
|
|
17
16
|
import { setTimeout as wait } from 'node:timers/promises';
|
|
18
17
|
import { OmniVideoAdapter } from './omni/OmniVideoAdapter.js';
|
|
18
|
+
import { VertexVeoOutput } from './VertexVeoOutput.js';
|
|
19
|
+
import { createGoogleGenAiClient, googleGenAiConnection } from '../../google/GoogleGenAiConnection.js';
|
|
20
|
+
import { boundedVideoJson, decodeOmniVideo, OMNI_JSON_LIMIT, omniOutputByteLimit } from './omni/OmniVideoProtocol.js';
|
|
21
|
+
import { downloadOmniVideo } from './omni/OmniVideoDelivery.js';
|
|
19
22
|
import { videoProviderRequest } from '../VideoProviderRequest.js';
|
|
20
|
-
import { normalizeVideoModel, OMNI_VIDEO_MODEL, validateVideoOptions, VideoGenerationFailure, throwIfVideoAborted, } from '../../../../domain/models/videos/VideoGenerationRequest.js';
|
|
23
|
+
import { normalizeVideoModel, OMNI_VIDEO_MODEL, VERTEX_OMNI_VIDEO_MODEL, isOmniVideoModel, validateVideoOptions, VideoGenerationFailure, throwIfVideoAborted, } from '../../../../domain/models/videos/VideoGenerationRequest.js';
|
|
21
24
|
let GoogleVideoGenerationProvider = class GoogleVideoGenerationProvider {
|
|
22
25
|
configService;
|
|
26
|
+
id;
|
|
23
27
|
omni;
|
|
24
|
-
id = 'google'
|
|
25
|
-
constructor(configService) {
|
|
28
|
+
constructor(configService, id = 'google') {
|
|
26
29
|
this.configService = configService;
|
|
30
|
+
this.id = id;
|
|
27
31
|
this.omni = new OmniVideoAdapter(undefined, undefined, () => this.configService.getOptionalNumber('objectStorage.maxInputMediaBytes'));
|
|
28
32
|
}
|
|
33
|
+
vertexLocation(omni) {
|
|
34
|
+
const key = omni ? 'ai.videos.providers.vertex.omniLocation' : 'ai.videos.providers.vertex.veoLocation';
|
|
35
|
+
return this.configService.getOptionalString(key)?.trim() || this.configService.getString('ai.vertex.location').trim();
|
|
36
|
+
}
|
|
37
|
+
connection(omni) {
|
|
38
|
+
if (this.id === 'google')
|
|
39
|
+
return { kind: 'developer', apiKey: this.configService.getString('ai.videos.providers.google.apiKey') };
|
|
40
|
+
const connection = googleGenAiConnection(this.configService, 'vertex');
|
|
41
|
+
if (connection.kind !== 'vertex')
|
|
42
|
+
throw new Error('Vertex video requires a Cloud project.');
|
|
43
|
+
return { ...connection, location: this.vertexLocation(omni) };
|
|
44
|
+
}
|
|
29
45
|
async generateVideo(params) {
|
|
30
|
-
const selectedModel = normalizeVideoModel(params.model ??
|
|
46
|
+
const selectedModel = normalizeVideoModel(params.model ?? this.getModels()[0]?.id ?? '');
|
|
31
47
|
validateVideoOptions(selectedModel, params);
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
48
|
+
const omni = isOmniVideoModel(selectedModel);
|
|
49
|
+
if ((omni || this.id === 'vertex') && !this.configService.getOptionalBoolean('ai.videos.providers.' + this.id + '.enabled')) {
|
|
50
|
+
throw new VideoGenerationFailure('video_provider_disabled', 503, 'Google video generation is disabled.');
|
|
51
|
+
}
|
|
52
|
+
const model = this.getModels().find(candidate => candidate.id === selectedModel);
|
|
53
|
+
if (!model) {
|
|
54
|
+
throw new VideoGenerationFailure('video_model_unavailable', 400, 'The requested video model is unavailable.');
|
|
55
|
+
}
|
|
56
|
+
const connection = this.connection(omni);
|
|
57
|
+
if (omni) {
|
|
37
58
|
if (params.input_reference !== undefined) {
|
|
38
59
|
throw new VideoGenerationFailure('invalid_video_options', 400, 'Omni references must use saved GAIA media IDs.');
|
|
39
60
|
}
|
|
40
|
-
return this.omni.generate(
|
|
61
|
+
return this.omni.generate(connection, { ...params, model: selectedModel });
|
|
41
62
|
}
|
|
42
63
|
const deadline = AbortSignal.timeout(600_000);
|
|
43
64
|
const signal = params.abortSignal ? AbortSignal.any([params.abortSignal, deadline]) : deadline;
|
|
44
65
|
throwIfVideoAborted(signal);
|
|
45
66
|
try {
|
|
46
|
-
return await this.generateVeo(
|
|
67
|
+
return await this.generateVeo(connection, model.providerModel, params, signal);
|
|
47
68
|
}
|
|
48
69
|
catch (error) {
|
|
49
70
|
throwIfVideoAborted(signal, true);
|
|
50
71
|
throw error;
|
|
51
72
|
}
|
|
52
73
|
}
|
|
53
|
-
async generateVeo(
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
74
|
+
async generateVeo(connection, model, params, signal) {
|
|
75
|
+
const outputBucket = connection.kind === 'vertex' && this.configService.getOptionalString('ai.videos.providers.vertex.outputBucket')?.trim();
|
|
76
|
+
const output = outputBucket ? new VertexVeoOutput(outputBucket) : undefined;
|
|
77
|
+
const sizeLimit = connection.kind === 'vertex'
|
|
78
|
+
? omniOutputByteLimit(this.configService.getOptionalNumber('objectStorage.maxInputMediaBytes'))
|
|
79
|
+
: undefined;
|
|
80
|
+
const ai = createGoogleGenAiClient(connection, {
|
|
81
|
+
httpOptions: {
|
|
82
|
+
timeout: 600_000,
|
|
83
|
+
retryOptions: { attempts: 1 },
|
|
84
|
+
// The SDK's Vertex operation polling does not forward config.abortSignal.
|
|
85
|
+
fetch: async (input, init) => {
|
|
86
|
+
const response = await fetch(input, {
|
|
87
|
+
...init, signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal,
|
|
88
|
+
});
|
|
89
|
+
if (sizeLimit === undefined)
|
|
90
|
+
return response;
|
|
91
|
+
const limit = response.ok ? Math.ceil(sizeLimit / 3) * 4 + OMNI_JSON_LIMIT : OMNI_JSON_LIMIT;
|
|
92
|
+
return boundedVideoJson(response, limit);
|
|
93
|
+
},
|
|
94
|
+
},
|
|
57
95
|
});
|
|
58
|
-
const availableModels = this.getModels();
|
|
59
|
-
let modelToUse = 'veo-3.0-generate-preview';
|
|
60
|
-
const modelInfo = availableModels.find((m) => m.id === selectedModel);
|
|
61
|
-
if (!modelInfo) {
|
|
62
|
-
throw new Error(`Model ${params.model} is not supported`);
|
|
63
|
-
}
|
|
64
|
-
if (params.model && availableModels.some((m) => m.id === params.model)) {
|
|
65
|
-
modelToUse = modelInfo.providerModel;
|
|
66
|
-
}
|
|
67
96
|
const operation = await videoProviderRequest(() => ai.models.generateVideos({
|
|
68
|
-
model
|
|
69
|
-
prompt: params.prompt,
|
|
97
|
+
model,
|
|
98
|
+
source: { prompt: params.prompt },
|
|
70
99
|
config: {
|
|
71
100
|
personGeneration: 'allow_all',
|
|
72
101
|
aspectRatio: '16:9',
|
|
102
|
+
...(connection.kind === 'vertex' ? { numberOfVideos: 1, outputGcsUri: output?.uri } : {}),
|
|
73
103
|
abortSignal: signal,
|
|
74
104
|
},
|
|
75
105
|
}), signal, 'creation');
|
|
76
|
-
return videoProviderRequest(() => this.completeVeo(ai, operation,
|
|
106
|
+
return videoProviderRequest(() => this.completeVeo(ai, operation, connection, model, signal, output), signal, 'completion');
|
|
77
107
|
}
|
|
78
|
-
async completeVeo(ai, operation,
|
|
108
|
+
async completeVeo(ai, operation, connection, model, signal, output) {
|
|
109
|
+
const originalName = operation.name;
|
|
110
|
+
if (connection.kind === 'vertex')
|
|
111
|
+
assertVertexOperationScope(connection, model, originalName);
|
|
79
112
|
while (!operation.done) {
|
|
80
113
|
await wait(10000, undefined, { signal }); // NOSONAR -- Poll the current operation sequentially with a cancellable wait.
|
|
81
114
|
const pollRequest = {
|
|
@@ -83,35 +116,54 @@ let GoogleVideoGenerationProvider = class GoogleVideoGenerationProvider {
|
|
|
83
116
|
config: { abortSignal: signal },
|
|
84
117
|
};
|
|
85
118
|
operation = await ai.operations.getVideosOperation(pollRequest); // NOSONAR -- Each poll reads the preceding operation.
|
|
119
|
+
if (connection.kind === 'vertex' && operation.name !== originalName)
|
|
120
|
+
throw new Error('Unexpected Vertex video operation.');
|
|
86
121
|
}
|
|
87
|
-
if (!operation.response?.generatedVideos?.length) {
|
|
122
|
+
if (operation.error || !operation.response?.generatedVideos?.length) {
|
|
88
123
|
throw new Error('No videos generated');
|
|
89
124
|
}
|
|
90
125
|
const generatedVideo = operation.response.generatedVideos[0];
|
|
91
126
|
throwIfVideoAborted(signal, true);
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
|
|
127
|
+
const video = generatedVideo.video;
|
|
128
|
+
if (connection.kind === 'vertex') {
|
|
129
|
+
const limit = omniOutputByteLimit(this.configService.getOptionalNumber('objectStorage.maxInputMediaBytes'));
|
|
130
|
+
if (!video || (video.mimeType && video.mimeType !== 'video/mp4') || (video.uri && video.videoBytes))
|
|
131
|
+
throw new Error('Invalid Vertex video response.');
|
|
132
|
+
if (video.uri && output)
|
|
133
|
+
return output.read(video.uri, limit, signal);
|
|
134
|
+
if (video.videoBytes)
|
|
135
|
+
return decodeOmniVideo(video.videoBytes, limit);
|
|
136
|
+
throw new Error('Missing Vertex video output.');
|
|
137
|
+
}
|
|
138
|
+
if (!video?.uri)
|
|
139
|
+
throw new Error('Missing video download.');
|
|
140
|
+
try {
|
|
141
|
+
return await downloadOmniVideo(video.uri, connection.apiKey, signal, fetch, Number.MAX_SAFE_INTEGER);
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
throwIfVideoAborted(signal, true);
|
|
95
145
|
throw new Error('The generated video could not be downloaded.');
|
|
96
146
|
}
|
|
97
|
-
const buffer = new Uint8Array(await resp.arrayBuffer());
|
|
98
|
-
throwIfVideoAborted(signal, true);
|
|
99
|
-
return buffer;
|
|
100
147
|
}
|
|
101
148
|
getModels() {
|
|
149
|
+
if (this.id === 'vertex' && !this.configService.getOptionalBoolean('ai.videos.providers.vertex.enabled'))
|
|
150
|
+
return [];
|
|
151
|
+
const vertex = this.id === 'vertex';
|
|
152
|
+
const veo = vertex ? 'veo-3.1-generate-001' : 'veo-3.0-generate-preview';
|
|
153
|
+
const omni = vertex ? VERTEX_OMNI_VIDEO_MODEL : OMNI_VIDEO_MODEL;
|
|
102
154
|
const models = [
|
|
103
155
|
{
|
|
104
|
-
id: '
|
|
105
|
-
providerModel:
|
|
106
|
-
displayName: 'Veo 3.0 Generate Preview (Google)',
|
|
107
|
-
provider: 'Google',
|
|
156
|
+
id: this.id + '/' + veo,
|
|
157
|
+
providerModel: veo,
|
|
158
|
+
displayName: vertex ? 'Veo 3.1 (Vertex AI)' : 'Veo 3.0 Generate Preview (Google)',
|
|
159
|
+
provider: vertex ? 'Vertex AI' : 'Google',
|
|
108
160
|
type: 'video',
|
|
109
161
|
},
|
|
110
162
|
{
|
|
111
|
-
id:
|
|
112
|
-
providerModel:
|
|
113
|
-
displayName: 'Gemini Omni 1.1 Flash (Google)',
|
|
114
|
-
provider: 'Google',
|
|
163
|
+
id: omni,
|
|
164
|
+
providerModel: omni.split('/')[1],
|
|
165
|
+
displayName: vertex ? 'Gemini Omni 1.2 Flash (Vertex AI)' : 'Gemini Omni 1.1 Flash (Google)',
|
|
166
|
+
provider: vertex ? 'Vertex AI' : 'Google',
|
|
115
167
|
type: 'video',
|
|
116
168
|
capabilities: {
|
|
117
169
|
textToVideo: true,
|
|
@@ -127,13 +179,25 @@ let GoogleVideoGenerationProvider = class GoogleVideoGenerationProvider {
|
|
|
127
179
|
},
|
|
128
180
|
},
|
|
129
181
|
];
|
|
182
|
+
if (vertex) {
|
|
183
|
+
return models.filter(model => {
|
|
184
|
+
const isOmni = isOmniVideoModel(model.id);
|
|
185
|
+
return this.vertexLocation(isOmni) === (isOmni ? 'global' : 'us-central1');
|
|
186
|
+
});
|
|
187
|
+
}
|
|
130
188
|
return models.filter((model) => model.id !== OMNI_VIDEO_MODEL ||
|
|
131
189
|
(this.configService.getOptionalBoolean('ai.videos.providers.google.enabled') ?? false));
|
|
132
190
|
}
|
|
133
191
|
};
|
|
134
192
|
GoogleVideoGenerationProvider = __decorate([
|
|
135
193
|
__param(0, inject(CoreTypes.ConfigService)),
|
|
136
|
-
__metadata("design:paramtypes", [ConfigService])
|
|
194
|
+
__metadata("design:paramtypes", [ConfigService, String])
|
|
137
195
|
], GoogleVideoGenerationProvider);
|
|
138
196
|
export { GoogleVideoGenerationProvider };
|
|
197
|
+
function assertVertexOperationScope(connection, model, name) {
|
|
198
|
+
const parent = 'projects/' + connection.project + '/locations/' + connection.location + '/publishers/google/models/' + model + '/operations/';
|
|
199
|
+
if (!name?.startsWith(parent) || !/^[a-zA-Z0-9_-]+$/.test(name.slice(parent.length))) {
|
|
200
|
+
throw new Error('Unexpected Vertex video operation scope.');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
139
203
|
//# sourceMappingURL=GoogleVideoGenerationProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleVideoGenerationProvider.js","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"GoogleVideoGenerationProvider.js","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/videos/google/GoogleVideoGenerationProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAA8B,MAAM,uCAAuC,CAAC;AACnI,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,EACpB,s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QACL,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,KAAK,EAAE,EAAE,CACR,KAAK,CAAC,EAAE,KAAK,gBAAgB;YAC7B,CAAC,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,oCAAoC,CAAC,IAAI,KAAK,CAAC,CACzF,CAAC;IACJ,CAAC;CACF,CAAA;AApMY,6BAA6B;IAIrC,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;qCAAiC,aAAa;GAJrE,6BAA6B,CAoMzC;;AAED,SAAS,0BAA0B,CACjC,UAA8D,EAC9D,KAAa,EACb,IAAwB;IAExB,MAAM,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC,OAAO,GAAG,aAAa,GAAG,UAAU,CAAC,QAAQ,GAAG,4BAA4B,GAAG,KAAK,GAAG,cAAc,CAAC;IAC9I,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A fresh, server-chosen directory limits delivery to this one rendering request. */
|
|
2
|
+
export declare class VertexVeoOutput {
|
|
3
|
+
private readonly bucket;
|
|
4
|
+
private readonly directory;
|
|
5
|
+
readonly uri: string;
|
|
6
|
+
constructor(bucket: string);
|
|
7
|
+
read(uri: string, limit: number, signal: AbortSignal): Promise<Uint8Array>;
|
|
8
|
+
private deliveryFailure;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=VertexVeoOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VertexVeoOutput.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/videos/google/VertexVeoOutput.ts"],"names":[],"mappings":"AAKA,sFAAsF;AACtF,qBAAa,eAAe;IAId,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;IACvE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAEQ,MAAM,EAAE,MAAM;IAOrC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAsBhF,OAAO,CAAC,eAAe;CAGxB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { GoogleAuth } from 'google-auth-library';
|
|
3
|
+
import { VideoGenerationFailure } from '../../../../domain/models/videos/VideoGenerationRequest.js';
|
|
4
|
+
import { readBoundedResponse } from './omni/OmniVideoProtocol.js';
|
|
5
|
+
/** A fresh, server-chosen directory limits delivery to this one rendering request. */
|
|
6
|
+
export class VertexVeoOutput {
|
|
7
|
+
bucket;
|
|
8
|
+
directory = 'gaia/video-output/' + randomUUID() + '/';
|
|
9
|
+
uri;
|
|
10
|
+
constructor(bucket) {
|
|
11
|
+
this.bucket = bucket;
|
|
12
|
+
if (!/^[a-z0-9][a-z0-9._-]{1,220}[a-z0-9]$/.test(bucket)) {
|
|
13
|
+
throw new VideoGenerationFailure('video_not_configured', 503, 'Invalid Vertex video output bucket.');
|
|
14
|
+
}
|
|
15
|
+
this.uri = 'gs://' + bucket + '/' + this.directory;
|
|
16
|
+
}
|
|
17
|
+
async read(uri, limit, signal) {
|
|
18
|
+
const suffix = uri.startsWith(this.uri) ? uri.slice(this.uri.length) : '';
|
|
19
|
+
// Google names the result sample_0.mp4 and can nest it under a generated folder.
|
|
20
|
+
if (suffix.length > 1024 || !/^(?:[A-Za-z0-9_-]+\/)*[A-Za-z0-9_-]+\.mp4$/.test(suffix)) {
|
|
21
|
+
throw this.deliveryFailure();
|
|
22
|
+
}
|
|
23
|
+
signal.throwIfAborted();
|
|
24
|
+
const object = encodeURIComponent(this.directory + suffix);
|
|
25
|
+
const url = 'https://storage.googleapis.com/storage/v1/b/' + encodeURIComponent(this.bucket) + '/o/' + object + '?alt=media';
|
|
26
|
+
const auth = new GoogleAuth({ scopes: ['https://www.googleapis.com/auth/cloud-platform'] });
|
|
27
|
+
const headers = await auth.getRequestHeaders(url);
|
|
28
|
+
const response = await fetch(url, { headers, signal, redirect: 'error' });
|
|
29
|
+
const type = response.headers.get('content-type')?.split(';')[0].trim().toLowerCase();
|
|
30
|
+
if (!response.ok || (type !== 'video/mp4' && type !== 'application/octet-stream')) {
|
|
31
|
+
await response.body?.cancel();
|
|
32
|
+
throw this.deliveryFailure();
|
|
33
|
+
}
|
|
34
|
+
const bytes = await readBoundedResponse(response, limit);
|
|
35
|
+
if (!bytes.length)
|
|
36
|
+
throw this.deliveryFailure();
|
|
37
|
+
return bytes;
|
|
38
|
+
}
|
|
39
|
+
deliveryFailure() {
|
|
40
|
+
return new VideoGenerationFailure('video_delivery_failed', 502, 'The generated Vertex video could not be retrieved.', true);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=VertexVeoOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VertexVeoOutput.js","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/videos/google/VertexVeoOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,sFAAsF;AACtF,MAAM,OAAO,eAAe;IAIG;IAHZ,SAAS,GAAG,oBAAoB,GAAG,UAAU,EAAE,GAAG,GAAG,CAAC;IAC9D,GAAG,CAAS;IAErB,YAA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O,EAAE,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACtF,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,0BAA0B,CAAC,EAAE,CAAC;YAClF,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAC/B,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,eAAe;QACrB,OAAO,IAAI,sBAAsB,CAAC,uBAAuB,EAAE,GAAG,EAAE,oDAAoD,EAAE,IAAI,CAAC,CAAC;IAC9H,CAAC;CACF"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { GoogleGenAiConnection } from '../../../google/GoogleGenAiConnection.js';
|
|
1
2
|
import type { GenerateVideoParams } from '../../../../../domain/ports/ai/videos/VideoGenerationProvider.js';
|
|
2
3
|
import { ensureOmniValidationReady } from './OmniVideoOutput.js';
|
|
3
4
|
export declare class OmniVideoAdapter {
|
|
4
5
|
private readonly executor?;
|
|
5
6
|
private readonly checkValidationReadiness;
|
|
6
7
|
private readonly storageLimit;
|
|
7
|
-
constructor(executor?: ((
|
|
8
|
-
generate(
|
|
8
|
+
constructor(executor?: ((connection: GoogleGenAiConnection, params: GenerateVideoParams, signal: AbortSignal, deadline: AbortSignal, maximumBytes: number) => Promise<Uint8Array>) | undefined, checkValidationReadiness?: typeof ensureOmniValidationReady, storageLimit?: () => number | undefined);
|
|
9
|
+
generate(connection: GoogleGenAiConnection, params: GenerateVideoParams): Promise<Uint8Array>;
|
|
9
10
|
private validateExecution;
|
|
10
11
|
private request;
|
|
11
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniVideoAdapter.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OmniVideoAdapter.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEtF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAM5G,OAAO,EAAE,yBAAyB,EAAqB,MAAM,sBAAsB,CAAC;AAGpF,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAO1B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBARZ,QAAQ,CAAC,GAAE,CAC1B,UAAU,EAAE,qBAAqB,EACjC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,WAAW,EACrB,YAAY,EAAE,MAAM,KACjB,OAAO,CAAC,UAAU,CAAC,aAAA,EACP,wBAAwB,mCAA4B,EACpD,YAAY,GAAE,MAAM,MAAM,GAAG,SAA2B;IAGrE,QAAQ,CAAC,UAAU,EAAE,qBAAqB,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAgCnG,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,OAAO;CAsFhB"}
|
|
@@ -11,8 +11,8 @@ export class OmniVideoAdapter {
|
|
|
11
11
|
this.checkValidationReadiness = checkValidationReadiness;
|
|
12
12
|
this.storageLimit = storageLimit;
|
|
13
13
|
}
|
|
14
|
-
async generate(
|
|
15
|
-
this.validateExecution(
|
|
14
|
+
async generate(connection, params) {
|
|
15
|
+
this.validateExecution(connection, params.userId);
|
|
16
16
|
const maximumBytes = omniOutputByteLimit(this.storageLimit());
|
|
17
17
|
const deadline = AbortSignal.timeout(OMNI_VIDEO_DEADLINE_MS);
|
|
18
18
|
const signal = params.abortSignal ? AbortSignal.any([params.abortSignal, deadline]) : deadline;
|
|
@@ -22,7 +22,7 @@ export class OmniVideoAdapter {
|
|
|
22
22
|
await this.checkValidationReadiness(signal);
|
|
23
23
|
throwIfVideoAborted(signal);
|
|
24
24
|
executionStarted = true;
|
|
25
|
-
const bytes = await (this.executor ?? this.request.bind(this))(
|
|
25
|
+
const bytes = await (this.executor ?? this.request.bind(this))(connection, params, signal, deadline, maximumBytes);
|
|
26
26
|
throwIfVideoAborted(signal, true);
|
|
27
27
|
await validateOmniBytes(bytes, { ...params, abortSignal: signal }, undefined, maximumBytes);
|
|
28
28
|
return bytes;
|
|
@@ -32,18 +32,18 @@ export class OmniVideoAdapter {
|
|
|
32
32
|
throw error;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
validateExecution(
|
|
35
|
+
validateExecution(connection, user) {
|
|
36
36
|
if (!user) {
|
|
37
37
|
throw new VideoGenerationFailure('video_auth_required', 401, 'Video generation requires an authenticated user.');
|
|
38
38
|
}
|
|
39
|
-
if (!apiKey) {
|
|
39
|
+
if (connection.kind === 'developer' && !connection.apiKey) {
|
|
40
40
|
throw new VideoGenerationFailure('video_not_configured', 503, 'Google video generation is not configured.');
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
request(
|
|
43
|
+
request(connection, params, signal, _deadline, maximumBytes) {
|
|
44
44
|
const extension = import.meta.url.endsWith('.ts') ? 'ts' : 'js';
|
|
45
45
|
const worker = new Worker(new URL(`./OmniVideoWorker.${extension}`, import.meta.url), {
|
|
46
|
-
workerData: {
|
|
46
|
+
workerData: { connection, params: { ...params, abortSignal: undefined }, maximumBytes },
|
|
47
47
|
});
|
|
48
48
|
return new Promise((resolve, reject) => {
|
|
49
49
|
const cleanup = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniVideoAdapter.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OmniVideoAdapter.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoAdapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,OAAO,gBAAgB;IAER;IAOA;IACA;IATnB,YACmB,QAMO,EACP,2BAA2B,yBAAyB,EACpD,eAAyC,GAAG,EAAE,CAAC,SAAS;QARxD,aAAQ,GAAR,QAAQ,CAMD;QACP,6BAAwB,GAAxB,wBAAwB,CAA4B;QACpD,iBAAY,GAAZ,YAAY,CAA4C;IACxE,CAAC;IAEJ,KAAK,CAAC,QAAQ,CAAC,UAAiC,EAAE,MAA2B;QAC3E,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAClD,MAAM,YAAY,GAAG,mBAAmB,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,C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M,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;oBACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC;qBAAM,CAAC;oBACN,MAAM,CACJ,IAAI,sBAAsB,CACxB,sBAAsB,EACtB,GAAG,EACH,uCAAuC,EACvC,IAAI,CACL,CACF,CAAC;gBACJ,CAAC;YACH,CAAC,CACF,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;gBACxB,OAAO,EAAE,CAAC;gBACV,MAAM,CACJ,IAAI,sBAAsB,CACxB,uBAAuB,EACvB,GAAG,EACH,0BAA0B,EAC1B,IAAI,CACL,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;gBACvB,OAAO,EAAE,CAAC;gBACV,MAAM,CACJ,IAAI,sBAAsB,CACxB,uBAAuB,EACvB,GAAG,EACH,wCAAwC,EACxC,IAAI,CACL,CACF,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YAExD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,KAAK,EAAE,CAAC;YACV,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniVideoOutput.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;
|
|
1
|
+
{"version":3,"file":"OmniVideoOutput.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAQ5G,KAAK,mBAAmB,GAAG,IAAI,CAAC,cAAc,kBAAkB,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;AAInG,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;CACJ;AAID,wBAAsB,yBAAyB,CAC7C,MAAM,CAAC,EAAE,WAAW,EACpB,UAAU,SAAwC,GACjD,OAAO,CAAC,IAAI,CAAC,CAuBf;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAU5F;AA8CD,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,mBAAmB,EAC3B,KAAK,GAAE,mBAAiC,EACxC,YAAY,SAAmB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
|
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import { fileTypeFromBuffer } from 'file-type';
|
|
7
|
-
import { throwIfVideoAborted, VideoGenerationFailure, } from '../../../../../domain/models/videos/VideoGenerationRequest.js';
|
|
7
|
+
import { isOmniVideoModel, throwIfVideoAborted, VideoGenerationFailure, } from '../../../../../domain/models/videos/VideoGenerationRequest.js';
|
|
8
8
|
import { OMNI_VIDEO_LIMIT } from './OmniVideoProtocol.js';
|
|
9
9
|
const nativeFiles = { mkdtemp, writeFile, rm };
|
|
10
10
|
export async function ensureOmniValidationReady(signal, executable = process.env.FFPROBE_PATH || 'ffprobe') {
|
|
@@ -31,17 +31,17 @@ export function validateOmniMetadata(info, params) {
|
|
|
31
31
|
if (streams.length !== 1) {
|
|
32
32
|
throw invalidMp4();
|
|
33
33
|
}
|
|
34
|
-
validateVideoTiming(video, info.format?.duration);
|
|
34
|
+
validateVideoTiming(video, info.format?.duration, params.model && isOmniVideoModel(params.model) ? 15 : 10);
|
|
35
35
|
validateVideoGeometry(video, params);
|
|
36
36
|
}
|
|
37
|
-
function validateVideoTiming(video, formatDuration) {
|
|
37
|
+
function validateVideoTiming(video, formatDuration, maxDuration) {
|
|
38
38
|
const duration = Number(video.duration ?? formatDuration);
|
|
39
39
|
const [numerator, denominator] = (video.avg_frame_rate ?? '').split('/').map(Number);
|
|
40
40
|
const rate = numerator / denominator;
|
|
41
41
|
const packets = Number(video.nb_read_packets);
|
|
42
42
|
if (!Number.isFinite(duration) ||
|
|
43
43
|
duration < 2.8 ||
|
|
44
|
-
duration >
|
|
44
|
+
duration > maxDuration + 0.2 ||
|
|
45
45
|
!Number.isFinite(rate) ||
|
|
46
46
|
Math.abs(rate - 24) > 0.5 ||
|
|
47
47
|
!Number.isFinite(packets) ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniVideoOutput.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAA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,CAAC;QACzB,MAAM,UAAU,EAAE,CAAC;IACrB,CAAC;IAED,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"OmniVideoOutput.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoOutput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,+DAA+D,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,MAAM,WAAW,GAAwB,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAgBpE,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAoB,EACpB,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,SAAS;IAElD,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5B,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE;YACrE,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,EAAE,GAAG,IAAI;YACpB,MAAM;YACN,WAAW,EAAE,IAAI;SAClB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE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AO,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,KAAK,cAAc,CAAC;QAExD,OAAO,IAAI,sBAAsB,CAC/B,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB,EAC9C,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EACpB,8DAA8D,EAC9D,IAAI,CACL,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,YAAY,sBAAsB,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAK,KAA+B,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;QACxD,OAAO,IAAI,sBAAsB,CAC/B,8BAA8B,EAC9B,GAAG,EACH,mDAAmD,EACnD,IAAI,CACL,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -5,7 +5,7 @@ export declare const OMNI_VIDEO_LIMIT: number;
|
|
|
5
5
|
export declare const OMNI_DEFAULT_STORAGE_LIMIT: number;
|
|
6
6
|
export declare const OMNI_INLINE_JSON_LIMIT: number;
|
|
7
7
|
export declare function omniOutputByteLimit(storageLimit?: number): number;
|
|
8
|
-
export declare function buildOmniRequest(params: GenerateVideoParams): {
|
|
8
|
+
export declare function buildOmniRequest(params: GenerateVideoParams, model?: string): {
|
|
9
9
|
model: string;
|
|
10
10
|
input: string | ({
|
|
11
11
|
type: "image";
|
|
@@ -25,11 +25,12 @@ export declare function buildOmniRequest(params: GenerateVideoParams): {
|
|
|
25
25
|
delivery: "inline";
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
export declare function extractOmniVideo(value: unknown): {
|
|
28
|
+
export declare function extractOmniVideo(value: unknown, expectedModel?: string): {
|
|
29
29
|
uri?: string;
|
|
30
30
|
data?: string;
|
|
31
31
|
};
|
|
32
32
|
export declare function decodeOmniVideo(data: string, maximumBytes?: number): Uint8Array;
|
|
33
33
|
export declare function validateOmniDeliveryUrl(value: string): URL;
|
|
34
|
+
export declare function boundedVideoJson(response: Response, limit: number): Promise<Response>;
|
|
34
35
|
export declare function readBoundedResponse(response: Response, limit: number): Promise<Uint8Array>;
|
|
35
36
|
//# sourceMappingURL=OmniVideoProtocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniVideoProtocol.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAG5G,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,eAAe,QAAkB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AACjD,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAE3D,eAAO,MAAM,sBAAsB,QAAwD,CAAC;AAE5F,wBAAgB,mBAAmB,CAAC,YAAY,SAA6B,GAAG,MAAM,CAUrF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"OmniVideoProtocol.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kEAAkE,CAAC;AAG5G,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AACzD,eAAO,MAAM,eAAe,QAAkB,CAAC;AAC/C,eAAO,MAAM,gBAAgB,QAAmB,CAAC;AACjD,eAAO,MAAM,0BAA0B,QAAmB,CAAC;AAE3D,eAAO,MAAM,sBAAsB,QAAwD,CAAC;AAE5F,wBAAgB,mBAAmB,CAAC,YAAY,SAA6B,GAAG,MAAM,CAUrF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,SAAoB;;;;;;;;;;;;;;;;;;;EA8CtF;AAQD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,SAAoB,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAoBnH;AAqDD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,SAAmB,GAAG,UAAU,CA2BzF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CA0B1D;AAWD,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAM3F;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAuChG"}
|
|
@@ -11,7 +11,7 @@ export function omniOutputByteLimit(storageLimit = OMNI_DEFAULT_STORAGE_LIMIT) {
|
|
|
11
11
|
}
|
|
12
12
|
return Math.min(storageLimit, OMNI_VIDEO_LIMIT);
|
|
13
13
|
}
|
|
14
|
-
export function buildOmniRequest(params) {
|
|
14
|
+
export function buildOmniRequest(params, model = OMNI_NATIVE_MODEL) {
|
|
15
15
|
const references = params.references ?? [];
|
|
16
16
|
const sources = [];
|
|
17
17
|
const subjects = [];
|
|
@@ -43,7 +43,7 @@ export function buildOmniRequest(params) {
|
|
|
43
43
|
]
|
|
44
44
|
: text;
|
|
45
45
|
return {
|
|
46
|
-
model
|
|
46
|
+
model,
|
|
47
47
|
input,
|
|
48
48
|
background: false,
|
|
49
49
|
store: false,
|
|
@@ -62,12 +62,14 @@ function record(value) {
|
|
|
62
62
|
? value
|
|
63
63
|
: undefined;
|
|
64
64
|
}
|
|
65
|
-
export function extractOmniVideo(value) {
|
|
65
|
+
export function extractOmniVideo(value, expectedModel = OMNI_NATIVE_MODEL) {
|
|
66
66
|
const response = record(value);
|
|
67
67
|
if (response?.status !== 'completed') {
|
|
68
68
|
throw invalidOutput();
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
// Google transparently serves Developer API requests for Omni 1.1 using Omni 1.2.
|
|
71
|
+
const upgradedAlias = expectedModel === OMNI_NATIVE_MODEL && response.model === 'gemini-omni-1.2-flash';
|
|
72
|
+
if (response.model !== undefined && response.model !== expectedModel && !upgradedAlias) {
|
|
71
73
|
throw invalidOutput();
|
|
72
74
|
}
|
|
73
75
|
const videos = collectOutputVideos(response);
|
|
@@ -146,6 +148,13 @@ export function validateOmniDeliveryUrl(value) {
|
|
|
146
148
|
function invalidDelivery() {
|
|
147
149
|
return new VideoGenerationFailure('video_invalid_output', 502, 'The video provider returned invalid delivery data.', true);
|
|
148
150
|
}
|
|
151
|
+
export async function boundedVideoJson(response, limit) {
|
|
152
|
+
const bytes = await readBoundedResponse(response, limit);
|
|
153
|
+
const headers = new Headers(response.headers);
|
|
154
|
+
headers.delete('content-encoding');
|
|
155
|
+
headers.set('content-length', String(bytes.length));
|
|
156
|
+
return new Response(Buffer.from(bytes), { status: response.status, statusText: response.statusText, headers });
|
|
157
|
+
}
|
|
149
158
|
export async function readBoundedResponse(response, limit) {
|
|
150
159
|
const declared = response.headers.get('content-length');
|
|
151
160
|
if (declared && Number(declared) > limit) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OmniVideoProtocol.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AAEvG,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3D,mGAAmG;AACnG,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;AAE5F,MAAM,UAAU,mBAAmB,CAAC,YAAY,GAAG,0BAA0B;IAC3E,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,sBAAsB,CAC9B,sBAAsB,EACtB,GAAG,EACH,6DAA6D,CAC9D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAA2B;
|
|
1
|
+
{"version":3,"file":"OmniVideoProtocol.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/videos/google/omni/OmniVideoProtocol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+DAA+D,CAAC;AAEvG,MAAM,CAAC,MAAM,iBAAiB,GAAG,uBAAuB,CAAC;AACzD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3D,mGAAmG;AACnG,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC;AAE5F,MAAM,UAAU,mBAAmB,CAAC,YAAY,GAAG,0BAA0B;IAC3E,IAAI,CAAC,MAA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