@gaia-framework/backend-core 7.0.0 → 7.1.0-rc.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 +13 -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
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { BedrockRuntimeClient, ConverseCommand, ConverseStreamCommand, } from '@aws-sdk/client-bedrock-runtime';
|
|
14
|
+
import { ConfigService } from '@gaia-framework/config';
|
|
15
|
+
import { inject, injectable } from 'inversify';
|
|
16
|
+
import { AIExecutionFailure, classifyAIExecutionFailure, createAIExecutionFailure, } from '../../../../../domain/errors/AIExecutionFailure.js';
|
|
17
|
+
import CoreTypes from '../../../../di/types.js';
|
|
18
|
+
import { ToolProcessor } from '../../../tools/processing/ToolProcessor.js';
|
|
19
|
+
import { isContextSizeRejection } from '../../execution/ContextOverflowRecovery.js';
|
|
20
|
+
import { delegatedOutputCap } from '../../execution/ModelRequestPolicy.js';
|
|
21
|
+
import { BedrockCatalog, bedrockConfig } from './BedrockCatalog.js';
|
|
22
|
+
import { bedrockMessages } from './BedrockMessages.js';
|
|
23
|
+
import { bedrockChunks, bedrockCompletion } from './BedrockOutput.js';
|
|
24
|
+
function normalize(error, signal) {
|
|
25
|
+
if (signal.aborted)
|
|
26
|
+
return createAIExecutionFailure(signal.reason?.name === 'TimeoutError' ? 'provider_timeout' : 'operation_cancelled');
|
|
27
|
+
if (error instanceof AIExecutionFailure)
|
|
28
|
+
return error;
|
|
29
|
+
const sdkError = error;
|
|
30
|
+
const status = sdkError?.$metadata?.httpStatusCode;
|
|
31
|
+
if (isContextSizeRejection({ status, message: sdkError?.message }))
|
|
32
|
+
return createAIExecutionFailure('llm_context_window_exceeded');
|
|
33
|
+
if (status === 403)
|
|
34
|
+
return createAIExecutionFailure('provider_access_denied');
|
|
35
|
+
if (status === 404)
|
|
36
|
+
return createAIExecutionFailure('provider_model_unavailable');
|
|
37
|
+
return createAIExecutionFailure(classifyAIExecutionFailure(status ? { status } : error).code);
|
|
38
|
+
}
|
|
39
|
+
let BedrockService = class BedrockService {
|
|
40
|
+
config;
|
|
41
|
+
catalog;
|
|
42
|
+
tools;
|
|
43
|
+
providerId = 'amazon';
|
|
44
|
+
runtime;
|
|
45
|
+
constructor(config, catalog, tools) {
|
|
46
|
+
this.config = config;
|
|
47
|
+
this.catalog = catalog;
|
|
48
|
+
this.tools = tools;
|
|
49
|
+
}
|
|
50
|
+
async getModelInfo(id) {
|
|
51
|
+
const model = (await this.catalog.getModels()).find((row) => row.id === id);
|
|
52
|
+
if (!model)
|
|
53
|
+
throw createAIExecutionFailure('provider_model_unavailable');
|
|
54
|
+
return model;
|
|
55
|
+
}
|
|
56
|
+
async validateRequest(model, options) {
|
|
57
|
+
const settings = options.settings;
|
|
58
|
+
if (options.outputFormat ||
|
|
59
|
+
options.outputSchema ||
|
|
60
|
+
settings?.reasoningEffort ||
|
|
61
|
+
settings?.frequencyPenalty !== undefined ||
|
|
62
|
+
settings?.presencePenalty !== undefined ||
|
|
63
|
+
(model.maxOutputTokens && settings?.maxTokens && settings.maxTokens > model.maxOutputTokens)) {
|
|
64
|
+
throw createAIExecutionFailure('provider_request_rejected');
|
|
65
|
+
}
|
|
66
|
+
if (options.tools?.length && !model.supportsTools)
|
|
67
|
+
throw createAIExecutionFailure('provider_request_rejected');
|
|
68
|
+
}
|
|
69
|
+
client() {
|
|
70
|
+
return (this.runtime ??= new BedrockRuntimeClient({
|
|
71
|
+
region: this.config.getString(bedrockConfig + '.region'),
|
|
72
|
+
token: { token: this.config.getString(bedrockConfig + '.apiKey') },
|
|
73
|
+
authSchemePreference: ['httpBearerAuth'],
|
|
74
|
+
maxAttempts: 1,
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
request(history, model, options) {
|
|
78
|
+
const { messages, system } = bedrockMessages(history, model);
|
|
79
|
+
if (system?.length && !model.supportsInstructions) {
|
|
80
|
+
throw createAIExecutionFailure('provider_request_rejected');
|
|
81
|
+
}
|
|
82
|
+
const tools = model.supportsTools
|
|
83
|
+
? this.tools.getSchemasForTools(options.tools).map((schema) => ({
|
|
84
|
+
toolSpec: {
|
|
85
|
+
name: schema.name,
|
|
86
|
+
description: schema.description,
|
|
87
|
+
inputSchema: {
|
|
88
|
+
json: JSON.parse(JSON.stringify(schema.parameters ?? { type: 'object', properties: {} })),
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
}))
|
|
92
|
+
: [];
|
|
93
|
+
const input = {
|
|
94
|
+
modelId: model.providerModel,
|
|
95
|
+
messages,
|
|
96
|
+
system: model.supportsInstructions ? system : undefined,
|
|
97
|
+
inferenceConfig: {
|
|
98
|
+
maxTokens: delegatedOutputCap(options.settings?.maxTokens ?? model.defaultSettings?.maxTokens, options.toolExecutionContext),
|
|
99
|
+
temperature: options.settings?.temperature,
|
|
100
|
+
topP: options.settings?.topP,
|
|
101
|
+
},
|
|
102
|
+
...(tools.length && { toolConfig: { tools } }),
|
|
103
|
+
};
|
|
104
|
+
const timeout = AbortSignal.timeout(120_000);
|
|
105
|
+
return { input, signal: options.abortSignal ? AbortSignal.any([options.abortSignal, timeout]) : timeout };
|
|
106
|
+
}
|
|
107
|
+
async complete(history, model, options) {
|
|
108
|
+
const { input, signal } = this.request(history, model, options);
|
|
109
|
+
try {
|
|
110
|
+
const response = await this.client().send(new ConverseCommand(input), { abortSignal: signal });
|
|
111
|
+
return bedrockCompletion(response, options.requireCompleteOutput === true);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw normalize(error, signal);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async stream(history, model, options) {
|
|
118
|
+
const { input, signal } = this.request(history, model, options);
|
|
119
|
+
try {
|
|
120
|
+
const result = await this.client().send(new ConverseStreamCommand(input), { abortSignal: signal });
|
|
121
|
+
const events = result.stream;
|
|
122
|
+
if (!events)
|
|
123
|
+
throw createAIExecutionFailure('llm_response_incomplete');
|
|
124
|
+
return (async function* () {
|
|
125
|
+
try {
|
|
126
|
+
yield* bedrockChunks(events, options.requireCompleteOutput === true);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
throw normalize(error, signal);
|
|
130
|
+
}
|
|
131
|
+
})();
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
throw normalize(error, signal);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
BedrockService = __decorate([
|
|
139
|
+
injectable(),
|
|
140
|
+
__param(0, inject(CoreTypes.ConfigService)),
|
|
141
|
+
__param(1, inject(BedrockCatalog)),
|
|
142
|
+
__param(2, inject(CoreTypes.ToolProcessor)),
|
|
143
|
+
__metadata("design:paramtypes", [ConfigService,
|
|
144
|
+
BedrockCatalog,
|
|
145
|
+
ToolProcessor])
|
|
146
|
+
], BedrockService);
|
|
147
|
+
export { BedrockService };
|
|
148
|
+
//# sourceMappingURL=BedrockService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BedrockService.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/bedrock/BedrockService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,oDAAoD,CAAC;AA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AAC,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;YACnG,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YAC7B,IAAI,CAAC,MAAM;gBAAE,MAAM,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,SAAS,CAAC;gBACrB,IAAI,CAAC;oBACH,KAAK,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,KAAK,IAAI,CAAC,CAAC;gBACvE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC,EAAE,CAAC;QACP,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AAlHY,cAAc;IAD1B,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAC/B,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;qCAF0B,aAAa;QACrB,cAAc;QACP,aAAa;GAP7D,cAAc,CAkH1B"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Content, GenerateContentConfig, GenerateContentResponse } from "@google/genai";
|
|
2
|
+
import { type GoogleChatRoute } from './GoogleChatRoute.js';
|
|
3
|
+
import type { RedisClientManager } from "../../../../../../shared/cache/redis/RedisClientManager.js";
|
|
2
4
|
import { ConfigService } from "@gaia-framework/config";
|
|
3
5
|
import { LLMInfo } from "../../../../../domain/models/llms/LLMInfo.js";
|
|
4
6
|
import { LLMSettings } from "../../../../../domain/models/llms/LLMSettings.js";
|
|
@@ -25,9 +27,11 @@ export interface GoogleGenerationOptions {
|
|
|
25
27
|
export declare class GoogleAIService {
|
|
26
28
|
private readonly loggerService;
|
|
27
29
|
private readonly toolProcessor;
|
|
28
|
-
private readonly configService;
|
|
29
30
|
private readonly client;
|
|
30
|
-
|
|
31
|
+
private readonly videos;
|
|
32
|
+
private readonly profiles;
|
|
33
|
+
readonly route: GoogleChatRoute;
|
|
34
|
+
constructor(loggerService: LoggerService, toolProcessor: ToolProcessor, configService: ConfigService, redis?: RedisClientManager, provider?: "google" | "vertex");
|
|
31
35
|
getModelResponse(messages: readonly Content[], model: string, options?: GoogleGenerationOptions): Promise<GenerateContentResponse>;
|
|
32
36
|
getModelResponseStream(messages: readonly Content[], model: string, options?: GoogleGenerationOptions): Promise<AsyncGenerator<GenerateContentResponse>>;
|
|
33
37
|
canRetrieveContextMedia(model: string, tools?: readonly ToolReference[] | null): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleAIService.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleAIService.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,qBAAqB,EACrB,uBAAuB,EAGxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAKL,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAK5F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAKvG,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,6BAA6B,CAAC,EAAE,OAAO,4DAA4D,EAAE,oBAAoB,CAAC,+BAA+B,CAAC,CAAC;IACpK,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,CAAC;IACjD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;CAC3E;AAED,qBACa,eAAe;
|
|
1
|
+
{"version":3,"file":"GoogleAIService.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleAIService.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,qBAAqB,EACrB,uBAAuB,EAGxB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAm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M,GAC3F,OAAO,CAAC,MAAM,CAAC;IAmClB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE;IAKrC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAKnD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAInD,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,+BAA+B;IAuCvC,OAAO,CAAC,mBAAmB;YAIZ,kBAAkB;IAKjC,OAAO,CAAC,UAAU;CAKnB"}
|
|
@@ -11,12 +11,17 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
13
|
import { hasMediaRetrievalTools } from '../../context/MediaRetrievalAvailability.js';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { ThinkingLevel, } from "@google/genai";
|
|
15
|
+
import { createGoogleGenAiClient, googleGenAiConnection } from '../../../google/GoogleGenAiConnection.js';
|
|
16
|
+
import { googleChatRoute } from './GoogleChatRoute.js';
|
|
17
|
+
import { vertexChatProfiles } from './VertexChatProfiles.js';
|
|
18
|
+
import { VertexChatVideo, vertexChatHttpOptions } from './VertexChatVideo.js';
|
|
19
|
+
import { GoogleVideoFiles } from "./GoogleVideoFiles.js";
|
|
20
|
+
import { inject, injectable, optional, unmanaged } from "inversify";
|
|
16
21
|
import { ConfigService } from "@gaia-framework/config";
|
|
17
22
|
import CoreTypes from "../../../../di/types.js";
|
|
18
23
|
import { ToolProcessor } from "../../../tools/processing/ToolProcessor.js";
|
|
19
|
-
import { getGoogleModelProfile, GOOGLE_GEMINI4_DEFAULT_OUTPUT_TOKENS, GOOGLE_GEMINI4_MAX_OUTPUT_TOKENS,
|
|
24
|
+
import { getGoogleModelProfile, GOOGLE_GEMINI4_DEFAULT_OUTPUT_TOKENS, GOOGLE_GEMINI4_MAX_OUTPUT_TOKENS, googleModelProfiles, } from "./GoogleConfig.js";
|
|
20
25
|
import { classifyGoogleErrorForLogging, normalizeGoogleError, } from "./GoogleErrorPolicy.js";
|
|
21
26
|
import { createAIExecutionFailure } from "../../../../../domain/errors/AIExecutionFailure.js";
|
|
22
27
|
import { buildGoogleFunctionTools } from "./GoogleToolAdapter.js";
|
|
@@ -29,24 +34,24 @@ const GEMINI4_GENERATION_TIMEOUT_MS = 20 * 60 * 1000;
|
|
|
29
34
|
let GoogleAIService = class GoogleAIService {
|
|
30
35
|
loggerService;
|
|
31
36
|
toolProcessor;
|
|
32
|
-
configService;
|
|
33
37
|
client;
|
|
34
|
-
|
|
38
|
+
videos;
|
|
39
|
+
profiles;
|
|
40
|
+
route;
|
|
41
|
+
constructor(loggerService, toolProcessor, configService, redis, provider = "google") {
|
|
35
42
|
this.loggerService = loggerService;
|
|
36
43
|
this.toolProcessor = toolProcessor;
|
|
37
|
-
|
|
38
|
-
this.client =
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
const connection = googleGenAiConnection(configService, provider);
|
|
45
|
+
this.client = createGoogleGenAiClient(connection);
|
|
46
|
+
this.route = googleChatRoute(connection);
|
|
47
|
+
this.profiles = connection.kind === 'vertex' ? vertexChatProfiles(connection.location) : googleModelProfiles;
|
|
48
|
+
this.videos = connection.kind === 'vertex' ? new VertexChatVideo(connection)
|
|
49
|
+
: new GoogleVideoFiles(this.client.files, connection.apiKey, redis);
|
|
41
50
|
}
|
|
42
51
|
async getModelResponse(messages, model, options = {}) {
|
|
43
52
|
const profile = this.requireProfile(model);
|
|
44
53
|
try {
|
|
45
|
-
const response = await this.client.models.generateContent({
|
|
46
|
-
model: profile.info.providerModel,
|
|
47
|
-
contents: [...messages],
|
|
48
|
-
config: this.buildGenerationConfig(profile, options),
|
|
49
|
-
});
|
|
54
|
+
const response = await this.videos.dispatch(messages, profile, options.abortSignal, contents => this.client.models.generateContent({ model: profile.info.providerModel, contents, config: this.buildGenerationConfig(profile, options) }));
|
|
50
55
|
return this.tracksPhysicalUsage(options) ? markGooglePhysicalUsage(response) : response;
|
|
51
56
|
}
|
|
52
57
|
catch (error) {
|
|
@@ -60,11 +65,7 @@ let GoogleAIService = class GoogleAIService {
|
|
|
60
65
|
throw new Error("The selected Google model does not support native streaming.");
|
|
61
66
|
}
|
|
62
67
|
try {
|
|
63
|
-
const stream = await this.client.models.generateContentStream({
|
|
64
|
-
model: profile.info.providerModel,
|
|
65
|
-
contents: [...messages],
|
|
66
|
-
config: this.buildGenerationConfig(profile, options),
|
|
67
|
-
});
|
|
68
|
+
const stream = await this.videos.dispatch(messages, profile, options.abortSignal, contents => this.client.models.generateContentStream({ model: profile.info.providerModel, contents, config: this.buildGenerationConfig(profile, options) }));
|
|
68
69
|
return this.tracksPhysicalUsage(options) ? this.markPhysicalStream(stream) : stream;
|
|
69
70
|
}
|
|
70
71
|
catch (error) {
|
|
@@ -78,15 +79,19 @@ let GoogleAIService = class GoogleAIService {
|
|
|
78
79
|
async countTokens(messages, model, abortSignal, options = {}) {
|
|
79
80
|
const profile = this.requireProfile(model);
|
|
80
81
|
try {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
const response = await this.videos.dispatch(messages, profile, abortSignal, contents => {
|
|
83
|
+
const request = buildGoogleTokenCountRequest(profile.info.providerModel, contents, {
|
|
84
|
+
instructions: options.instructions,
|
|
85
|
+
tools: options.tools ? buildGoogleFunctionTools(this.toolProcessor, options.tools) : undefined,
|
|
86
|
+
responseJsonSchema: options.responseJsonSchema,
|
|
87
|
+
}, abortSignal ?? undefined, this.route.provider);
|
|
88
|
+
request.config = { ...request.config, httpOptions: {
|
|
89
|
+
...request.config?.httpOptions, ...googleRequestRetryOptions(),
|
|
90
|
+
} };
|
|
91
|
+
if (this.route.provider === 'vertex')
|
|
92
|
+
request.config.httpOptions = vertexChatHttpOptions(request.config.httpOptions);
|
|
93
|
+
return this.client.models.countTokens(request);
|
|
94
|
+
});
|
|
90
95
|
if (typeof response.totalTokens !== "number") {
|
|
91
96
|
throw new Error("Google token count response was incomplete.");
|
|
92
97
|
}
|
|
@@ -98,19 +103,18 @@ let GoogleAIService = class GoogleAIService {
|
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
getModels(filter) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
return [...googleModelInfo];
|
|
106
|
+
const models = this.profiles.map(profile => profile.info);
|
|
107
|
+
return filter ? models.filter(model => model.id.toLowerCase().startsWith(filter.toLowerCase())) : models;
|
|
105
108
|
}
|
|
106
109
|
getProfile(model) {
|
|
107
|
-
return getGoogleModelProfile(model)
|
|
110
|
+
return this.route.provider === 'google' ? getGoogleModelProfile(model)
|
|
111
|
+
: this.profiles.find(profile => profile.info.id === model);
|
|
108
112
|
}
|
|
109
113
|
async isValidModel(model) {
|
|
110
|
-
return
|
|
114
|
+
return this.getProfile(model) !== undefined;
|
|
111
115
|
}
|
|
112
116
|
requireProfile(model) {
|
|
113
|
-
const profile =
|
|
117
|
+
const profile = this.getProfile(model);
|
|
114
118
|
if (!profile) {
|
|
115
119
|
throw new Error("Unsupported Google model.");
|
|
116
120
|
}
|
|
@@ -137,7 +141,10 @@ let GoogleAIService = class GoogleAIService {
|
|
|
137
141
|
...config,
|
|
138
142
|
httpOptions: options.disableRetries || isAccountedModelRequest(options.toolExecutionContext) ? { retryOptions: { attempts: 1 } } : googleRequestRetryOptions()
|
|
139
143
|
} : config;
|
|
140
|
-
|
|
144
|
+
const result = this.withPhysicalRequestReservations(generation, options);
|
|
145
|
+
if (this.route.provider === 'vertex')
|
|
146
|
+
result.httpOptions = vertexChatHttpOptions(result.httpOptions);
|
|
147
|
+
return result;
|
|
141
148
|
}
|
|
142
149
|
withPhysicalRequestReservations(config, options) {
|
|
143
150
|
const reserve = options.reserveAdditionalModelRequest;
|
|
@@ -191,8 +198,11 @@ GoogleAIService = __decorate([
|
|
|
191
198
|
__param(0, inject(CoreTypes.LoggerService)),
|
|
192
199
|
__param(1, inject(CoreTypes.ToolProcessor)),
|
|
193
200
|
__param(2, inject(CoreTypes.ConfigService)),
|
|
201
|
+
__param(3, inject(CoreTypes.RedisClientManager)),
|
|
202
|
+
__param(3, optional()),
|
|
203
|
+
__param(4, unmanaged()),
|
|
194
204
|
__metadata("design:paramtypes", [Object, ToolProcessor,
|
|
195
|
-
ConfigService])
|
|
205
|
+
ConfigService, Object, String])
|
|
196
206
|
], GoogleAIService);
|
|
197
207
|
export { GoogleAIService };
|
|
198
208
|
function buildSamplingConfig(profile, settings) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleAIService.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleAIService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAIL,WAAW,EACX,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EACL,qBAAqB,EACrB,oCAAoC,EACpC,gCAAgC,EAChC,eAAe,GAEhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,E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IAE9B,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QAC9D,MAAM,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,aAAa,CAAC,OAAO;QAC9B,GAAG,EAAE,aAAa,CAAC,GAAG;QACtB,MAAM,EAAE,aAAa,CAAC,MAAM;QAC5B,IAAI,EAAE,aAAa,CAAC,IAAI;QACxB,qEAAqE;QACrE,KAAK,EAAE,OAAwB;KACvB,CAAC;IAEX,OAAO;QACL,eAAe,EAAE,IAAI;QACrB,aAAa,EAAE,MAAM,CAAC,cAAc,CAAC;KACtC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"GoogleAIService.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleAIService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAKL,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAC1G,OAAO,EAAE,eAAe,EAAwB,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAKvD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,E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from "../../../../../domain/services/runs/Run
|
|
|
7
7
|
import type { ToolInvocationService } from "../../../../../domain/services/tools/ToolInvocationService.js";
|
|
8
8
|
import type { ToolInvocationContentItem } from "../../../../../domain/models/messages/Message.js";
|
|
9
9
|
import type { DefaultToolExecutor } from "../../../tools/executors/DefaultToolExecutor.js";
|
|
10
|
+
import { type GoogleChatRoute } from './GoogleChatRoute.js';
|
|
10
11
|
export interface GoogleApprovalToolCall {
|
|
11
12
|
readonly internalId: string;
|
|
12
13
|
readonly providerId?: string;
|
|
@@ -25,8 +26,9 @@ export declare class GoogleApprovalCoordinator {
|
|
|
25
26
|
private readonly abortSignal?;
|
|
26
27
|
private readonly model?;
|
|
27
28
|
private readonly continuationProtector?;
|
|
29
|
+
private readonly route;
|
|
28
30
|
private readonly executionCoordinator;
|
|
29
|
-
constructor(runApprovalService: RunApprovalService, toolExecutor: DefaultToolExecutor, toolInvocationService?: ToolInvocationService | undefined, abortSignal?: (AbortSignal | null) | undefined, model?: string | undefined, continuationProtector?: RunApprovalContinuationProtector | undefined);
|
|
31
|
+
constructor(runApprovalService: RunApprovalService, toolExecutor: DefaultToolExecutor, toolInvocationService?: ToolInvocationService | undefined, abortSignal?: (AbortSignal | null) | undefined, model?: string | undefined, continuationProtector?: RunApprovalContinuationProtector | undefined, route?: GoogleChatRoute);
|
|
30
32
|
evaluate(params: {
|
|
31
33
|
readonly runId: string;
|
|
32
34
|
readonly userId: string;
|
package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleApprovalCoordinator.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+EAA+E,CAAC;AACtI,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,KAAK,EACV,qBAAqB,EAItB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"GoogleApprovalCoordinator.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+EAA+E,CAAC;AACtI,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,KAAK,EACV,qBAAqB,EAItB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2DAA2D,CAAC;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAClG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAE3F,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIhF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,M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,CAAC,OAAO,EAAE,oBAAoB,CAAC;KACxC,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAgEnC,MAAM,CACV,UAAU,EAAE,qBAAqB,EACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,wBAAwB,CAAC;IAoCpC,OAAO,KAAK,OAAO,GAGlB;YAEa,yBAAyB;CA0BxC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GEMINI_REPLAY_THOUGHT_SIGNATURE } from "../../../../mappers/chat/google/GeminiChatMessageMapper.js";
|
|
2
|
+
import { developerChatRoute } from './GoogleChatRoute.js';
|
|
2
3
|
import { toGoogleJsonValue } from "./GoogleJsonValue.js";
|
|
3
4
|
import { ApprovalCheckpointToolExecutionCoordinator } from "../../../../services/runs/approval/ApprovalCheckpointToolExecutionCoordinator.js";
|
|
4
5
|
export class GoogleApprovalCoordinator {
|
|
@@ -8,19 +9,22 @@ export class GoogleApprovalCoordinator {
|
|
|
8
9
|
abortSignal;
|
|
9
10
|
model;
|
|
10
11
|
continuationProtector;
|
|
12
|
+
route;
|
|
11
13
|
executionCoordinator;
|
|
12
|
-
constructor(runApprovalService, toolExecutor, toolInvocationService, abortSignal, model, continuationProtector) {
|
|
14
|
+
constructor(runApprovalService, toolExecutor, toolInvocationService, abortSignal, model, continuationProtector, route = developerChatRoute) {
|
|
13
15
|
this.runApprovalService = runApprovalService;
|
|
14
16
|
this.toolExecutor = toolExecutor;
|
|
15
17
|
this.toolInvocationService = toolInvocationService;
|
|
16
18
|
this.abortSignal = abortSignal;
|
|
17
19
|
this.model = model;
|
|
18
20
|
this.continuationProtector = continuationProtector;
|
|
19
|
-
this.
|
|
21
|
+
this.route = route;
|
|
22
|
+
this.executionCoordinator = new ApprovalCheckpointToolExecutionCoordinator(runApprovalService, toolExecutor, abortSignal, toGoogleJsonValue, route.provider);
|
|
20
23
|
}
|
|
21
24
|
async evaluate(params) {
|
|
22
25
|
const durable = Boolean(params.context.executionSession);
|
|
23
|
-
|
|
26
|
+
const protect = durable || this.route.provider === 'vertex';
|
|
27
|
+
if (protect && (!this.model || !this.continuationProtector)) {
|
|
24
28
|
throw new Error('Durable Google continuation protection is unavailable.');
|
|
25
29
|
}
|
|
26
30
|
const approval = await this.runApprovalService.evaluateToolCallBatch({
|
|
@@ -31,14 +35,14 @@ export class GoogleApprovalCoordinator {
|
|
|
31
35
|
voiceTaskCoordination: params.context.voiceTaskCoordination,
|
|
32
36
|
runId: params.runId,
|
|
33
37
|
userId: params.userId,
|
|
34
|
-
provider:
|
|
38
|
+
provider: this.route.checkpoint,
|
|
35
39
|
baseSnapshotRunId: params.runId,
|
|
36
40
|
baseMessageCount: params.baseMessageCount,
|
|
37
|
-
continuationProtection:
|
|
41
|
+
continuationProtection: protect ? this.binding : undefined,
|
|
38
42
|
continuationDelta: [
|
|
39
43
|
{
|
|
40
44
|
kind: "google_contents",
|
|
41
|
-
contents: toGoogleJsonValue((
|
|
45
|
+
contents: toGoogleJsonValue((protect || params.context.subagentCoordination || params.context.subagentBudget)
|
|
42
46
|
? params.continuationContents : params.continuationContents.map(sanitizeContentForCheckpoint)),
|
|
43
47
|
}
|
|
44
48
|
],
|
|
@@ -71,12 +75,14 @@ export class GoogleApprovalCoordinator {
|
|
|
71
75
|
};
|
|
72
76
|
}
|
|
73
77
|
async resume(checkpoint, context) {
|
|
74
|
-
if (checkpoint.provider !==
|
|
78
|
+
if (checkpoint.provider !== this.route.checkpoint) {
|
|
75
79
|
throw new Error("Approval checkpoint does not belong to Google GenerateContent.");
|
|
76
80
|
}
|
|
77
81
|
const protectedPayload = checkpoint.continuationDelta[0];
|
|
78
82
|
const isProtected = protectedPayload && typeof protectedPayload === 'object'
|
|
79
83
|
&& !Array.isArray(protectedPayload) && protectedPayload.kind === 'protected_provider_continuation';
|
|
84
|
+
if (this.route.provider === 'vertex' && !isProtected)
|
|
85
|
+
throw new Error('Vertex continuation is missing its transport binding.');
|
|
80
86
|
if (isProtected && (!this.continuationProtector || !this.model)) {
|
|
81
87
|
throw new Error('Durable Google continuation protection is unavailable.');
|
|
82
88
|
}
|
|
@@ -100,6 +106,8 @@ export class GoogleApprovalCoordinator {
|
|
|
100
106
|
};
|
|
101
107
|
}
|
|
102
108
|
get binding() {
|
|
109
|
+
if (this.route.provider === 'vertex')
|
|
110
|
+
return { version: 3, model: this.model, codecVersion: 1, transportIdentity: this.route.transportIdentity };
|
|
103
111
|
return { version: 2, model: this.model, codecVersion: 1 };
|
|
104
112
|
}
|
|
105
113
|
async recordTerminalInvocations(checkpoint, context) {
|
|
@@ -112,7 +120,7 @@ export class GoogleApprovalCoordinator {
|
|
|
112
120
|
runId: context.runId,
|
|
113
121
|
userId: context.userId,
|
|
114
122
|
conversationId: context.conversation?.id,
|
|
115
|
-
provider:
|
|
123
|
+
provider: this.route.provider,
|
|
116
124
|
providerToolCallId: call.providerCallId,
|
|
117
125
|
functionName: call.toolName,
|
|
118
126
|
rawArguments: call.toolArguments,
|
package/build/src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleApprovalCoordinator.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,+BAA+B,EAAE,MAAM,4DAA4D,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,0CAA0C,EAAE,MAAM,kFAAkF,CAAC;AAe9I,MAAM,OAAO,yBAAyB;IAIjB;IACA;IACA;IACA;IACA;IACA;
|
|
1
|
+
{"version":3,"file":"GoogleApprovalCoordinator.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleApprovalCoordinator.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,+BAA+B,EAAE,MAAM,4DAA4D,CAAC;AAC7G,OAAO,EAA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AC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAE1E,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;YAC1B,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;YAElD,IAAI,CAAC,IAAI;gBACP,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YAEtE,OAAO;gBACL,gBAAgB,EAAE;oBAChB,EAAE,EAAE,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc;oBAChF,IAAI,EAAE,IAAI,CAAC,QAAQ;oBACnB,QAAQ,EAAE,MAAM,CAAC,eAAe,KAAK,WAAW;wBAC9C,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;wBACnC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,mBAAmB,EAAE;iBACpE;aACF,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CACzB,IAAgD;IAEhD,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,cAAc,KAAK,UAAU;QAC7D,OAAO,UAAU,CAAC;IAEpB,OAAO,IAAI,CAAC,eAAe,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GoogleGenAiConnection } from '../../../google/GoogleGenAiConnection.js';
|
|
2
|
+
export declare const developerChatRoute: {
|
|
3
|
+
readonly provider: "google";
|
|
4
|
+
readonly checkpoint: "google_generate_content";
|
|
5
|
+
};
|
|
6
|
+
export type GoogleChatRoute = typeof developerChatRoute | {
|
|
7
|
+
readonly provider: 'vertex';
|
|
8
|
+
readonly checkpoint: 'vertex_generate_content';
|
|
9
|
+
readonly transportIdentity: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function googleChatRoute(connection: GoogleGenAiConnection): GoogleChatRoute;
|
|
12
|
+
//# sourceMappingURL=GoogleChatRoute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleChatRoute.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEtF,eAAO,MAAM,kBAAkB;;;CAAyE,CAAC;AACzG,MAAM,MAAM,eAAe,GAAG,OAAO,kBAAkB,GAAG;IACxD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,yBAAyB,CAAC;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,eAAe,CAOlF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
export const developerChatRoute = { provider: 'google', checkpoint: 'google_generate_content' };
|
|
3
|
+
export function googleChatRoute(connection) {
|
|
4
|
+
if (connection.kind === 'developer')
|
|
5
|
+
return developerChatRoute;
|
|
6
|
+
return {
|
|
7
|
+
provider: 'vertex',
|
|
8
|
+
checkpoint: 'vertex_generate_content',
|
|
9
|
+
transportIdentity: createHash('sha256').update(JSON.stringify(['vertex', connection.project, connection.location])).digest('hex'),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=GoogleChatRoute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleChatRoute.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleChatRoute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,yBAAyB,EAAW,CAAC;AAOzG,MAAM,UAAU,eAAe,CAAC,UAAiC;IAC/D,IAAI,UAAU,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,kBAAkB,CAAC;IAC/D,OAAO;QACL,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE,yBAAyB;QACrC,iBAAiB,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAClI,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleConfig.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/google/GoogleConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAEvE,eAAO,MAAM,oCAAoC,QAAS,CAAC;AAC3D,eAAO,MAAM,gCAAgC,QAAS,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,QAAQ,CAAC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAC9C,QAAQ,C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