@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
package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HuggingFaceLLMProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AAGzG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAG7F,OAAO,EAAE,6BAA6B,EAAE,MAAM,mEAAmE,CAAC;AAClH,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAGnG,qBACa,sBAAuB,SAAQ,eAAe;IAKtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACX,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW;IARxE,QAAQ,CAAC,EAAE,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;gBAGA,MAAM,EAAE,aAAa,EACT,SAAS,EAAE,yBAAyB,EACpC,OAAO,EAAE,yBAAyB,EAC5B,MAAM,EAAE,+BAA+B,EAChD,WAAW,EAAE,6BAA6B;IAGvG,OAAO,CAAC,KAAK;IAKP,SAAS;IAET,YAAY,CAAC,KAAK,EAAE,MAAM;YAIlB,OAAO;IAoBf,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ7D,iBAAiB,CAAC,OAAO,EAAE,kBAAkB;IAM7C,iBAAiB,CAAC,OAAO,EAAE,kBAAkB;CAIrD"}
|
|
@@ -0,0 +1,104 @@
|
|
|
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 { huggingFaceRequest, huggingFaceStream, validateHuggingFaceResponse } from './HuggingFaceResponses.js';
|
|
16
|
+
import CoreTypes from '../../../../di/types.js';
|
|
17
|
+
import { BaseLLMProvider } from '../../base/BaseLLMProvider.js';
|
|
18
|
+
import { createAIExecutionFailure } from '../../../../../domain/errors/AIExecutionFailure.js';
|
|
19
|
+
import { isResolvedImageContentItem } from '../../../../../domain/models/messages/ContentItemGuards.js';
|
|
20
|
+
import { OpenAIResponsesApiService } from '../openai/responses/OpenAIResponsesApiService.js';
|
|
21
|
+
import { createPortableResponsesContext } from '../openai/responses/createPortableResponsesContext.js';
|
|
22
|
+
import { prepareOpenAIResponsesInput } from '../openai/responses/OpenAIResponsesInput.js';
|
|
23
|
+
import { DefaultChatMessageTransformer } from '../../../../transformers/default/DefaultChatMessageTransformer.js';
|
|
24
|
+
import { OpenAIResponsesApiMessageMapper } from '../../../../mappers/chat/openai/OpenAIResponsesApiMessageMapper.js';
|
|
25
|
+
import { ResponsesApiStreamService } from '../../../../services/chat/ResponsesApiStreamService.js';
|
|
26
|
+
import { HF_ROUTER_URL, HuggingFaceCatalog } from './HuggingFaceCatalog.js';
|
|
27
|
+
let HuggingFaceLLMProvider = class HuggingFaceLLMProvider extends BaseLLMProvider {
|
|
28
|
+
config;
|
|
29
|
+
responses;
|
|
30
|
+
streams;
|
|
31
|
+
mapper;
|
|
32
|
+
transformer;
|
|
33
|
+
id = 'huggingface';
|
|
34
|
+
catalog = new HuggingFaceCatalog();
|
|
35
|
+
constructor(config, responses, streams, mapper, transformer) {
|
|
36
|
+
super();
|
|
37
|
+
this.config = config;
|
|
38
|
+
this.responses = responses;
|
|
39
|
+
this.streams = streams;
|
|
40
|
+
this.mapper = mapper;
|
|
41
|
+
this.transformer = transformer;
|
|
42
|
+
}
|
|
43
|
+
token() {
|
|
44
|
+
return this.config.getOptionalBoolean('ai.llm.providers.huggingface.enabled')
|
|
45
|
+
? this.config.getOptionalString('ai.llm.providers.huggingface.apiKey')?.trim() : undefined;
|
|
46
|
+
}
|
|
47
|
+
async getModels() { return this.token() ? this.catalog.list() : []; }
|
|
48
|
+
async isValidModel(model) {
|
|
49
|
+
return model.startsWith('huggingface/') && (await this.getModels()).some(info => info.id === model);
|
|
50
|
+
}
|
|
51
|
+
async prepare(options) {
|
|
52
|
+
const apiKey = this.token();
|
|
53
|
+
if (!apiKey)
|
|
54
|
+
throw createAIExecutionFailure('provider_authentication_failed');
|
|
55
|
+
const models = await this.catalog.list();
|
|
56
|
+
const info = models.find(model => model.id === options.model);
|
|
57
|
+
if (!info)
|
|
58
|
+
throw createAIExecutionFailure('provider_model_unavailable');
|
|
59
|
+
const input = prepareOpenAIResponsesInput(options.messages, options.instructions);
|
|
60
|
+
if (!info.inputModalities?.includes('image') && input.messages.some(message => message.content.some(isResolvedImageContentItem))) {
|
|
61
|
+
throw createAIExecutionFailure('unsupported_media_input');
|
|
62
|
+
}
|
|
63
|
+
const messages = await this.transformAndMapMessages(input.messages, this.transformer, this.mapper);
|
|
64
|
+
const params = { ...options, messages, instructions: input.instructions, tools: info.supportsTools ? options.tools : [] };
|
|
65
|
+
const transport = {
|
|
66
|
+
apiKey, baseURL: HF_ROUTER_URL, signal: options.abortSignal, maxRetries: 0, timeout: 120_000, logLevel: 'off',
|
|
67
|
+
requestPolicy: huggingFaceRequest, validateResponse: validateHuggingFaceResponse,
|
|
68
|
+
};
|
|
69
|
+
const contextAdapter = createPortableResponsesContext(this.responses, params, transport, models, info);
|
|
70
|
+
return { params, models, transport: { ...transport, contextAdapter } };
|
|
71
|
+
}
|
|
72
|
+
async getResponse(options) {
|
|
73
|
+
for await (const event of this.getResponseEvents(options)) {
|
|
74
|
+
if (event.type === 'message.completed' && 'message' in event && event.message)
|
|
75
|
+
return event.message;
|
|
76
|
+
if (event.type === 'approval.required' && 'approvalRequestId' in event)
|
|
77
|
+
return event;
|
|
78
|
+
}
|
|
79
|
+
throw createAIExecutionFailure('llm_response_incomplete');
|
|
80
|
+
}
|
|
81
|
+
async *getResponseEvents(options) {
|
|
82
|
+
const { params, models, transport } = await this.prepare(options);
|
|
83
|
+
yield* this.responses.getResponseEvents(params, transport, models, response => this.mapper.convertToMessage(response.output, options.conversationId ?? undefined));
|
|
84
|
+
}
|
|
85
|
+
async *getResponseStream(options) {
|
|
86
|
+
const { params, models, transport } = await this.prepare(options);
|
|
87
|
+
yield* this.streams.getResponseStream(async (request) => huggingFaceStream(await this.responses.getResponseStream(request, transport, models)), params, transport);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
HuggingFaceLLMProvider = __decorate([
|
|
91
|
+
injectable(),
|
|
92
|
+
__param(0, inject(CoreTypes.ConfigService)),
|
|
93
|
+
__param(1, inject(CoreTypes.OpenAIResponsesApiService)),
|
|
94
|
+
__param(2, inject(CoreTypes.ResponsesApiStreamService)),
|
|
95
|
+
__param(3, inject(CoreTypes.OpenAIResponsesApiMessageMapper)),
|
|
96
|
+
__param(4, inject(CoreTypes.ChatMessageTransformer)),
|
|
97
|
+
__metadata("design:paramtypes", [ConfigService,
|
|
98
|
+
OpenAIResponsesApiService,
|
|
99
|
+
ResponsesApiStreamService,
|
|
100
|
+
OpenAIResponsesApiMessageMapper,
|
|
101
|
+
DefaultChatMessageTransformer])
|
|
102
|
+
], HuggingFaceLLMProvider);
|
|
103
|
+
export { HuggingFaceLLMProvider };
|
|
104
|
+
//# sourceMappingURL=HuggingFaceLLMProvider.js.map
|
package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HuggingFaceLLMProvider.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceLLMProvider.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,kBAAkB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC/G,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,4DAA4D,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,6BAA6B,EAAE,MAAM,mEAAmE,CAAC;AAClH,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGrE,IAAM,sBAAsB,GAA5B,MA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,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACnK,CAAC;CACF,CAAA;AA7DY,sBAAsB;IADlC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAC/B,WAAA,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;IAC3C,WAAA,MAAM,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAA;IACjD,WAAA,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAA;qCAJiB,aAAa;QACE,yBAAyB;QAC3B,yBAAyB;QACpB,+BAA+B;QACnC,6BAA6B;GAT5F,sBAAsB,CA6DlC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Responses } from 'openai/resources/responses/responses.js';
|
|
2
|
+
export declare function huggingFaceRequest(request: Responses.ResponseCreateParamsNonStreaming): {
|
|
3
|
+
tools: Responses.FunctionTool[] | undefined;
|
|
4
|
+
tool_choice: Responses.ToolChoiceOptions | Responses.ToolChoiceAllowed | Responses.ToolChoiceTypes | Responses.ToolChoiceFunction | Responses.ToolChoiceCustom | Responses.ResponseCreateParams.SpecificProgrammaticToolCallingParam | Responses.ToolChoiceApplyPatch | Responses.ToolChoiceShell | undefined;
|
|
5
|
+
parallel_tool_calls: undefined;
|
|
6
|
+
stream?: false | null;
|
|
7
|
+
access_programs?: Responses.ResponseCreateParams.AccessPrograms;
|
|
8
|
+
background?: boolean | null;
|
|
9
|
+
background_options?: Responses.ResponseCreateParams.BackgroundOptions;
|
|
10
|
+
context_management?: Array<Responses.ResponseCreateParams.ContextManagement> | null;
|
|
11
|
+
conversation?: string | Responses.ResponseConversationParam | null;
|
|
12
|
+
image?: Responses.ResponseCreateParams.Image;
|
|
13
|
+
include?: Array<Responses.ResponseIncludable> | null;
|
|
14
|
+
input?: string | Responses.ResponseInput;
|
|
15
|
+
instructions?: string | null;
|
|
16
|
+
max_output_tokens?: number | null;
|
|
17
|
+
max_tool_calls?: number | null;
|
|
18
|
+
metadata?: import("openai/resources/shared.js").Metadata | null;
|
|
19
|
+
model?: import("openai/resources/shared.js").ResponsesModel;
|
|
20
|
+
moderation?: Responses.ResponseCreateParams.Moderation | null;
|
|
21
|
+
previous_response_id?: string | null;
|
|
22
|
+
prompt?: Responses.ResponsePrompt | null;
|
|
23
|
+
prompt_cache_key?: string | null;
|
|
24
|
+
prompt_cache_options?: Responses.ResponseCreateParams.PromptCacheOptions;
|
|
25
|
+
prompt_cache_retention?: "in_memory" | "24h" | null;
|
|
26
|
+
reasoning?: import("openai/resources/shared.js").Reasoning | null;
|
|
27
|
+
safety_identifier?: string | null;
|
|
28
|
+
service_tier?: Responses.ServiceTier | null;
|
|
29
|
+
store?: boolean | null;
|
|
30
|
+
stream_options?: Responses.ResponseCreateParams.StreamOptions | null;
|
|
31
|
+
temperature?: number | null;
|
|
32
|
+
text?: Responses.ResponseTextConfig;
|
|
33
|
+
top_logprobs?: number | null;
|
|
34
|
+
top_p?: number | null;
|
|
35
|
+
truncation?: "auto" | "disabled" | null;
|
|
36
|
+
user?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare function validateHuggingFaceResponse(response: Pick<Responses.Response, 'status' | 'error'>): void;
|
|
39
|
+
export declare function huggingFaceStream(events: AsyncIterable<Responses.ResponseStreamEvent>): AsyncGenerator<Responses.ResponseAudioDeltaEvent | Responses.ResponseAudioDoneEvent | Responses.ResponseAudioTranscriptDeltaEvent | Responses.ResponseAudioTranscriptDoneEvent | Responses.ResponseCodeInterpreterCallCodeDeltaEvent | Responses.ResponseCodeInterpreterCallCodeDoneEvent | Responses.ResponseCodeInterpreterCallCompletedEvent | Responses.ResponseCodeInterpreterCallInProgressEvent | Responses.ResponseCodeInterpreterCallInterpretingEvent | Responses.ResponseCompactionCompactingEvent | Responses.ResponseCompletedEvent | Responses.ResponseContentPartAddedEvent | Responses.ResponseContentPartDoneEvent | Responses.ResponseCreatedEvent | Responses.ResponseFileSearchCallCompletedEvent | Responses.ResponseFileSearchCallInProgressEvent | Responses.ResponseFileSearchCallSearchingEvent | Responses.ResponseFunctionCallArgumentsDeltaEvent | Responses.ResponseFunctionCallArgumentsDoneEvent | Responses.ResponseShellCallCommandAddedEvent | Responses.ResponseShellCallCommandDeltaEvent | Responses.ResponseShellCallCommandDoneEvent | Responses.ResponseShellCallOutputContentDeltaEvent | Responses.ResponseShellCallOutputContentDoneEvent | Responses.ResponseInProgressEvent | Responses.ResponseFailedEvent | Responses.ResponseIncompleteEvent | Responses.ResponseOutputItemAddedEvent | Responses.ResponseOutputItemDoneEvent | Responses.ResponseReasoningSummaryPartAddedEvent | Responses.ResponseReasoningSummaryPartDoneEvent | Responses.ResponseReasoningSummaryTextDeltaEvent | Responses.ResponseReasoningSummaryTextDoneEvent | Responses.ResponseReasoningTextDeltaEvent | Responses.ResponseReasoningTextDoneEvent | Responses.ResponseRefusalDeltaEvent | Responses.ResponseRefusalDoneEvent | Responses.ResponseTextDeltaEvent | Responses.ResponseTextDoneEvent | Responses.ResponseWebSearchCallCompletedEvent | Responses.ResponseWebSearchCallInProgressEvent | Responses.ResponseWebSearchCallSearchingEvent | Responses.ResponseImageGenCallCompletedEvent | Responses.ResponseImageGenCallGeneratingEvent | Responses.ResponseImageGenCallInProgressEvent | Responses.ResponseImageGenCallPartialImageEvent | Responses.ResponseMcpCallArgumentsDeltaEvent | Responses.ResponseMcpCallArgumentsDoneEvent | Responses.ResponseMcpCallCompletedEvent | Responses.ResponseMcpCallFailedEvent | Responses.ResponseMcpCallInProgressEvent | Responses.ResponseMcpListToolsCompletedEvent | Responses.ResponseMcpListToolsFailedEvent | Responses.ResponseMcpListToolsInProgressEvent | Responses.ResponseOutputTextAnnotationAddedEvent | Responses.ResponseQueuedEvent | Responses.ResponseCustomToolCallInputDeltaEvent | Responses.ResponseCustomToolCallInputDoneEvent, void, unknown>;
|
|
40
|
+
//# sourceMappingURL=HuggingFaceResponses.d.ts.map
|
package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HuggingFaceResponses.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrF;AAaD,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAGjG;AAED,wBAAuB,iBAAiB,CAAC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,mBAAmB,CAAC,8lFAW5F"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AIExecutionFailure, createAIExecutionFailure } from '../../../../../domain/errors/AIExecutionFailure.js';
|
|
2
|
+
export function huggingFaceRequest(request) {
|
|
3
|
+
const tools = request.tools?.filter(tool => tool.type === 'function');
|
|
4
|
+
return {
|
|
5
|
+
...request, tools: tools?.length ? tools : undefined,
|
|
6
|
+
tool_choice: tools?.length ? request.tool_choice : undefined, parallel_tool_calls: undefined,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function failed(message) {
|
|
10
|
+
// The router can return HTTP 200 and embed the underlying provider's 402 in the response.
|
|
11
|
+
if (/^402\b/.test(message ?? '')) {
|
|
12
|
+
throw new AIExecutionFailure({
|
|
13
|
+
code: 'provider_access_denied', category: 'provider_permission', statusCode: 402, retryable: false,
|
|
14
|
+
message: 'Hugging Face inference credits are required for this route. Check the provider account billing settings.',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
throw createAIExecutionFailure('provider_unavailable');
|
|
18
|
+
}
|
|
19
|
+
export function validateHuggingFaceResponse(response) {
|
|
20
|
+
if (response.status === 'failed' || response.error)
|
|
21
|
+
failed(response.error?.message);
|
|
22
|
+
if (response.status !== 'completed')
|
|
23
|
+
throw createAIExecutionFailure('llm_response_incomplete');
|
|
24
|
+
}
|
|
25
|
+
export async function* huggingFaceStream(events) {
|
|
26
|
+
let completed = false;
|
|
27
|
+
for await (const event of events) {
|
|
28
|
+
if (event.type === 'error')
|
|
29
|
+
failed(event.message);
|
|
30
|
+
if (event.type === 'response.failed' || event.type === 'response.incomplete' || event.type === 'response.completed') {
|
|
31
|
+
validateHuggingFaceResponse(event.response);
|
|
32
|
+
completed = true;
|
|
33
|
+
}
|
|
34
|
+
yield event;
|
|
35
|
+
}
|
|
36
|
+
if (!completed)
|
|
37
|
+
throw createAIExecutionFailure('llm_response_incomplete');
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=HuggingFaceResponses.js.map
|
package/build/src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HuggingFaceResponses.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/huggingface/HuggingFaceResponses.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oDAAoD,CAAC;AAElH,MAAM,UAAU,kBAAkB,CAAC,OAAmD;IACpF,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IACtE,OAAO;QACL,GAAG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QACpD,WAAW,EAAE,KAAK,EAAE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,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,IAAI,CAAC,SAAS;QAAE,MAAM,wBAAwB,CAAC,yBAAyB,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaLLMProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MetaLLMProvider.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACZ,MAAM,mDAAmD,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAO/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,mEAAmE,CAAC;AAElH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAUnG,qBACa,eAAgB,SAAQ,eAAe;IASf,OAAO,CAAC,QAAQ,CAAC,MAAM;IAExD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAExB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAhB9B,QAAQ,CAAC,EAAE,UAAU;IAErB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IACzD,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG,IAAI;gBAK5B,MAAM,EAAE,aAAa,EAEtD,SAAS,EAAE,yBAAyB,EAEpC,OAAO,EAAE,yBAAyB,EAElC,MAAM,EAAE,+BAA+B,EAEvC,WAAW,EAAE,6BAA6B;IAKvD,SAAS;IAOf,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAI/B,OAAO;IA8Cf,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IAoB7D,iBAAiB,CACtB,OAAO,EAAE,kBAAkB,GAC1B,cAAc,CAAC,iBAAiB,CAAC;IAmB7B,iBAAiB,CACtB,OAAO,EAAE,kBAAkB,GAC1B,cAAc,CAAC,iBAAiB,CAAC;CA2BrC"}
|
|
@@ -10,11 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
|
-
import {
|
|
14
|
-
import { PortableContextAdapter, CONTEXT_SUMMARY_INSTRUCTIONS } from '../../context/PortableContextAdapter.js';
|
|
15
|
-
import { responsesContextCodec } from '../../context/codecs/PortableContextCodecs.js';
|
|
16
|
-
import { estimateResponsesRequestTokens } from '../../context/counting/ResponsesContextTokenEstimator.js';
|
|
17
|
-
import { responseUsage } from '../../../../services/chat/ProviderRequestUsage.js';
|
|
13
|
+
import { createPortableResponsesContext } from '../openai/responses/createPortableResponsesContext.js';
|
|
18
14
|
import { inject, injectable } from 'inversify';
|
|
19
15
|
import { ConfigService } from '@gaia-framework/config';
|
|
20
16
|
import CoreTypes from '../../../../di/types.js';
|
|
@@ -87,31 +83,7 @@ let MetaLLMProvider = class MetaLLMProvider extends BaseLLMProvider {
|
|
|
87
83
|
maxRetries: 0,
|
|
88
84
|
logLevel: 'off',
|
|
89
85
|
};
|
|
90
|
-
const
|
|
91
|
-
countTokens: items => Promise.resolve(estimateResponsesRequestTokens({ model: options.model, input: [...items], instructions: input.instructions ?? '' })),
|
|
92
|
-
countSummaryTokens: history => Promise.resolve(estimateResponsesRequestTokens({ model: options.model, input: [...history], instructions: CONTEXT_SUMMARY_INSTRUCTIONS })),
|
|
93
|
-
summarize: async (history, maxTokens, signal) => {
|
|
94
|
-
const settle = await reserveContextSummary(maxTokens, options.toolExecutionContext);
|
|
95
|
-
const result = await this.responses.getResponse({
|
|
96
|
-
...params,
|
|
97
|
-
messages: [...history],
|
|
98
|
-
instructions: CONTEXT_SUMMARY_INSTRUCTIONS,
|
|
99
|
-
tools: [],
|
|
100
|
-
settings: { ...options.settings, maxTokens },
|
|
101
|
-
toolExecutionContext: undefined,
|
|
102
|
-
runId: undefined,
|
|
103
|
-
approvalResumeCheckpoint: undefined,
|
|
104
|
-
}, { ...transport, signal }, metaModelInfo);
|
|
105
|
-
if (result.kind !== 'completed')
|
|
106
|
-
throw new Error('Meta context summary requires a completed response.');
|
|
107
|
-
await settle?.(responseUsage(result.response.usage));
|
|
108
|
-
return result.response.output.flatMap(item => item.type === 'message'
|
|
109
|
-
? item.content.flatMap(part => part.type === 'output_text' ? [part.text] : []) : []).join('');
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
const contextAdapter = options.toolExecutionContext?.executionSession
|
|
113
|
-
? Object.assign(portable, { continuationIdentity: this.responses.getContinuationIdentity(info.providerModel, transport) })
|
|
114
|
-
: portable;
|
|
86
|
+
const contextAdapter = createPortableResponsesContext(this.responses, params, transport, metaModelInfo, info);
|
|
115
87
|
return { params, transport: { ...transport, contextAdapter } };
|
|
116
88
|
}
|
|
117
89
|
async getResponse(options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaLLMProvider.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MetaLLMProvider.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/meta/MetaLLMProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAMhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,mEAAmE,CAAC;AAClH,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EACL,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAGlB,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,eAAe;IASE;IAEjC;IAEA;IAEA;IAEA;IAhBV,EAAE,GAAG,MAAM,CAAC;IAErB,gCAAgC,CAAC,MAAc,IAAa,OAAO,IAAI,CAAC,CAAC,CAAC;IAC1E,gBAAgB,CAAC,KAAa,EAAE,QAAyC;QACvE,oBA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BACE,GAAG,SAAS;gBACZ,cAAc,EAAE,OAAO,CAAC,oBAAoB,EAAE,gBAAgB;oBAC5D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS;aACzC,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,qBAAqB,IAAI,KAAK,YAAY,qBAAqB;gBAAE,MAAM,KAAK,CAAC;YAElG,MAAM,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF,CAAA;AArJY,eAAe;IAD3B,UAAU,EAAE;IAUR,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAC/B,WAAA,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;IAE3C,WAAA,MAAM,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;IAE3C,WAAA,MAAM,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAA;IAEjD,WAAA,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,CAAA;qCAPiB,aAAa;QAE3C,yBAAyB;QAE3B,yBAAyB;QAE1B,+BAA+B;QAE1B,6BAA6B;GAjBlD,eAAe,CAqJ3B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LLMInfo } from "../../../../../domain/models/llms/LLMInfo.js";
|
|
2
|
+
export declare class NvidiaCatalog {
|
|
3
|
+
private models;
|
|
4
|
+
private refreshAfter;
|
|
5
|
+
private loading?;
|
|
6
|
+
list(): Promise<ReadonlyMap<string, LLMInfo>>;
|
|
7
|
+
private refresh;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=NvidiaCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NvidiaCatalog.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AA2C5E,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,OAAO,CAAC,CAAgB;IAE1B,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAQrC,OAAO;CA+BtB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const builtIn = new Map([
|
|
3
|
+
["nvidia/nemotron-3.5-lightning-30b-a3b", "Nemotron 3.5 Lightning"],
|
|
4
|
+
["nvidia/nemotron-3.5-bolt-e4b", "Nemotron 3.5 Bolt"],
|
|
5
|
+
["nvidia/nemotron-3.5-super-vl-120b-a12b", "Nemotron 3.5 Super VL"],
|
|
6
|
+
]);
|
|
7
|
+
// Most hosted entries omit model_type, including embeddings and safety classifiers.
|
|
8
|
+
// Only these verified chat routes can be recognized from their ID alone.
|
|
9
|
+
const knownChat = new Map([
|
|
10
|
+
["nvidia/nemotron-3-ultra-550b-a55b", "Nemotron 3 Ultra"],
|
|
11
|
+
["nvidia/nemotron-3-nano-omni-30b-a3b-reasoning", "Nemotron 3 Nano Omni"],
|
|
12
|
+
["minimaxai/minimax-m3.1-flash", "MiniMax M3.1 Flash"],
|
|
13
|
+
["moonshotai/kimi-k3.1-pro", "Kimi K3.1 Pro"],
|
|
14
|
+
["z-ai/glm-5.3-flash", "GLM 5.3 Flash"],
|
|
15
|
+
["mistralai/mistral-large-4-1t-a52b", "Mistral Large 4"],
|
|
16
|
+
["poolside/laguna-xs-2.1", "Laguna XS 2.1"],
|
|
17
|
+
["stepfun-ai/step-5-preview", "Step 5 Preview"],
|
|
18
|
+
["thinkingmachines/inkling-2-small", "Inkling 2 Small"],
|
|
19
|
+
]);
|
|
20
|
+
const envelope = z.object({ data: z.array(z.unknown()) });
|
|
21
|
+
const entry = z.object({
|
|
22
|
+
id: z.string().regex(/^[\w.-]+\/[\w.-]+$/),
|
|
23
|
+
model_type: z.string().optional(),
|
|
24
|
+
supports_tools: z.boolean().optional(),
|
|
25
|
+
context_window: z.number().int().positive().optional(),
|
|
26
|
+
});
|
|
27
|
+
function modelInfo(providerModel, displayName) {
|
|
28
|
+
return {
|
|
29
|
+
id: "nvidia/" + providerModel, providerModel, displayName, provider: "Nvidia", type: "llm",
|
|
30
|
+
supportsTools: true, defaultSettings: { maxTokens: 1024, temperature: 0.2 },
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function defaults() {
|
|
34
|
+
return new Map(Array.from(builtIn, ([id, name]) => {
|
|
35
|
+
const model = modelInfo(id, name);
|
|
36
|
+
return [model.id, model];
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
export class NvidiaCatalog {
|
|
40
|
+
models = defaults();
|
|
41
|
+
refreshAfter = 0;
|
|
42
|
+
loading;
|
|
43
|
+
async list() {
|
|
44
|
+
if (Date.now() >= this.refreshAfter) {
|
|
45
|
+
this.loading ??= this.refresh().finally(() => { this.loading = undefined; });
|
|
46
|
+
await this.loading;
|
|
47
|
+
}
|
|
48
|
+
return this.models;
|
|
49
|
+
}
|
|
50
|
+
async refresh() {
|
|
51
|
+
try {
|
|
52
|
+
const res = await fetch("https://integrate.api.nvidia.com/v1/models", {
|
|
53
|
+
headers: { Accept: "application/json" }, signal: AbortSignal.timeout(5000), redirect: "error",
|
|
54
|
+
});
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
await res.body?.cancel();
|
|
57
|
+
throw new Error("NVIDIA catalog unavailable");
|
|
58
|
+
}
|
|
59
|
+
const rows = envelope.parse(await res.json()).data;
|
|
60
|
+
const models = defaults();
|
|
61
|
+
for (const raw of rows) {
|
|
62
|
+
const parsed = entry.safeParse(raw);
|
|
63
|
+
if (!parsed.success)
|
|
64
|
+
continue;
|
|
65
|
+
const row = parsed.data;
|
|
66
|
+
const name = builtIn.get(row.id) ?? knownChat.get(row.id);
|
|
67
|
+
const typedChat = row.model_type === "llm" || row.model_type === "vlm";
|
|
68
|
+
if (row.model_type ? !typedChat : !name)
|
|
69
|
+
continue;
|
|
70
|
+
if (!name && row.supports_tools !== true)
|
|
71
|
+
continue;
|
|
72
|
+
const model = modelInfo(row.id, name ?? row.id);
|
|
73
|
+
model.supportsTools = row.supports_tools ?? true;
|
|
74
|
+
if (row.context_window)
|
|
75
|
+
model.maxContextLength = row.context_window;
|
|
76
|
+
models.set(model.id, model);
|
|
77
|
+
}
|
|
78
|
+
this.models = models;
|
|
79
|
+
this.refreshAfter = Date.now() + 5 * 60_000;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Keep the last successful catalog (or the three built-ins on cold start).
|
|
83
|
+
this.refreshAfter = Date.now() + 30_000;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=NvidiaCatalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NvidiaCatalog.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/nvidia/NvidiaCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;IACtB,CAAC,uCAAuC,EAAE,wBAAwB,CAAC;IACnE,CAAC,8BAA8B,EAAE,mBAAmB,CAAC;IACrD,CAAC,wCAAwC,EAAE,uBAAuB,CAAC;CACpE,CAAC,CAAC;AAEH,oFAAoF;AACpF,yEAAyE;AACzE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACxB,CAAC,mCAAmC,EAAE,kBAAkB,CAAC;IACzD,CAAC,+CAA+C,EAAE,sBAAsB,CAAC;IACzE,CAAC,8BAA8B,EAAE,oBAAoB,CAAC;IACtD,CAAC,0BAA0B,EAAE,eAAe,CAAC;IAC7C,CAAC,oBAAoB,EAAE,eAAe,CAAC;IACv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GAAG,GAAG,MAAM,CAAC,IAAI,CAAC;gBACxB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAC1D,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,KAAK,KAAK,IAAI,GAAG,CAAC,UAAU,KAAK,KAAK,CAAC;gBACvE,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;oBAAE,SAAS;gBAClD,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,cAAc,KAAK,IAAI;oBAAE,SAAS;gBACnD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC;gBAChD,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC;gBACjD,IAAI,GAAG,CAAC,cAAc;oBAAE,KAAK,CAAC,gBAAgB,GAAG,GAAG,CAAC,cAAc,CAAC;gBACpE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YAC9B,CAAC;YACD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;YACrB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,2EAA2E;YAC3E,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;QAC1C,CAAC;IACH,CAAC;CACF"}
|
|
@@ -8,11 +8,11 @@ import { GaiaChatCompletionProviderMessage } from "../../../../models/chat/compl
|
|
|
8
8
|
export declare class NvidiaService {
|
|
9
9
|
private readonly configService;
|
|
10
10
|
private readonly toolProcessor?;
|
|
11
|
-
private readonly
|
|
11
|
+
private readonly catalog;
|
|
12
12
|
private readonly endpoint;
|
|
13
13
|
constructor(configService: ConfigService, toolProcessor?: ToolProcessor | undefined);
|
|
14
14
|
getChatCompletion(messages: readonly GaiaChatCompletionProviderMessage[], model: string, tools?: readonly ToolReference[] | null, settings?: LLMSettings | null, abortSignal?: AbortSignal | null): Promise<ChatCompletion>;
|
|
15
|
-
getModels(filter?: string): LLMInfo[]
|
|
15
|
+
getModels(filter?: string): Promise<LLMInfo[]>;
|
|
16
16
|
isValidModel(model: string): Promise<boolean>;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=NvidiaService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NvidiaService.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAIvE,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AACvF,OAAO,EAAE,iCAAiC,EAAE,MAAM,uEAAuE,CAAC;AAG1H,qBACa,aAAa;IAMW,OAAO,CAAC,QAAQ,CAAC,aAAa;IAClB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAN9E,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"NvidiaService.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAIvE,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAC;AACvF,OAAO,EAAE,iCAAiC,EAAE,MAAM,uEAAuE,CAAC;AAG1H,qBACa,aAAa;IAMW,OAAO,CAAC,QAAQ,CAAC,aAAa;IAClB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAN9E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAE/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkE;gBAGvC,aAAa,EAAE,aAAa,EAChB,aAAa,CAAC,EAAE,aAAa,YAAA;IAGvF,iBAAiB,CACrB,QAAQ,EAAE,SAAS,iCAAiC,EAAE,EACtD,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,SAAS,aAAa,EAAE,GAAG,IAAI,EACvC,QAAQ,CAAC,EAAE,WAAW,GAAG,IAAI,EAC7B,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAC/B,OAAO,CAAC,cAAc,CAAC;IAiCpB,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAK9C,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGpD"}
|
|
@@ -12,25 +12,24 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { ToolProcessor } from '../../../tools/processing/ToolProcessor.js';
|
|
14
14
|
import { ConfigService } from "@gaia-framework/config";
|
|
15
|
-
import {
|
|
15
|
+
import { NvidiaCatalog } from "./NvidiaCatalog.js";
|
|
16
16
|
import { injectable, inject, optional } from "inversify";
|
|
17
17
|
import CoreTypes from "../../../../di/types.js";
|
|
18
18
|
import { readFetchChatCompletionResponse } from "../../../../models/chat/completions/FetchChatCompletionResponse.js";
|
|
19
19
|
let NvidiaService = class NvidiaService {
|
|
20
20
|
configService;
|
|
21
21
|
toolProcessor;
|
|
22
|
-
|
|
22
|
+
catalog = new NvidiaCatalog();
|
|
23
23
|
endpoint = "https://integrate.api.nvidia.com/v1/chat/completions";
|
|
24
24
|
constructor(configService, toolProcessor) {
|
|
25
25
|
this.configService = configService;
|
|
26
26
|
this.toolProcessor = toolProcessor;
|
|
27
|
-
this.modelMap = new Map(nvidiaModelInfo.map(model => [model.id, model]));
|
|
28
27
|
}
|
|
29
28
|
async getChatCompletion(messages, model, tools, settings, abortSignal) {
|
|
30
29
|
if (tools?.length && !this.toolProcessor)
|
|
31
30
|
throw new Error('Tool schema processing is unavailable.');
|
|
32
31
|
const toolSchemas = tools?.length ? this.toolProcessor.toTools(tools) : undefined;
|
|
33
|
-
const modelInfo = this.
|
|
32
|
+
const modelInfo = (await this.catalog.list()).get(model);
|
|
34
33
|
if (!modelInfo) {
|
|
35
34
|
throw new Error(`Model ${model} not found`);
|
|
36
35
|
}
|
|
@@ -54,14 +53,12 @@ let NvidiaService = class NvidiaService {
|
|
|
54
53
|
};
|
|
55
54
|
return readFetchChatCompletionResponse(await fetch(this.endpoint, options));
|
|
56
55
|
}
|
|
57
|
-
getModels(filter) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
return nvidiaModelInfo;
|
|
56
|
+
async getModels(filter) {
|
|
57
|
+
const models = Array.from((await this.catalog.list()).values());
|
|
58
|
+
return filter ? models.filter(model => model.id.toLowerCase().startsWith(filter.toLowerCase())) : models;
|
|
62
59
|
}
|
|
63
60
|
async isValidModel(model) {
|
|
64
|
-
return this.
|
|
61
|
+
return model.startsWith("nvidia/") && (await this.catalog.list()).has(model);
|
|
65
62
|
}
|
|
66
63
|
};
|
|
67
64
|
NvidiaService = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NvidiaService.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NvidiaService.js","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/nvidia/NvidiaService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAKhD,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AAG9G,IAAM,aAAa,GAAnB,MAAM,aAAa;IAM4B;IACY;IAN/C,OAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IAE9B,QAAQ,GAAW,sDAAsD,CAAC;IAE3F,YACoD,aAA4B,EAChB,aAA6B;QADzC,kBAAa,GAAb,aAAa,CAAe;QAChB,kBAAa,GAAb,aAAa,CAAgB;IAC1F,CAAC;IAEJ,KAAK,CAAC,iBAAiB,CACrB,QAAsD,EACtD,KAAa,EACb,KAAuC,EACvC,QAA6B,EAC7B,WAAgC;QAEhC,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAEpG,MAAM,WAAW,GAAG,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,aAAc,CAAC,OAAO,CAAC,KAA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,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC3G,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAa;QAC9B,OAAO,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;CACF,CAAA;AAzDY,aAAa;IADzB,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAC/B,WAAA,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;IAAE,WAAA,QAAQ,EAAE,CAAA;qCADqB,aAAa;QACA,aAAa;GAPlF,aAAa,CAyDzB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PortableContextAdapter } from '../../../context/PortableContextAdapter.js';
|
|
2
|
+
import type { OpenAIResponsesApiService } from './OpenAIResponsesApiService.js';
|
|
3
|
+
import type { LLMInfo } from '../../../../../../domain/models/llms/LLMInfo.js';
|
|
4
|
+
export declare function createPortableResponsesContext(responses: OpenAIResponsesApiService, params: Parameters<OpenAIResponsesApiService['getResponse']>[0], transport: NonNullable<Parameters<OpenAIResponsesApiService['getResponse']>[1]>, models: LLMInfo[], info: LLMInfo): PortableContextAdapter<import("openai/resources/responses/responses.js").ResponseInputItem>;
|
|
5
|
+
//# sourceMappingURL=createPortableResponsesContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPortableResponsesContext.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAgC,MAAM,4CAA4C,CAAC;AAIlH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iDAAiD,CAAC;AAE/E,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,yBAAyB,EACpC,MAAM,EAAE,UAAU,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAC/D,SAAS,EAAE,WAAW,CAAC,UAAU,CAAC,yBAAyB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC/E,MAAM,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,+FA+BjC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { reserveContextSummary } from '../../../execution/ModelRequestPolicy.js';
|
|
2
|
+
import { PortableContextAdapter, CONTEXT_SUMMARY_INSTRUCTIONS } from '../../../context/PortableContextAdapter.js';
|
|
3
|
+
import { responsesContextCodec } from '../../../context/codecs/PortableContextCodecs.js';
|
|
4
|
+
import { estimateResponsesRequestTokens } from '../../../context/counting/ResponsesContextTokenEstimator.js';
|
|
5
|
+
import { responseUsage } from '../../../../../services/chat/ProviderRequestUsage.js';
|
|
6
|
+
export function createPortableResponsesContext(responses, params, transport, models, info) {
|
|
7
|
+
const portable = new PortableContextAdapter(info.maxContextLength, params.settings?.maxTokens ?? 8192, responsesContextCodec, {
|
|
8
|
+
countTokens: items => Promise.resolve(estimateResponsesRequestTokens({ model: params.model, input: [...items], instructions: params.instructions ?? '' })),
|
|
9
|
+
countSummaryTokens: history => Promise.resolve(estimateResponsesRequestTokens({ model: params.model, input: [...history], instructions: CONTEXT_SUMMARY_INSTRUCTIONS })),
|
|
10
|
+
summarize: async (history, maxTokens, signal) => {
|
|
11
|
+
const settle = await reserveContextSummary(maxTokens, params.toolExecutionContext);
|
|
12
|
+
const result = await responses.getResponse({
|
|
13
|
+
...params,
|
|
14
|
+
messages: [...history],
|
|
15
|
+
instructions: CONTEXT_SUMMARY_INSTRUCTIONS,
|
|
16
|
+
tools: [],
|
|
17
|
+
settings: { ...params.settings, maxTokens },
|
|
18
|
+
toolExecutionContext: undefined,
|
|
19
|
+
runId: undefined,
|
|
20
|
+
approvalResumeCheckpoint: undefined,
|
|
21
|
+
}, { ...transport, signal }, models);
|
|
22
|
+
if (result.kind !== 'completed')
|
|
23
|
+
throw new Error('Provider context summary requires a completed response.');
|
|
24
|
+
await settle?.(responseUsage(result.response.usage));
|
|
25
|
+
return result.response.output.flatMap(item => item.type === 'message'
|
|
26
|
+
? item.content.flatMap(part => part.type === 'output_text' ? [part.text] : []) : []).join('');
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
return params.toolExecutionContext?.executionSession
|
|
30
|
+
? Object.assign(portable, { continuationIdentity: responses.getContinuationIdentity(info.providerModel, transport) })
|
|
31
|
+
: portable;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=createPortableResponsesContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPortableResponsesContext.js","sourceRoot":"","sources":["../../../../../../../../../src/core/infrastructure/ai/llm/providers/openai/responses/createPortableResponsesContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAClH,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,6DAA6D,CAAC;AAC7G,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AAIrF,MAAM,UAAU,8BAA8B,CAC5C,SAAoC,EACpC,MAA+D,EAC/D,SAA+E,EAC/E,MAAiB,EAAE,IAAa;IAEhC,MAAM,QAAQ,GAAG,IAAI,sBAAsB,CAAC,IAAI,CAAC,gBAAgB,EAC/D,MAAM,CAAC,QAAQ,EAAE,SAAS,IAAI,IAAI,EAAE,qBAAqB,E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AAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;gBACnE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClG,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,oBAAoB,EAAE,gBAAgB;QAClD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,SAAS,CAAC,uBAAuB,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,CAAC;QACrH,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ConfigService } from '@gaia-framework/config';
|
|
2
|
+
import type { LLMInfo } from '../../../../../domain/models/llms/LLMInfo.js';
|
|
3
|
+
export declare const TOGETHER_BASE_URL = "https://api.together.ai/v1";
|
|
4
|
+
export declare const TOGETHER_LLM_CONFIG = "ai.llm.providers.togetherai";
|
|
5
|
+
export declare class TogetherCatalog {
|
|
6
|
+
private readonly config;
|
|
7
|
+
private cached?;
|
|
8
|
+
private loading?;
|
|
9
|
+
constructor(config: ConfigService);
|
|
10
|
+
getModels(): Promise<LLMInfo[]>;
|
|
11
|
+
private load;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=TogetherCatalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TogetherCatalog.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/infrastructure/ai/llm/providers/togetherai/TogetherCatalog.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8CAA8C,CAAC;AAG5E,eAAO,MAAM,iBAAiB,+BAA+B,CAAC;AAC9D,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AAiBjE,qBACa,eAAe;IAImB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHpE,OAAO,CAAC,MAAM,CAAC,CAAyC;IACxD,OAAO,CAAC,OAAO,CAAC,CAAqB;gBAEyB,MAAM,EAAE,aAAa;IAE7E,SAAS,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAQvB,IAAI;CAmCnB"}
|