@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
|
@@ -0,0 +1,95 @@
|
|
|
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 { inject, injectable } from 'inversify';
|
|
14
|
+
import { ConfigService } from '@gaia-framework/config';
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import CoreTypes from '../../../../di/types.js';
|
|
17
|
+
import { AIExecutionFailure, createAIExecutionFailure } from '../../../../../domain/errors/AIExecutionFailure.js';
|
|
18
|
+
export const TOGETHER_BASE_URL = 'https://api.together.ai/v1';
|
|
19
|
+
export const TOGETHER_LLM_CONFIG = 'ai.llm.providers.togetherai';
|
|
20
|
+
const routes = new Set([
|
|
21
|
+
'zai-org/GLM-5.2',
|
|
22
|
+
'zai-org/GLM-5.3',
|
|
23
|
+
'zai-org/GLM-5.3-Flash',
|
|
24
|
+
'deepseek-ai/DeepSeek-V4.1-Flash-1017',
|
|
25
|
+
'moonshotai/Kimi-K3.1-Pro',
|
|
26
|
+
]);
|
|
27
|
+
const entry = z.object({
|
|
28
|
+
id: z.string(),
|
|
29
|
+
type: z.literal('chat'),
|
|
30
|
+
display_name: z.string().trim().min(1),
|
|
31
|
+
context_length: z.number().int().min(2048),
|
|
32
|
+
});
|
|
33
|
+
let TogetherCatalog = class TogetherCatalog {
|
|
34
|
+
config;
|
|
35
|
+
cached;
|
|
36
|
+
loading;
|
|
37
|
+
constructor(config) {
|
|
38
|
+
this.config = config;
|
|
39
|
+
}
|
|
40
|
+
async getModels() {
|
|
41
|
+
const key = this.config.getOptionalString(TOGETHER_LLM_CONFIG + '.apiKey')?.trim();
|
|
42
|
+
if (!this.config.getOptionalBoolean(TOGETHER_LLM_CONFIG + '.enabled') || !key)
|
|
43
|
+
return [];
|
|
44
|
+
if (this.cached && Date.now() < this.cached.expires)
|
|
45
|
+
return this.cached.models;
|
|
46
|
+
this.loading ??= this.load(key).finally(() => { this.loading = undefined; });
|
|
47
|
+
return this.loading;
|
|
48
|
+
}
|
|
49
|
+
async load(key) {
|
|
50
|
+
try {
|
|
51
|
+
const response = await fetch(TOGETHER_BASE_URL + '/models', {
|
|
52
|
+
headers: { Authorization: 'Bearer ' + key, Accept: 'application/json' },
|
|
53
|
+
redirect: 'error',
|
|
54
|
+
signal: AbortSignal.timeout(5000),
|
|
55
|
+
});
|
|
56
|
+
if (!response.ok) {
|
|
57
|
+
await response.body?.cancel();
|
|
58
|
+
throw createAIExecutionFailure(response.status === 401 ? 'provider_authentication_failed'
|
|
59
|
+
: response.status === 403 ? 'provider_access_denied' : 'provider_unavailable');
|
|
60
|
+
}
|
|
61
|
+
const models = new Map();
|
|
62
|
+
for (const raw of z.array(z.unknown()).parse(await response.json())) {
|
|
63
|
+
const parsed = entry.safeParse(raw);
|
|
64
|
+
if (!parsed.success || !routes.has(parsed.data.id))
|
|
65
|
+
continue;
|
|
66
|
+
const row = parsed.data;
|
|
67
|
+
const id = 'togetherai/' + row.id;
|
|
68
|
+
models.set(id, {
|
|
69
|
+
id, providerModel: row.id, displayName: row.display_name, provider: 'Together AI', type: 'llm',
|
|
70
|
+
supportsTools: true, supportsInstructions: true, supportsReasoning: true,
|
|
71
|
+
inputModalities: ['text'], outputModalities: ['text'], maxContextLength: row.context_length,
|
|
72
|
+
defaultSettings: { maxTokens: 4096 },
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const result = [...models.values()];
|
|
76
|
+
this.cached = { models: result, expires: Date.now() + 300_000 };
|
|
77
|
+
return result;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
if (error instanceof AIExecutionFailure && !error.retryable)
|
|
81
|
+
throw error;
|
|
82
|
+
if (!this.cached)
|
|
83
|
+
throw createAIExecutionFailure('provider_unavailable');
|
|
84
|
+
this.cached.expires = Date.now() + 30_000;
|
|
85
|
+
return this.cached.models;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
TogetherCatalog = __decorate([
|
|
90
|
+
injectable(),
|
|
91
|
+
__param(0, inject(CoreTypes.ConfigService)),
|
|
92
|
+
__metadata("design:paramtypes", [ConfigService])
|
|
93
|
+
], TogetherCatalog);
|
|
94
|
+
export { TogetherCatalog };
|
|
95
|
+
//# sourceMappingURL=TogetherCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TogetherCatalog.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAElH,MAAM,CAAC,MAAM,iBAAiB,GAAG,4BAA4B,CAAC;AAC9D,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAEjE,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IACrB,iBAAiB;IACjB,iBAAiB;IACjB,uBAAuB;IACvB,sCAAsC;IACtC,0BAA0B;CAC3B,CAAC,CAAC;AAEH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;IACrB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE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AAC,EAAE,gBAAgB,EAAE,GAAG,CAAC,cAAc;oBAC3F,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;iBACrC,CAAC,CAAC;YACL,CAAC;YACD,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YACpC,IAAI,CAAC,MAAM,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;YAChE,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,kBAAkB,IAAI,CAAC,KAAK,CAAC,SAAS;gBAAE,MAAM,KAAK,CAAC;YACzE,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAE,MAAM,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;YACzE,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;YAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC;QAC5B,CAAC;IACH,CAAC;CACF,CAAA;AAjDY,eAAe;IAD3B,UAAU,EAAE;IAKE,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;qCAA0B,aAAa;GAJxE,eAAe,CAiD3B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ConfigService } from '@gaia-framework/config';
|
|
2
|
+
import type { Responses } from 'openai/resources/responses/responses.js';
|
|
3
|
+
import type { LLMResponse, LLMResponseOptions } from '../../../../../domain/ports/ai/llm/LLMProvider.js';
|
|
4
|
+
import type { LLMExecutionEvent } from '../../../../../domain/models/messages/MessageEvent.js';
|
|
5
|
+
import { BaseLLMProvider } from '../../base/BaseLLMProvider.js';
|
|
6
|
+
import { ResponsesApiStreamService } from '../../../../services/chat/ResponsesApiStreamService.js';
|
|
7
|
+
import { OpenAIResponsesApiMessageMapper } from '../../../../mappers/chat/openai/OpenAIResponsesApiMessageMapper.js';
|
|
8
|
+
import { DefaultChatMessageTransformer } from '../../../../transformers/default/DefaultChatMessageTransformer.js';
|
|
9
|
+
import { OpenAIResponsesApiService } from '../openai/responses/OpenAIResponsesApiService.js';
|
|
10
|
+
import { TogetherCatalog } from './TogetherCatalog.js';
|
|
11
|
+
export declare class TogetherLLMProvider extends BaseLLMProvider {
|
|
12
|
+
private readonly config;
|
|
13
|
+
private readonly catalog;
|
|
14
|
+
private readonly responses;
|
|
15
|
+
private readonly streams;
|
|
16
|
+
private readonly mapper;
|
|
17
|
+
private readonly transformer;
|
|
18
|
+
readonly id = "togetherai";
|
|
19
|
+
constructor(config: ConfigService, catalog: TogetherCatalog, responses: OpenAIResponsesApiService, streams: ResponsesApiStreamService, mapper: OpenAIResponsesApiMessageMapper, transformer: DefaultChatMessageTransformer);
|
|
20
|
+
getModels(): Promise<import("../../../../../../main.js").LLMInfo[]>;
|
|
21
|
+
isValidModel(id: string): Promise<boolean>;
|
|
22
|
+
supportsBoundedSubagentExecution(): boolean;
|
|
23
|
+
private prepare;
|
|
24
|
+
getResponse(options: LLMResponseOptions): Promise<LLMResponse>;
|
|
25
|
+
getResponseEvents(options: LLMResponseOptions): AsyncGenerator<LLMExecutionEvent>;
|
|
26
|
+
getResponseStream(options: LLMResponseOptions): AsyncGenerator<LLMExecutionEvent>;
|
|
27
|
+
}
|
|
28
|
+
export declare function togetherResponsesRequest(request: Responses.ResponseCreateParamsNonStreaming): Responses.ResponseCreateParamsNonStreaming;
|
|
29
|
+
//# sourceMappingURL=TogetherLLMProvider.d.ts.map
|
package/build/src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TogetherLLMProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,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C,OAAO,EAAE,kBAAkB,GAAG,cAAc,CAAC,iBAAiB,CAAC;CAYzF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,SAAS,CAAC,gCAAgC,GAAG,SAAS,CAAC,gCAAgC,CAYxI"}
|
|
@@ -0,0 +1,167 @@
|
|
|
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 { inject, injectable } from 'inversify';
|
|
14
|
+
import { ConfigService } from '@gaia-framework/config';
|
|
15
|
+
import CoreTypes from '../../../../di/types.js';
|
|
16
|
+
import { classifyAIExecutionFailure, createAIExecutionFailure } from '../../../../../domain/errors/AIExecutionFailure.js';
|
|
17
|
+
import { SubagentWaitSuspended } from '../../../../../domain/errors/SubagentWaitSuspended.js';
|
|
18
|
+
import { VoiceContextSuspended } from '../../../../../domain/errors/VoiceContextSuspended.js';
|
|
19
|
+
import { BaseLLMProvider } from '../../base/BaseLLMProvider.js';
|
|
20
|
+
import { PortableContextAdapter, CONTEXT_SUMMARY_INSTRUCTIONS } from '../../context/PortableContextAdapter.js';
|
|
21
|
+
import { responsesContextCodec } from '../../context/codecs/PortableContextCodecs.js';
|
|
22
|
+
import { estimateResponsesRequestTokens } from '../../context/counting/ResponsesContextTokenEstimator.js';
|
|
23
|
+
import { reserveContextSummary } from '../../execution/ModelRequestPolicy.js';
|
|
24
|
+
import { responseUsage } from '../../../../services/chat/ProviderRequestUsage.js';
|
|
25
|
+
import { ResponsesApiStreamService } from '../../../../services/chat/ResponsesApiStreamService.js';
|
|
26
|
+
import { OpenAIResponsesApiMessageMapper } from '../../../../mappers/chat/openai/OpenAIResponsesApiMessageMapper.js';
|
|
27
|
+
import { DefaultChatMessageTransformer } from '../../../../transformers/default/DefaultChatMessageTransformer.js';
|
|
28
|
+
import { OpenAIResponsesApiService } from '../openai/responses/OpenAIResponsesApiService.js';
|
|
29
|
+
import { prepareOpenAIResponsesInput } from '../openai/responses/OpenAIResponsesInput.js';
|
|
30
|
+
import { TOGETHER_BASE_URL, TOGETHER_LLM_CONFIG, TogetherCatalog } from './TogetherCatalog.js';
|
|
31
|
+
let TogetherLLMProvider = class TogetherLLMProvider extends BaseLLMProvider {
|
|
32
|
+
config;
|
|
33
|
+
catalog;
|
|
34
|
+
responses;
|
|
35
|
+
streams;
|
|
36
|
+
mapper;
|
|
37
|
+
transformer;
|
|
38
|
+
id = 'togetherai';
|
|
39
|
+
constructor(config, catalog, responses, streams, mapper, transformer) {
|
|
40
|
+
super();
|
|
41
|
+
this.config = config;
|
|
42
|
+
this.catalog = catalog;
|
|
43
|
+
this.responses = responses;
|
|
44
|
+
this.streams = streams;
|
|
45
|
+
this.mapper = mapper;
|
|
46
|
+
this.transformer = transformer;
|
|
47
|
+
}
|
|
48
|
+
getModels() { return this.catalog.getModels(); }
|
|
49
|
+
async isValidModel(id) {
|
|
50
|
+
return id.startsWith('togetherai/') && (await this.getModels()).some(model => model.id === id);
|
|
51
|
+
}
|
|
52
|
+
supportsBoundedSubagentExecution() { return true; }
|
|
53
|
+
async prepare(options) {
|
|
54
|
+
const models = await this.getModels();
|
|
55
|
+
const model = models.find(info => info.id === options.model);
|
|
56
|
+
if (!model)
|
|
57
|
+
throw createAIExecutionFailure('provider_model_unavailable');
|
|
58
|
+
const input = prepareOpenAIResponsesInput(options.messages, options.instructions);
|
|
59
|
+
const messages = await this.transformAndMapMessages(input.messages, this.transformer, this.mapper);
|
|
60
|
+
const maxTokens = options.settings?.maxTokens ?? model.defaultSettings?.maxTokens ?? 4096;
|
|
61
|
+
const settings = { ...options.settings, maxTokens };
|
|
62
|
+
const params = { ...options, messages, settings, instructions: input.instructions };
|
|
63
|
+
const transport = {
|
|
64
|
+
apiKey: this.config.getString(TOGETHER_LLM_CONFIG + '.apiKey').trim(),
|
|
65
|
+
baseURL: TOGETHER_BASE_URL,
|
|
66
|
+
signal: options.abortSignal,
|
|
67
|
+
timeout: 120_000,
|
|
68
|
+
maxRetries: 0,
|
|
69
|
+
logLevel: 'off',
|
|
70
|
+
requestPolicy: togetherResponsesRequest,
|
|
71
|
+
normalizeError: normalizeTogetherError,
|
|
72
|
+
};
|
|
73
|
+
// Together does not expose the native token-count or compact endpoints.
|
|
74
|
+
const contextAdapter = new PortableContextAdapter(model.maxContextLength, maxTokens, responsesContextCodec, {
|
|
75
|
+
countTokens: items => Promise.resolve(estimateResponsesRequestTokens({
|
|
76
|
+
model: model.providerModel, input: [...items], instructions: input.instructions ?? '',
|
|
77
|
+
})),
|
|
78
|
+
countSummaryTokens: items => Promise.resolve(estimateResponsesRequestTokens({
|
|
79
|
+
model: model.providerModel, input: [...items], instructions: CONTEXT_SUMMARY_INSTRUCTIONS,
|
|
80
|
+
})),
|
|
81
|
+
summarize: async (history, maxTokens, signal) => {
|
|
82
|
+
const settle = await reserveContextSummary(maxTokens, options.toolExecutionContext);
|
|
83
|
+
const result = await this.responses.getResponse({
|
|
84
|
+
...params, messages: [...history], instructions: CONTEXT_SUMMARY_INSTRUCTIONS, tools: [],
|
|
85
|
+
settings: { maxTokens }, toolExecutionContext: undefined, runId: undefined,
|
|
86
|
+
approvalResumeCheckpoint: undefined,
|
|
87
|
+
}, { ...transport, signal }, models);
|
|
88
|
+
if (result.kind !== 'completed')
|
|
89
|
+
throw createAIExecutionFailure('llm_response_incomplete');
|
|
90
|
+
await settle?.(responseUsage(result.response.usage));
|
|
91
|
+
return result.response.output.flatMap(item => item.type === 'message'
|
|
92
|
+
? item.content.flatMap(part => part.type === 'output_text' ? [part.text] : []) : []).join('');
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
return {
|
|
96
|
+
models, params,
|
|
97
|
+
transport: {
|
|
98
|
+
...transport, contextAdapter: Object.assign(contextAdapter, {
|
|
99
|
+
continuationIdentity: this.responses.getContinuationIdentity(model.providerModel, transport),
|
|
100
|
+
}),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
async getResponse(options) {
|
|
105
|
+
for await (const event of this.getResponseEvents(options)) {
|
|
106
|
+
if (event.type === 'message.completed' && 'message' in event && event.message)
|
|
107
|
+
return event.message;
|
|
108
|
+
if (event.type === 'approval.required' && 'approvalRequestId' in event)
|
|
109
|
+
return event;
|
|
110
|
+
}
|
|
111
|
+
throw createAIExecutionFailure('llm_response_incomplete');
|
|
112
|
+
}
|
|
113
|
+
async *getResponseEvents(options) {
|
|
114
|
+
try {
|
|
115
|
+
const { params, transport, models } = await this.prepare(options);
|
|
116
|
+
yield* this.responses.getResponseEvents(params, transport, models, response => this.mapper.convertToMessage(response.output, options.conversationId ?? undefined));
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
throw normalizeTogetherError(error);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async *getResponseStream(options) {
|
|
123
|
+
try {
|
|
124
|
+
const { params, transport, models } = await this.prepare(options);
|
|
125
|
+
yield* this.streams.getResponseStream(request => this.responses.getResponseStream(request, transport, models), params, { ...transport, contextAdapter: options.toolExecutionContext?.executionSession ? transport.contextAdapter : undefined });
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
throw normalizeTogetherError(error);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
TogetherLLMProvider = __decorate([
|
|
133
|
+
injectable(),
|
|
134
|
+
__param(0, inject(CoreTypes.ConfigService)),
|
|
135
|
+
__param(1, inject(TogetherCatalog)),
|
|
136
|
+
__param(2, inject(CoreTypes.OpenAIResponsesApiService)),
|
|
137
|
+
__param(3, inject(CoreTypes.ResponsesApiStreamService)),
|
|
138
|
+
__param(4, inject(CoreTypes.OpenAIResponsesApiMessageMapper)),
|
|
139
|
+
__param(5, inject(CoreTypes.ChatMessageTransformer)),
|
|
140
|
+
__metadata("design:paramtypes", [ConfigService,
|
|
141
|
+
TogetherCatalog,
|
|
142
|
+
OpenAIResponsesApiService,
|
|
143
|
+
ResponsesApiStreamService,
|
|
144
|
+
OpenAIResponsesApiMessageMapper,
|
|
145
|
+
DefaultChatMessageTransformer])
|
|
146
|
+
], TogetherLLMProvider);
|
|
147
|
+
export { TogetherLLMProvider };
|
|
148
|
+
export function togetherResponsesRequest(request) {
|
|
149
|
+
const tools = request.tools?.map(tool => {
|
|
150
|
+
if (tool.type !== 'function')
|
|
151
|
+
throw createAIExecutionFailure('provider_request_rejected');
|
|
152
|
+
return { ...tool, strict: false };
|
|
153
|
+
});
|
|
154
|
+
return {
|
|
155
|
+
model: request.model, input: request.input, instructions: request.instructions, store: false,
|
|
156
|
+
...(tools?.length && { tools, tool_choice: request.tool_choice, parallel_tool_calls: request.parallel_tool_calls }),
|
|
157
|
+
max_output_tokens: request.max_output_tokens,
|
|
158
|
+
text: request.text,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function normalizeTogetherError(error) {
|
|
162
|
+
if (error instanceof SubagentWaitSuspended || error instanceof VoiceContextSuspended
|
|
163
|
+
|| (error instanceof Error && error.name === 'AbortError'))
|
|
164
|
+
return error;
|
|
165
|
+
return createAIExecutionFailure(classifyAIExecutionFailure(error).code);
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=TogetherLLMProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TogetherLLMProvider.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/togetherai/TogetherLLMProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAGhD,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC1H,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,yCAAyC,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,mEAAmE,CAAC;AAClH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGxF,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB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C,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK;QAC5F,GAAG,CAAC,KAAK,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,EAAE,CAAC;QACnH,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,KAAK,YAAY,qBAAqB,IAAI,KAAK,YAAY,qBAAqB;WAC/E,CAAC,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3E,OAAO,wBAAwB,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ConfigService } from '@gaia-framework/config';
|
|
2
|
+
import { type GoogleGenAiConnection } from '../google/GoogleGenAiConnection.js';
|
|
3
|
+
export type GoogleSpeechSurface = 'speech' | 'realtime' | 'translation';
|
|
4
|
+
export declare function googleSpeechConnection(config: ConfigService, provider: 'google' | 'vertex', surface?: GoogleSpeechSurface): GoogleGenAiConnection | undefined;
|
|
5
|
+
//# sourceMappingURL=GoogleSpeechConnection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleSpeechConnection.d.ts","sourceRoot":"","sources":["../../../../../../src/core/infrastructure/ai/speech/GoogleSpeechConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAyB,KAAK,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEvG,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC;AASxE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAE,OAAO,GAAE,mBAA8B,GAAG,qBAAqB,GAAG,SAAS,CAcvK"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { googleGenAiConnection } from '../google/GoogleGenAiConnection.js';
|
|
2
|
+
// Model availability differs by endpoint. Never route audio outside the selected location.
|
|
3
|
+
const vertexSpeechLocations = {
|
|
4
|
+
speech: ['global', 'us', 'eu'],
|
|
5
|
+
realtime: ['us', 'eu', 'us-central1', 'asia-south1'],
|
|
6
|
+
translation: ['global'],
|
|
7
|
+
};
|
|
8
|
+
export function googleSpeechConnection(config, provider, surface = 'speech') {
|
|
9
|
+
if (provider === 'google') {
|
|
10
|
+
const apiKey = config.getOptionalString('ai.llm.providers.google.apiKey')?.trim();
|
|
11
|
+
return apiKey ? { kind: 'developer', apiKey } : undefined;
|
|
12
|
+
}
|
|
13
|
+
if (!config.getOptionalBoolean('ai.speech.providers.vertex.enabled')
|
|
14
|
+
|| !config.getOptionalString('ai.vertex.project')?.trim()
|
|
15
|
+
|| !config.getOptionalString('ai.vertex.location')?.trim())
|
|
16
|
+
return undefined;
|
|
17
|
+
const connection = googleGenAiConnection(config, provider);
|
|
18
|
+
if (connection.kind !== 'vertex')
|
|
19
|
+
return undefined;
|
|
20
|
+
const realtimeLocation = surface === 'realtime' ? config.getOptionalString('ai.speech.providers.vertex.realtimeLocation')?.trim() : undefined;
|
|
21
|
+
const location = realtimeLocation || config.getOptionalString('ai.speech.providers.vertex.location')?.trim() || connection.location;
|
|
22
|
+
if (!vertexSpeechLocations[surface].includes(location))
|
|
23
|
+
return undefined;
|
|
24
|
+
return { ...connection, location };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=GoogleSpeechCon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E,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9I,MAAM,QAAQ,GAAG,gBAAgB,IAAI,MAAM,CAAC,iBAAiB,CAAC,qCAAqC,CAAC,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,QAAQ,CAAC;IACpI,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS,CAAC;IACzE,OAAO,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -2,23 +2,23 @@ import { ConfigService } from "@gaia-framework/config";
|
|
|
2
2
|
import { SpeechToTextModelInfo } from "../../../../domain/models/speech/SpeechModelInfo.js";
|
|
3
3
|
import { LoggerService } from "../../../../domain/ports/services/LoggerService.js";
|
|
4
4
|
import { SpeechRecognitionOptions, SpeechToTextProvider } from "../../../../domain/ports/speech/SpeechToTextProvider.js";
|
|
5
|
+
import type { AudioProcessingService } from "../../../../domain/ports/services/media/AudioProcessingService.js";
|
|
5
6
|
import { TranscriptionProviderCapability, TranscriptionResult } from '../../../../domain/models/speech/Transcription.js';
|
|
6
7
|
export declare class AzureSpeechToTextProvider implements SpeechToTextProvider {
|
|
7
8
|
private readonly loggerService;
|
|
9
|
+
private readonly audioService;
|
|
8
10
|
readonly id = "azure";
|
|
9
11
|
private readonly enabled;
|
|
10
|
-
private readonly
|
|
11
|
-
private readonly
|
|
12
|
+
private readonly defaultResource;
|
|
13
|
+
private readonly maiResources;
|
|
12
14
|
private readonly requestTimeoutMs;
|
|
13
15
|
private readonly maxInputBytes;
|
|
14
|
-
constructor(loggerService: LoggerService, configService: ConfigService);
|
|
16
|
+
constructor(loggerService: LoggerService, configService: ConfigService, audioService: AudioProcessingService);
|
|
15
17
|
getModels(): readonly SpeechToTextModelInfo[];
|
|
16
18
|
getTranscriptionCapabilities(): TranscriptionProviderCapability;
|
|
17
|
-
transcribe(audio: Buffer, model?: string, options?: SpeechRecognitionOptions): Promise<TranscriptionResult>;
|
|
18
19
|
recognizeSpeech(audioBuffer: Buffer, model?: string, options?: SpeechRecognitionOptions): Promise<string>;
|
|
19
|
-
|
|
20
|
-
private
|
|
21
|
-
private endpoint;
|
|
20
|
+
transcribe(audioBuffer: Buffer, model?: string, options?: SpeechRecognitionOptions): Promise<TranscriptionResult>;
|
|
21
|
+
private validateSize;
|
|
22
22
|
private parseResponse;
|
|
23
23
|
private classifyHttpFailure;
|
|
24
24
|
private failure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AzureSpeechToTextProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"AzureSpeechToTextProvider.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/infrastructure/ai/speech/stt/AzureSpeechToTextProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AACzH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mEAAmE,CAAC;AAEhH,OAAO,EAAgC,+BAA+B,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AA0CvJ,qBACa,yBAA0B,YAAW,oBAAoB;IAUjC,OAAO,CAAC,QAAQ,CA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