@mate-academy/llm-gateway 8.8.2 → 8.8.3
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/dist/LLMError.d.ts +12 -0
- package/dist/LLMError.js +36 -0
- package/dist/LLMError.js.map +1 -0
- package/dist/LLMGateway.d.ts +30 -0
- package/dist/LLMGateway.js +56 -0
- package/dist/LLMGateway.js.map +1 -0
- package/dist/LLMGateway.typedefs.d.ts +5 -0
- package/dist/LLMGateway.typedefs.js +3 -0
- package/dist/LLMGateway.typedefs.js.map +1 -0
- package/dist/LLMService.constants.d.ts +26309 -0
- package/dist/LLMService.constants.js +35 -0
- package/dist/LLMService.constants.js.map +1 -0
- package/dist/LLMService.factory.d.ts +71 -0
- package/dist/LLMService.factory.js +102 -0
- package/dist/LLMService.factory.js.map +1 -0
- package/dist/LLMService.typedefs.d.ts +655 -0
- package/dist/LLMService.typedefs.js +72 -0
- package/dist/LLMService.typedefs.js.map +1 -0
- package/dist/advanced.d.ts +11 -0
- package/dist/advanced.js +32 -0
- package/dist/advanced.js.map +1 -0
- package/dist/client/LLMAgent.d.ts +76 -0
- package/dist/client/LLMAgent.js +36 -0
- package/dist/client/LLMAgent.js.map +1 -0
- package/dist/client/LLMClientEngine.d.ts +110 -0
- package/dist/client/LLMClientEngine.js +406 -0
- package/dist/client/LLMClientEngine.js.map +1 -0
- package/dist/client/agentRun.typedefs.d.ts +200 -0
- package/dist/client/agentRun.typedefs.js +25 -0
- package/dist/client/agentRun.typedefs.js.map +1 -0
- package/dist/client/agentRunner.d.ts +161 -0
- package/dist/client/agentRunner.js +517 -0
- package/dist/client/agentRunner.js.map +1 -0
- package/dist/client/codegen/fetchPromptRecords.d.ts +14 -0
- package/dist/client/codegen/fetchPromptRecords.js +90 -0
- package/dist/client/codegen/fetchPromptRecords.js.map +1 -0
- package/dist/client/codegen/generateSnapshot.d.ts +19 -0
- package/dist/client/codegen/generateSnapshot.js +28 -0
- package/dist/client/codegen/generateSnapshot.js.map +1 -0
- package/dist/client/codegen/index.d.ts +6 -0
- package/dist/client/codegen/index.js +23 -0
- package/dist/client/codegen/index.js.map +1 -0
- package/dist/client/codegen/promptCatalog.typedefs.d.ts +51 -0
- package/dist/client/codegen/promptCatalog.typedefs.js +3 -0
- package/dist/client/codegen/promptCatalog.typedefs.js.map +1 -0
- package/dist/client/codegen/promptName.d.ts +8 -0
- package/dist/client/codegen/promptName.js +21 -0
- package/dist/client/codegen/promptName.js.map +1 -0
- package/dist/client/codegen/renderSnapshot.constants.d.ts +7 -0
- package/dist/client/codegen/renderSnapshot.constants.js +16 -0
- package/dist/client/codegen/renderSnapshot.constants.js.map +1 -0
- package/dist/client/codegen/renderSnapshot.d.ts +9 -0
- package/dist/client/codegen/renderSnapshot.js +109 -0
- package/dist/client/codegen/renderSnapshot.js.map +1 -0
- package/dist/client/codegen/renderSnapshot.typedefs.d.ts +19 -0
- package/dist/client/codegen/renderSnapshot.typedefs.js +3 -0
- package/dist/client/codegen/renderSnapshot.typedefs.js.map +1 -0
- package/dist/client/coerceToolResult.d.ts +10 -0
- package/dist/client/coerceToolResult.js +38 -0
- package/dist/client/coerceToolResult.js.map +1 -0
- package/dist/client/createLLMClient.d.ts +10 -0
- package/dist/client/createLLMClient.js +47 -0
- package/dist/client/createLLMClient.js.map +1 -0
- package/dist/client/defineLLMPrompts.d.ts +34 -0
- package/dist/client/defineLLMPrompts.js +13 -0
- package/dist/client/defineLLMPrompts.js.map +1 -0
- package/dist/client/errors.d.ts +57 -0
- package/dist/client/errors.js +70 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/index.d.ts +13 -0
- package/dist/client/index.js +30 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/llmClient.typedefs.d.ts +265 -0
- package/dist/client/llmClient.typedefs.js +11 -0
- package/dist/client/llmClient.typedefs.js.map +1 -0
- package/dist/client/llmConfig.schema.d.ts +53 -0
- package/dist/client/llmConfig.schema.js +49 -0
- package/dist/client/llmConfig.schema.js.map +1 -0
- package/dist/client/plainMessages.d.ts +12 -0
- package/dist/client/plainMessages.js +19 -0
- package/dist/client/plainMessages.js.map +1 -0
- package/dist/client/promptClientPort.typedefs.d.ts +60 -0
- package/dist/client/promptClientPort.typedefs.js +3 -0
- package/dist/client/promptClientPort.typedefs.js.map +1 -0
- package/dist/client/promptRegistry.runtime.d.ts +121 -0
- package/dist/client/promptRegistry.runtime.js +264 -0
- package/dist/client/promptRegistry.runtime.js.map +1 -0
- package/dist/client/promptSnapshot.typedefs.d.ts +55 -0
- package/dist/client/promptSnapshot.typedefs.js +3 -0
- package/dist/client/promptSnapshot.typedefs.js.map +1 -0
- package/dist/client/promptVariables.d.ts +7 -0
- package/dist/client/promptVariables.js +13 -0
- package/dist/client/promptVariables.js.map +1 -0
- package/dist/client/snapshotRuntime.d.ts +17 -0
- package/dist/client/snapshotRuntime.js +42 -0
- package/dist/client/snapshotRuntime.js.map +1 -0
- package/dist/client/snapshotRuntime.typedefs.d.ts +13 -0
- package/dist/client/snapshotRuntime.typedefs.js +3 -0
- package/dist/client/snapshotRuntime.typedefs.js.map +1 -0
- package/dist/client/validationGate.d.ts +24 -0
- package/dist/client/validationGate.js +54 -0
- package/dist/client/validationGate.js.map +1 -0
- package/dist/codegen.d.ts +6 -0
- package/dist/codegen.js +23 -0
- package/dist/codegen.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.d.ts +873 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.js +269 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.constants.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.entity.d.ts +24 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.entity.js +210 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.entity.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.typedefs.d.ts +22 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.typedefs.js +20 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAI.typedefs.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAIService.factory.d.ts +6 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAIService.factory.js +18 -0
- package/dist/providers/GoogleGenerativeAI/GoogleGenerativeAIService.factory.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/index.d.ts +5 -0
- package/dist/providers/GoogleGenerativeAI/index.js +22 -0
- package/dist/providers/GoogleGenerativeAI/index.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/schemas/GoogleSchemaAdapter.d.ts +12 -0
- package/dist/providers/GoogleGenerativeAI/schemas/GoogleSchemaAdapter.js +72 -0
- package/dist/providers/GoogleGenerativeAI/schemas/GoogleSchemaAdapter.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.d.ts +71 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js +876 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAIAssistance.service.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAICompletion.service.d.ts +25 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAICompletion.service.js +216 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAICompletion.service.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAISpeechToText.service.d.ts +10 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAISpeechToText.service.js +136 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAISpeechToText.service.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAITextToSpeech.service.d.ts +11 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAITextToSpeech.service.js +97 -0
- package/dist/providers/GoogleGenerativeAI/services/GoogleGenerativeAITextToSpeech.service.js.map +1 -0
- package/dist/providers/GoogleGenerativeAI/services/index.d.ts +4 -0
- package/dist/providers/GoogleGenerativeAI/services/index.js +21 -0
- package/dist/providers/GoogleGenerativeAI/services/index.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.constants.d.ts +35832 -0
- package/dist/providers/LLMAPI/LLMAPI.constants.js +8601 -0
- package/dist/providers/LLMAPI/LLMAPI.constants.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.d.ts +6 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js +48 -0
- package/dist/providers/LLMAPI/LLMAPI.entity.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.d.ts +516 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.js +564 -0
- package/dist/providers/LLMAPI/LLMAPI.typedefs.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPI.voices.d.ts +376 -0
- package/dist/providers/LLMAPI/LLMAPI.voices.js +739 -0
- package/dist/providers/LLMAPI/LLMAPI.voices.js.map +1 -0
- package/dist/providers/LLMAPI/LLMAPIService.factory.d.ts +6 -0
- package/dist/providers/LLMAPI/LLMAPIService.factory.js +19 -0
- package/dist/providers/LLMAPI/LLMAPIService.factory.js.map +1 -0
- package/dist/providers/LLMAPI/index.d.ts +7 -0
- package/dist/providers/LLMAPI/index.js +24 -0
- package/dist/providers/LLMAPI/index.js.map +1 -0
- package/dist/providers/LLMAPI/schemas/LLMAPISchemaAdapter.d.ts +3 -0
- package/dist/providers/LLMAPI/schemas/LLMAPISchemaAdapter.js +8 -0
- package/dist/providers/LLMAPI/schemas/LLMAPISchemaAdapter.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.d.ts +76 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js +825 -0
- package/dist/providers/LLMAPI/services/LLMAPIAssistance.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.d.ts +25 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js +177 -0
- package/dist/providers/LLMAPI/services/LLMAPICompletion.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPISpeechToText.service.d.ts +17 -0
- package/dist/providers/LLMAPI/services/LLMAPISpeechToText.service.js +34 -0
- package/dist/providers/LLMAPI/services/LLMAPISpeechToText.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/LLMAPITextToSpeech.service.d.ts +20 -0
- package/dist/providers/LLMAPI/services/LLMAPITextToSpeech.service.js +36 -0
- package/dist/providers/LLMAPI/services/LLMAPITextToSpeech.service.js.map +1 -0
- package/dist/providers/LLMAPI/services/index.d.ts +4 -0
- package/dist/providers/LLMAPI/services/index.js +21 -0
- package/dist/providers/LLMAPI/services/index.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/index.d.ts +4 -0
- package/dist/providers/LLMAPI/utilities/index.js +13 -0
- package/dist/providers/LLMAPI/utilities/index.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/parseXmlToolCalls.d.ts +7 -0
- package/dist/providers/LLMAPI/utilities/parseXmlToolCalls.js +35 -0
- package/dist/providers/LLMAPI/utilities/parseXmlToolCalls.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/stripThinkingTags.d.ts +1 -0
- package/dist/providers/LLMAPI/utilities/stripThinkingTags.js +7 -0
- package/dist/providers/LLMAPI/utilities/stripThinkingTags.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/structuredOutput.d.ts +13 -0
- package/dist/providers/LLMAPI/utilities/structuredOutput.js +29 -0
- package/dist/providers/LLMAPI/utilities/structuredOutput.js.map +1 -0
- package/dist/providers/LLMAPI/utilities/validateStructuredResponse.d.ts +10 -0
- package/dist/providers/LLMAPI/utilities/validateStructuredResponse.js +21 -0
- package/dist/providers/LLMAPI/utilities/validateStructuredResponse.js.map +1 -0
- package/dist/providers/OpenAI/OpenAI.constants.d.ts +1664 -0
- package/dist/providers/OpenAI/OpenAI.constants.js +310 -0
- package/dist/providers/OpenAI/OpenAI.constants.js.map +1 -0
- package/dist/providers/OpenAI/OpenAI.entity.d.ts +15 -0
- package/dist/providers/OpenAI/OpenAI.entity.js +162 -0
- package/dist/providers/OpenAI/OpenAI.entity.js.map +1 -0
- package/dist/providers/OpenAI/OpenAI.typedefs.d.ts +61 -0
- package/dist/providers/OpenAI/OpenAI.typedefs.js +39 -0
- package/dist/providers/OpenAI/OpenAI.typedefs.js.map +1 -0
- package/dist/providers/OpenAI/OpenAIService.factory.d.ts +6 -0
- package/dist/providers/OpenAI/OpenAIService.factory.js +18 -0
- package/dist/providers/OpenAI/OpenAIService.factory.js.map +1 -0
- package/dist/providers/OpenAI/index.d.ts +5 -0
- package/dist/providers/OpenAI/index.js +22 -0
- package/dist/providers/OpenAI/index.js.map +1 -0
- package/dist/providers/OpenAI/schemas/OpenAISchemaAdapter.d.ts +14 -0
- package/dist/providers/OpenAI/schemas/OpenAISchemaAdapter.js +87 -0
- package/dist/providers/OpenAI/schemas/OpenAISchemaAdapter.js.map +1 -0
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.d.ts +42 -0
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js +712 -0
- package/dist/providers/OpenAI/services/OpenAIAssistance.service.js.map +1 -0
- package/dist/providers/OpenAI/services/OpenAICompletion.service.d.ts +7 -0
- package/dist/providers/OpenAI/services/OpenAICompletion.service.js +12 -0
- package/dist/providers/OpenAI/services/OpenAICompletion.service.js.map +1 -0
- package/dist/providers/OpenAI/services/OpenAISpeechToText.service.d.ts +17 -0
- package/dist/providers/OpenAI/services/OpenAISpeechToText.service.js +40 -0
- package/dist/providers/OpenAI/services/OpenAISpeechToText.service.js.map +1 -0
- package/dist/providers/OpenAI/services/OpenAITextToSpeech.service.d.ts +13 -0
- package/dist/providers/OpenAI/services/OpenAITextToSpeech.service.js +32 -0
- package/dist/providers/OpenAI/services/OpenAITextToSpeech.service.js.map +1 -0
- package/dist/providers/OpenAI/services/buildFunctionCallOutput.d.ts +3 -0
- package/dist/providers/OpenAI/services/buildFunctionCallOutput.js +19 -0
- package/dist/providers/OpenAI/services/buildFunctionCallOutput.js.map +1 -0
- package/dist/providers/OpenAI/services/index.d.ts +4 -0
- package/dist/providers/OpenAI/services/index.js +21 -0
- package/dist/providers/OpenAI/services/index.js.map +1 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.d.ts +30 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.js +233 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleCompletion.service.js.map +1 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleSpeechToText.service.d.ts +22 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleSpeechToText.service.js +98 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleSpeechToText.service.js.map +1 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleTextToSpeech.service.d.ts +22 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleTextToSpeech.service.js +67 -0
- package/dist/providers/OpenAICompatible/OpenAICompatibleTextToSpeech.service.js.map +1 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.js +20 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/services/LLMAssistanceService.abstract.d.ts +39 -0
- package/dist/services/LLMAssistanceService.abstract.js +101 -0
- package/dist/services/LLMAssistanceService.abstract.js.map +1 -0
- package/dist/services/LLMBaseService.abstract.d.ts +161 -0
- package/dist/services/LLMBaseService.abstract.js +392 -0
- package/dist/services/LLMBaseService.abstract.js.map +1 -0
- package/dist/services/LLMCompletionService.abstract.d.ts +16 -0
- package/dist/services/LLMCompletionService.abstract.js +12 -0
- package/dist/services/LLMCompletionService.abstract.js.map +1 -0
- package/dist/services/LLMServicePurposeFactory.abstract.d.ts +12 -0
- package/dist/services/LLMServicePurposeFactory.abstract.js +7 -0
- package/dist/services/LLMServicePurposeFactory.abstract.js.map +1 -0
- package/dist/services/LLMSpeechToTextService.abstract.d.ts +8 -0
- package/dist/services/LLMSpeechToTextService.abstract.js +12 -0
- package/dist/services/LLMSpeechToTextService.abstract.js.map +1 -0
- package/dist/services/LLMTextToSpeechService.abstract.d.ts +8 -0
- package/dist/services/LLMTextToSpeechService.abstract.js +12 -0
- package/dist/services/LLMTextToSpeechService.abstract.js.map +1 -0
- package/dist/services/agentRounds/LLMAgentRounds.d.ts +32 -0
- package/dist/services/agentRounds/LLMAgentRounds.js +77 -0
- package/dist/services/agentRounds/LLMAgentRounds.js.map +1 -0
- package/dist/services/agentRounds/agentRounds.typedefs.d.ts +48 -0
- package/dist/services/agentRounds/agentRounds.typedefs.js +3 -0
- package/dist/services/agentRounds/agentRounds.typedefs.js.map +1 -0
- package/dist/services/agentRounds/index.d.ts +2 -0
- package/dist/services/agentRounds/index.js +19 -0
- package/dist/services/agentRounds/index.js.map +1 -0
- package/dist/services/chatState/CompletionsChatState.d.ts +35 -0
- package/dist/services/chatState/CompletionsChatState.js +118 -0
- package/dist/services/chatState/CompletionsChatState.js.map +1 -0
- package/dist/services/chatState/index.d.ts +1 -0
- package/dist/services/chatState/index.js +6 -0
- package/dist/services/chatState/index.js.map +1 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.d.ts +15 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.js +172 -0
- package/dist/services/fileStorage/FileStorageToolExecutor.js.map +1 -0
- package/dist/services/fileStorage/InMemoryFileStorage.d.ts +20 -0
- package/dist/services/fileStorage/InMemoryFileStorage.js +67 -0
- package/dist/services/fileStorage/InMemoryFileStorage.js.map +1 -0
- package/dist/services/fileStorage/fileStorageTools.d.ts +26 -0
- package/dist/services/fileStorage/fileStorageTools.js +68 -0
- package/dist/services/fileStorage/fileStorageTools.js.map +1 -0
- package/dist/services/fileStorage/index.d.ts +4 -0
- package/dist/services/fileStorage/index.js +11 -0
- package/dist/services/fileStorage/index.js.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.js +24 -0
- package/dist/services/index.js.map +1 -0
- package/dist/utilities/calculateCosts.d.ts +4 -0
- package/dist/utilities/calculateCosts.js +56 -0
- package/dist/utilities/calculateCosts.js.map +1 -0
- package/dist/utilities/functional.utils.d.ts +1 -0
- package/dist/utilities/functional.utils.js +9 -0
- package/dist/utilities/functional.utils.js.map +1 -0
- package/dist/utilities/index.d.ts +9 -0
- package/dist/utilities/index.js +26 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/llmTracing/index.d.ts +3 -0
- package/dist/utilities/llmTracing/index.js +20 -0
- package/dist/utilities/llmTracing/index.js.map +1 -0
- package/dist/utilities/llmTracing/llmTracing.constants.d.ts +7 -0
- package/dist/utilities/llmTracing/llmTracing.constants.js +11 -0
- package/dist/utilities/llmTracing/llmTracing.constants.js.map +1 -0
- package/dist/utilities/llmTracing/llmTracing.typedefs.d.ts +126 -0
- package/dist/utilities/llmTracing/llmTracing.typedefs.js +3 -0
- package/dist/utilities/llmTracing/llmTracing.typedefs.js.map +1 -0
- package/dist/utilities/llmTracing/noopLLMTracing.d.ts +3 -0
- package/dist/utilities/llmTracing/noopLLMTracing.js +36 -0
- package/dist/utilities/llmTracing/noopLLMTracing.js.map +1 -0
- package/dist/utilities/logger/LLMLoggerInterface.d.ts +36 -0
- package/dist/utilities/logger/LLMLoggerInterface.js +3 -0
- package/dist/utilities/logger/LLMLoggerInterface.js.map +1 -0
- package/dist/utilities/logger/index.d.ts +1 -0
- package/dist/utilities/logger/index.js +18 -0
- package/dist/utilities/logger/index.js.map +1 -0
- package/dist/utilities/promptBuilder.d.ts +58 -0
- package/dist/utilities/promptBuilder.js +92 -0
- package/dist/utilities/promptBuilder.js.map +1 -0
- package/dist/utilities/reporter/LLMReporterInterface.d.ts +46 -0
- package/dist/utilities/reporter/LLMReporterInterface.js +3 -0
- package/dist/utilities/reporter/LLMReporterInterface.js.map +1 -0
- package/dist/utilities/reporter/index.d.ts +1 -0
- package/dist/utilities/reporter/index.js +18 -0
- package/dist/utilities/reporter/index.js.map +1 -0
- package/dist/utilities/schema/LLMSchema.d.ts +112 -0
- package/dist/utilities/schema/LLMSchema.js +223 -0
- package/dist/utilities/schema/LLMSchema.js.map +1 -0
- package/dist/utilities/schema/LLMSchema.typedefs.d.ts +55 -0
- package/dist/utilities/schema/LLMSchema.typedefs.js +3 -0
- package/dist/utilities/schema/LLMSchema.typedefs.js.map +1 -0
- package/dist/utilities/schema/SchemaAdapterRegistry.d.ts +26 -0
- package/dist/utilities/schema/SchemaAdapterRegistry.js +32 -0
- package/dist/utilities/schema/SchemaAdapterRegistry.js.map +1 -0
- package/dist/utilities/schema/index.d.ts +2 -0
- package/dist/utilities/schema/index.js +19 -0
- package/dist/utilities/schema/index.js.map +1 -0
- package/dist/utilities/serializeError.d.ts +9 -0
- package/dist/utilities/serializeError.js +69 -0
- package/dist/utilities/serializeError.js.map +1 -0
- package/dist/utilities/tokenizer.d.ts +4 -0
- package/dist/utilities/tokenizer.js +14 -0
- package/dist/utilities/tokenizer.js.map +1 -0
- package/dist/utilities/tools/LLMTool.d.ts +5 -0
- package/dist/utilities/tools/LLMTool.js +10 -0
- package/dist/utilities/tools/LLMTool.js.map +1 -0
- package/dist/utilities/tools/index.d.ts +2 -0
- package/dist/utilities/tools/index.js +8 -0
- package/dist/utilities/tools/index.js.map +1 -0
- package/dist/utilities/tools/normalizeToolResult.d.ts +15 -0
- package/dist/utilities/tools/normalizeToolResult.js +18 -0
- package/dist/utilities/tools/normalizeToolResult.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLLMClient.js","sourceRoot":"","sources":["../../src/client/createLLMClient.ts"],"names":[],"mappings":";;AAkBA,0CA2CC;AA5DD,8DAA2D;AAC3D,4EAAwE;AACxE,oEAMqC;AAErC;;;;;;GAMG;AACH,SAAgB,eAAe,CAK7B,MAAwD;IAExD,MAAM,IAAI,GAAkB,MAAM,CAAC,IAAI,IAAI,YAAY,CAAC;IACxD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,KAAK,sCAAiB;QACtD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;IAErB,MAAM,OAAO,GAAG,IAAI,8CAAqB,CAAC;QACxC,qBAAqB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,CACrC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAC9C;QACD,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,YAAY;QACjD,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,iCAAe,CAAC;QACjC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,OAAO;QACP,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,SAAS,EAAE,QAAQ;QAC7B,oBAAoB,EAAE,SAAS,EAAE,YAAY;QAC7C,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,aAAa,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;QACnC,IAAI;QACJ,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;KAChD,CAAC,CAAC;IAEH,OAAO;QACL,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAC/D,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;QACrE,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;QAC3D,QAAQ,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;QAC7E,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC;KACtB,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type LLMSchemaInterface } from '../utilities/schema';
|
|
2
|
+
import { type LLMModelCapabilities } from '../LLMService.typedefs';
|
|
3
|
+
import { type LLMPromptKind } from '../client/promptSnapshot.typedefs';
|
|
4
|
+
/**
|
|
5
|
+
* A capability the resolved model must support for a prompt. Mirrors the boolean
|
|
6
|
+
* flags on `LLMModelCapabilities`, so the gate can check each requirement
|
|
7
|
+
* against the model map without a separate mapping.
|
|
8
|
+
*/
|
|
9
|
+
export type LLMCapabilityRequirement = keyof Pick<LLMModelCapabilities, 'vision' | 'tools' | 'reasoning' | 'webSearch' | 'jsonOutput' | 'structuredOutputs' | 'tts' | 'stt' | 'multimodalToolResults'>;
|
|
10
|
+
/**
|
|
11
|
+
* The code-owned contract for one prompt. `schema` drives structured output and
|
|
12
|
+
* the `generate` return type; `toolSchemas` carry tool name+parameter shapes for
|
|
13
|
+
* typing/capability validation (executable tools are always passed per call);
|
|
14
|
+
* `requires` lists capabilities the resolved model must satisfy; `kind`
|
|
15
|
+
* distinguishes config-only audio prompts; `variables` is the code-owned list
|
|
16
|
+
* of required input names for this prompt. The client derives each call site's
|
|
17
|
+
* `variables` type from this list, independently of the prompt body stored in
|
|
18
|
+
* Langfuse.
|
|
19
|
+
*/
|
|
20
|
+
export interface LLMPromptBinding<Schema extends LLMSchemaInterface = LLMSchemaInterface> {
|
|
21
|
+
schema?: Schema;
|
|
22
|
+
toolSchemas?: Record<string, LLMSchemaInterface>;
|
|
23
|
+
requires?: LLMCapabilityRequirement[];
|
|
24
|
+
kind?: LLMPromptKind | 'transcription' | 'speech';
|
|
25
|
+
variables?: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
export type LLMPromptRegistry = Record<string, LLMPromptBinding>;
|
|
28
|
+
/**
|
|
29
|
+
* Binds each `LLMPrompt` member (the generated enum) to its code contract. The
|
|
30
|
+
* identity return preserves the literal binding types so `createLLMClient` can
|
|
31
|
+
* infer per-prompt variables and return types from `typeof registry` — bind the
|
|
32
|
+
* registry once at the composition root, never via module augmentation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function defineLLMPrompts<const Registry extends LLMPromptRegistry>(registry: Registry): Registry;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineLLMPrompts = defineLLMPrompts;
|
|
4
|
+
/**
|
|
5
|
+
* Binds each `LLMPrompt` member (the generated enum) to its code contract. The
|
|
6
|
+
* identity return preserves the literal binding types so `createLLMClient` can
|
|
7
|
+
* infer per-prompt variables and return types from `typeof registry` — bind the
|
|
8
|
+
* registry once at the composition root, never via module augmentation.
|
|
9
|
+
*/
|
|
10
|
+
function defineLLMPrompts(registry) {
|
|
11
|
+
return registry;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=defineLLMPrompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineLLMPrompts.js","sourceRoot":"","sources":["../../src/client/defineLLMPrompts.ts"],"names":[],"mappings":";;AAkDA,4CAIC;AAVD;;;;;GAKG;AACH,SAAgB,gBAAgB,CAC9B,QAAkB;IAElB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type LLMProviders } from '../LLMService.typedefs';
|
|
2
|
+
export interface LLMGatewayErrorContext {
|
|
3
|
+
promptName: string;
|
|
4
|
+
provider?: LLMProviders;
|
|
5
|
+
model?: string;
|
|
6
|
+
cause?: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Base class for every error the v2 client throws. Carries the prompt name plus
|
|
10
|
+
* the resolved provider/model so callers can attribute a failure to one
|
|
11
|
+
* operation without inspecting the cause chain.
|
|
12
|
+
*/
|
|
13
|
+
export declare class LLMGatewayError extends Error {
|
|
14
|
+
readonly promptName: string;
|
|
15
|
+
readonly provider: LLMProviders | undefined;
|
|
16
|
+
readonly model: string | undefined;
|
|
17
|
+
constructor(message: string, context: LLMGatewayErrorContext);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Upstream provider failure. `retryable` is true when the v2 retry policy may
|
|
21
|
+
* re-attempt the request (timeouts, 5xx, rate limits); false for deterministic
|
|
22
|
+
* provider rejections (malformed request, auth).
|
|
23
|
+
*/
|
|
24
|
+
export declare class LLMProviderError extends LLMGatewayError {
|
|
25
|
+
readonly retryable: boolean;
|
|
26
|
+
readonly status: number | null;
|
|
27
|
+
constructor(message: string, context: LLMGatewayErrorContext & {
|
|
28
|
+
retryable: boolean;
|
|
29
|
+
status?: number | null;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The model returned text that failed schema validation after the internal
|
|
34
|
+
* JSON-fixer retry. `rawText` is the unparsed completion and `parseDetails`
|
|
35
|
+
* the validator message, so a caller can attempt its own recovery.
|
|
36
|
+
*/
|
|
37
|
+
export declare class LLMSchemaValidationError extends LLMGatewayError {
|
|
38
|
+
readonly rawText: string;
|
|
39
|
+
readonly parseDetails: string;
|
|
40
|
+
constructor(message: string, context: LLMGatewayErrorContext & {
|
|
41
|
+
rawText: string;
|
|
42
|
+
parseDetails: string;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The call was aborted via its `AbortSignal` before completion.
|
|
47
|
+
*/
|
|
48
|
+
export declare class LLMAbortedError extends LLMGatewayError {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Configuration could not be resolved into a usable call: live config and the
|
|
52
|
+
* fallback snapshot are both unusable, or per-call overrides were passed to a
|
|
53
|
+
* production-mode client.
|
|
54
|
+
*/
|
|
55
|
+
export declare class LLMConfigError extends LLMGatewayError {
|
|
56
|
+
}
|
|
57
|
+
export declare function isLLMGatewayError(error: unknown): error is LLMGatewayError;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LLMConfigError = exports.LLMAbortedError = exports.LLMSchemaValidationError = exports.LLMProviderError = exports.LLMGatewayError = void 0;
|
|
4
|
+
exports.isLLMGatewayError = isLLMGatewayError;
|
|
5
|
+
/**
|
|
6
|
+
* Base class for every error the v2 client throws. Carries the prompt name plus
|
|
7
|
+
* the resolved provider/model so callers can attribute a failure to one
|
|
8
|
+
* operation without inspecting the cause chain.
|
|
9
|
+
*/
|
|
10
|
+
class LLMGatewayError extends Error {
|
|
11
|
+
promptName;
|
|
12
|
+
provider;
|
|
13
|
+
model;
|
|
14
|
+
constructor(message, context) {
|
|
15
|
+
super(message, { cause: context.cause });
|
|
16
|
+
this.name = new.target.name;
|
|
17
|
+
this.promptName = context.promptName;
|
|
18
|
+
this.provider = context.provider;
|
|
19
|
+
this.model = context.model;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.LLMGatewayError = LLMGatewayError;
|
|
23
|
+
/**
|
|
24
|
+
* Upstream provider failure. `retryable` is true when the v2 retry policy may
|
|
25
|
+
* re-attempt the request (timeouts, 5xx, rate limits); false for deterministic
|
|
26
|
+
* provider rejections (malformed request, auth).
|
|
27
|
+
*/
|
|
28
|
+
class LLMProviderError extends LLMGatewayError {
|
|
29
|
+
retryable;
|
|
30
|
+
status;
|
|
31
|
+
constructor(message, context) {
|
|
32
|
+
super(message, context);
|
|
33
|
+
this.retryable = context.retryable;
|
|
34
|
+
this.status = context.status ?? null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.LLMProviderError = LLMProviderError;
|
|
38
|
+
/**
|
|
39
|
+
* The model returned text that failed schema validation after the internal
|
|
40
|
+
* JSON-fixer retry. `rawText` is the unparsed completion and `parseDetails`
|
|
41
|
+
* the validator message, so a caller can attempt its own recovery.
|
|
42
|
+
*/
|
|
43
|
+
class LLMSchemaValidationError extends LLMGatewayError {
|
|
44
|
+
rawText;
|
|
45
|
+
parseDetails;
|
|
46
|
+
constructor(message, context) {
|
|
47
|
+
super(message, context);
|
|
48
|
+
this.rawText = context.rawText;
|
|
49
|
+
this.parseDetails = context.parseDetails;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.LLMSchemaValidationError = LLMSchemaValidationError;
|
|
53
|
+
/**
|
|
54
|
+
* The call was aborted via its `AbortSignal` before completion.
|
|
55
|
+
*/
|
|
56
|
+
class LLMAbortedError extends LLMGatewayError {
|
|
57
|
+
}
|
|
58
|
+
exports.LLMAbortedError = LLMAbortedError;
|
|
59
|
+
/**
|
|
60
|
+
* Configuration could not be resolved into a usable call: live config and the
|
|
61
|
+
* fallback snapshot are both unusable, or per-call overrides were passed to a
|
|
62
|
+
* production-mode client.
|
|
63
|
+
*/
|
|
64
|
+
class LLMConfigError extends LLMGatewayError {
|
|
65
|
+
}
|
|
66
|
+
exports.LLMConfigError = LLMConfigError;
|
|
67
|
+
function isLLMGatewayError(error) {
|
|
68
|
+
return error instanceof LLMGatewayError;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/client/errors.ts"],"names":[],"mappings":";;;AAqFA,8CAEC;AA9ED;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,KAAK;IAC/B,UAAU,CAAS;IAEnB,QAAQ,CAA2B;IAEnC,KAAK,CAAqB;IAEnC,YAAY,OAAe,EAAE,OAA+B;QAC1D,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QAEzC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;CACF;AAfD,0CAeC;AAED;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,eAAe;IAC1C,SAAS,CAAU;IAEnB,MAAM,CAAgB;IAE/B,YACE,OAAe,EACf,OAAgF;QAEhF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC;IACvC,CAAC;CACF;AAdD,4CAcC;AAED;;;;GAIG;AACH,MAAa,wBAAyB,SAAQ,eAAe;IAClD,OAAO,CAAS;IAEhB,YAAY,CAAS;IAE9B,YACE,OAAe,EACf,OAA2E;QAE3E,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAExB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAC3C,CAAC;CACF;AAdD,4DAcC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAAe;CAAG;AAAvD,0CAAuD;AAEvD;;;;GAIG;AACH,MAAa,cAAe,SAAQ,eAAe;CAAG;AAAtD,wCAAsD;AAEtD,SAAgB,iBAAiB,CAAC,KAAc;IAC9C,OAAO,KAAK,YAAY,eAAe,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './errors';
|
|
2
|
+
export * from './llmConfig.schema';
|
|
3
|
+
export * from './promptSnapshot.typedefs';
|
|
4
|
+
export * from './snapshotRuntime.typedefs';
|
|
5
|
+
export * from './snapshotRuntime';
|
|
6
|
+
export * from './promptClientPort.typedefs';
|
|
7
|
+
export * from './defineLLMPrompts';
|
|
8
|
+
export * from './validationGate';
|
|
9
|
+
export * from './promptRegistry.runtime';
|
|
10
|
+
export * from './llmClient.typedefs';
|
|
11
|
+
export * from './createLLMClient';
|
|
12
|
+
export * from './agentRun.typedefs';
|
|
13
|
+
export * from './LLMAgent';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./errors"), exports);
|
|
18
|
+
__exportStar(require("./llmConfig.schema"), exports);
|
|
19
|
+
__exportStar(require("./promptSnapshot.typedefs"), exports);
|
|
20
|
+
__exportStar(require("./snapshotRuntime.typedefs"), exports);
|
|
21
|
+
__exportStar(require("./snapshotRuntime"), exports);
|
|
22
|
+
__exportStar(require("./promptClientPort.typedefs"), exports);
|
|
23
|
+
__exportStar(require("./defineLLMPrompts"), exports);
|
|
24
|
+
__exportStar(require("./validationGate"), exports);
|
|
25
|
+
__exportStar(require("./promptRegistry.runtime"), exports);
|
|
26
|
+
__exportStar(require("./llmClient.typedefs"), exports);
|
|
27
|
+
__exportStar(require("./createLLMClient"), exports);
|
|
28
|
+
__exportStar(require("./agentRun.typedefs"), exports);
|
|
29
|
+
__exportStar(require("./LLMAgent"), exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,qDAAmC;AACnC,4DAA0C;AAC1C,6DAA2C;AAC3C,oDAAkC;AAClC,8DAA4C;AAC5C,qDAAmC;AACnC,mDAAiC;AACjC,2DAAyC;AACzC,uDAAqC;AACrC,oDAAkC;AAClC,sDAAoC;AACpC,6CAA2B"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { type LLMInstanceOptions, type LLMProviders, type LLMToolGateResult, type LLMToolResult } from '../LLMService.typedefs';
|
|
2
|
+
import { type LLMGateway } from '../LLMGateway';
|
|
3
|
+
import { type LLMLoggerInterface } from '../utilities/logger';
|
|
4
|
+
import { type LLMReporterInterface } from '../utilities/reporter';
|
|
5
|
+
import { type InferSchema, type LLMSchemaInterface } from '../utilities/schema';
|
|
6
|
+
import { type LLMTraceContext } from '../utilities/llmTracing/llmTracing.typedefs';
|
|
7
|
+
import { type LLMGatewayPromptClient } from '../client/promptClientPort.typedefs';
|
|
8
|
+
import { type LLMPromptBinding, type LLMPromptRegistry } from '../client/defineLLMPrompts';
|
|
9
|
+
import { type LLMPromptSnapshot, type LLMVariableValue } from '../client/promptSnapshot.typedefs';
|
|
10
|
+
import { type PromptRegistryRuntime, type ResolvedPrompt } from '../client/promptRegistry.runtime';
|
|
11
|
+
import { type LLMAgent, type LLMAgentDefinition } from '../client/LLMAgent';
|
|
12
|
+
import { type LLMAgentInlineRunOptions, type LLMAgentRunOptions, type LLMAgentRunResult } from '../client/agentRun.typedefs';
|
|
13
|
+
export type LLMClientMode = 'production' | 'experiment';
|
|
14
|
+
/**
|
|
15
|
+
* The explicit opt-out for the reporter pipeline; unlike tracing/prompts,
|
|
16
|
+
* reporting has no safe silent default, so tests must opt out loudly. Passed
|
|
17
|
+
* where `reporting` is expected to disable the Reporter/DWHSync wiring (tests,
|
|
18
|
+
* scripts).
|
|
19
|
+
*/
|
|
20
|
+
export declare const ReportingDisabled: unique symbol;
|
|
21
|
+
export type ReportingDisabledToken = typeof ReportingDisabled;
|
|
22
|
+
/**
|
|
23
|
+
* Resolves provider credentials for one call, scoped by provider + prompt +
|
|
24
|
+
* product, preserving the existing per-feature Secrets Manager layout.
|
|
25
|
+
*/
|
|
26
|
+
export type LLMCredentialsResolver = <Provider extends LLMProviders>(scope: {
|
|
27
|
+
provider: Provider;
|
|
28
|
+
promptName: string;
|
|
29
|
+
product?: string;
|
|
30
|
+
}) => Promise<LLMInstanceOptions[Provider]>;
|
|
31
|
+
export interface LLMClientStaticContext {
|
|
32
|
+
product?: string;
|
|
33
|
+
appEnvironment?: string;
|
|
34
|
+
[key: string]: string | undefined;
|
|
35
|
+
}
|
|
36
|
+
export interface LLMClientCallContext {
|
|
37
|
+
userId?: string | number | null;
|
|
38
|
+
/**
|
|
39
|
+
* The product this one call belongs to, when the caller knows it better than
|
|
40
|
+
* the client does. A client is built once per process, so its static context
|
|
41
|
+
* can only carry the product of whatever built it — the request host, or
|
|
42
|
+
* nothing at all on a message-bus or WebSocket entry point. A call site that
|
|
43
|
+
* resolves the product from its own subject (the user's domain, say) passes
|
|
44
|
+
* it here, and it wins over the static one for both credentials resolution
|
|
45
|
+
* and the reporter's payload.
|
|
46
|
+
*/
|
|
47
|
+
product?: string;
|
|
48
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* What the client knows about one call when it asks the composition root to
|
|
52
|
+
* build the reporter's context: the resolved prompt, the per-call context the
|
|
53
|
+
* feature passed, the static context the client was built with, and the context
|
|
54
|
+
* of the trace scope the call runs inside.
|
|
55
|
+
*/
|
|
56
|
+
export interface LLMReporterContextScope {
|
|
57
|
+
promptName: string;
|
|
58
|
+
promptVersion: number;
|
|
59
|
+
callContext: LLMClientCallContext | undefined;
|
|
60
|
+
staticContext: LLMClientStaticContext;
|
|
61
|
+
/**
|
|
62
|
+
* What the surrounding operation declared when it opened its trace scope, or
|
|
63
|
+
* `undefined` outside a scope. It is the reporter's level-1 context: a call
|
|
64
|
+
* that names nothing of its own still belongs to a user and a session, and
|
|
65
|
+
* this is where the composition root reads them from.
|
|
66
|
+
*/
|
|
67
|
+
scopeContext: LLMTraceContext | undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* What building the per-call trace context needs: the resolved prompt, the
|
|
71
|
+
* per-call context, and the typed Langfuse trace fields the call site supplied.
|
|
72
|
+
*/
|
|
73
|
+
export interface LLMTraceContextScope {
|
|
74
|
+
resolved: ResolvedPrompt;
|
|
75
|
+
callContext: LLMClientCallContext | undefined;
|
|
76
|
+
sessionId: string | undefined;
|
|
77
|
+
traceTags: string[] | undefined;
|
|
78
|
+
}
|
|
79
|
+
export interface LLMReportingConfig<Context extends Record<string, any> = Record<string, any>> {
|
|
80
|
+
reporter: LLMReporterInterface<Context>;
|
|
81
|
+
/**
|
|
82
|
+
* Builds the reporter's own context for one call. Required, and owned by the
|
|
83
|
+
* composition root on purpose: the reporter's payload is a downstream
|
|
84
|
+
* contract (DWH columns, dashboards built on their exact values), and the
|
|
85
|
+
* gateway must never guess its shape or invent its strings. The client
|
|
86
|
+
* supplies only what it knows — the resolved prompt and the contexts it was
|
|
87
|
+
* given — and the application maps that onto its own typed context.
|
|
88
|
+
*/
|
|
89
|
+
buildContext: (scope: LLMReporterContextScope) => Context;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* What building a provider service for one call needs: the resolved prompt and
|
|
93
|
+
* the context that decides whose credentials the provider is built with.
|
|
94
|
+
*/
|
|
95
|
+
export interface LLMProviderServiceScope {
|
|
96
|
+
resolved: ResolvedPrompt;
|
|
97
|
+
callContext: LLMClientCallContext | undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One tool call's outcome, as it stands before the client hands it to the
|
|
101
|
+
* model. `tool` is the tool (or subagent delegation) name, `agent` the run that
|
|
102
|
+
* called it, `input` the arguments the model supplied, and `result` the value
|
|
103
|
+
* the tool returned after the package's own coercion.
|
|
104
|
+
*/
|
|
105
|
+
export interface LLMToolResultContext {
|
|
106
|
+
tool: string;
|
|
107
|
+
agent: string;
|
|
108
|
+
input: unknown;
|
|
109
|
+
result: LLMToolResult;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A client-wide hook that rewrites every tool result before it reaches the
|
|
113
|
+
* model. It runs after the package coerces the raw return value, so it always
|
|
114
|
+
* receives a well-formed result; its own return is coerced again. Use it to
|
|
115
|
+
* apply one truncation, redaction, or envelope policy across every tool
|
|
116
|
+
* instead of repeating it in each `execute`.
|
|
117
|
+
*/
|
|
118
|
+
export type LLMToolResultNormalizer = (context: LLMToolResultContext) => LLMToolResult;
|
|
119
|
+
/**
|
|
120
|
+
* The precondition a delegation tool may declare, checked before the subagent
|
|
121
|
+
* starts. The `subagents` list erases the input schema's generic, so the
|
|
122
|
+
* arguments arrive untyped here: they are the subagent's `inputSchema` shape
|
|
123
|
+
* when it declares one, and `{ prompt }` otherwise.
|
|
124
|
+
*/
|
|
125
|
+
export type LLMDelegationGate = (args: Record<string, unknown>) => Promise<LLMToolGateResult> | LLMToolGateResult;
|
|
126
|
+
/**
|
|
127
|
+
* `ReporterContext` ties the reporter to the mapper that feeds it: declare it
|
|
128
|
+
* and a `LLMReporterInterface<T>` forces `buildContext` to return exactly `T`,
|
|
129
|
+
* so a mapper that drops or mistypes a DWH column fails the build instead of
|
|
130
|
+
* corrupting a dashboard. It is inferred from `reporting` when the call site
|
|
131
|
+
* passes no explicit type arguments; TypeScript has no partial inference, so a
|
|
132
|
+
* call site that spells out `Registry`/`VariableMap` must spell this out too.
|
|
133
|
+
* The factory defaults it to `never`, so a partially explicit call cannot
|
|
134
|
+
* silently fall back to an unchecked reporter context.
|
|
135
|
+
*/
|
|
136
|
+
export interface CreateLLMClientConfig<Registry extends LLMPromptRegistry, ReporterContext extends Record<string, any> = Record<string, any>> {
|
|
137
|
+
gateway: LLMGateway;
|
|
138
|
+
registry: Registry;
|
|
139
|
+
snapshot: LLMPromptSnapshot;
|
|
140
|
+
credentials: LLMCredentialsResolver;
|
|
141
|
+
reporting: LLMReportingConfig<ReporterContext> | ReportingDisabledToken;
|
|
142
|
+
logger?: LLMLoggerInterface;
|
|
143
|
+
context?: LLMClientStaticContext;
|
|
144
|
+
mode?: LLMClientMode;
|
|
145
|
+
promptClient?: LLMGatewayPromptClient;
|
|
146
|
+
defaultLabel?: string;
|
|
147
|
+
cacheTtlSeconds?: number;
|
|
148
|
+
normalizeToolResult?: LLMToolResultNormalizer;
|
|
149
|
+
}
|
|
150
|
+
export interface LLMClientEngineConfig<Registry extends LLMPromptRegistry> {
|
|
151
|
+
gateway: LLMGateway;
|
|
152
|
+
registry: Registry;
|
|
153
|
+
runtime: PromptRegistryRuntime;
|
|
154
|
+
credentials: LLMCredentialsResolver;
|
|
155
|
+
reporter: LLMReporterInterface<any> | undefined;
|
|
156
|
+
buildReporterContext: ((scope: LLMReporterContextScope) => unknown) | undefined;
|
|
157
|
+
logger: LLMLoggerInterface | undefined;
|
|
158
|
+
staticContext: LLMClientStaticContext;
|
|
159
|
+
mode: LLMClientMode;
|
|
160
|
+
normalizeToolResult: LLMToolResultNormalizer | undefined;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The variables a prompt requires. Required keys come exclusively from the
|
|
164
|
+
* code-owned prompt registry. Extras remain tolerated so callers can migrate a
|
|
165
|
+
* variable in more than one deployment.
|
|
166
|
+
*/
|
|
167
|
+
export type LLMPromptVariables<RequiredKeys extends string> = Record<RequiredKeys, LLMVariableValue> & Record<string, LLMVariableValue>;
|
|
168
|
+
/**
|
|
169
|
+
* Where a subagent's prompt variables come from. Without an `inputSchema` the
|
|
170
|
+
* parent model supplies only a task string, so the definition must carry every
|
|
171
|
+
* variable the prompt requires. With one, the model fills the rest at call
|
|
172
|
+
* time — the definition's own variables become a partial base and the runtime
|
|
173
|
+
* validation gate is what proves the set complete.
|
|
174
|
+
*/
|
|
175
|
+
export type LLMSubagentVariableSource<RequiredKeys extends string> = {
|
|
176
|
+
inputSchema?: undefined;
|
|
177
|
+
variables: LLMPromptVariables<RequiredKeys>;
|
|
178
|
+
} | {
|
|
179
|
+
inputSchema: LLMSchemaInterface;
|
|
180
|
+
variables?: Partial<LLMPromptVariables<RequiredKeys>>;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The return type of `generate` for one prompt: the bound schema's inferred type
|
|
184
|
+
* when a schema is present, else the raw completion string.
|
|
185
|
+
*/
|
|
186
|
+
export type LLMGenerateResult<Binding extends LLMPromptBinding> = Binding extends {
|
|
187
|
+
schema: infer Schema;
|
|
188
|
+
} ? Schema extends LLMSchemaInterface ? InferSchema<Schema> : string : string;
|
|
189
|
+
export interface LLMGenerateOptions<Variables extends Record<string, LLMVariableValue>, Schema extends LLMSchemaInterface = never> {
|
|
190
|
+
variables: Variables;
|
|
191
|
+
context?: LLMClientCallContext;
|
|
192
|
+
history?: LLMPlainMessage[];
|
|
193
|
+
abortSignal?: AbortSignal;
|
|
194
|
+
overrides?: LLMCallOverrides;
|
|
195
|
+
/**
|
|
196
|
+
* Groups the traces of one conversation, review, or agent run into a single
|
|
197
|
+
* Langfuse session. It is a typed Langfuse trace field, not metadata, so it
|
|
198
|
+
* never reaches the reporter's payload. Top level rather than nested under a
|
|
199
|
+
* trace object because a session is understandable without knowing what a
|
|
200
|
+
* trace is. Keep the anchor stable — changing it splits a session's history
|
|
201
|
+
* in two.
|
|
202
|
+
*/
|
|
203
|
+
sessionId?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Langfuse trace tags. Typed Langfuse trace fields, not metadata. The `trace`
|
|
206
|
+
* prefix is deliberate: a bare `tags` says nothing about which system reads
|
|
207
|
+
* them.
|
|
208
|
+
*/
|
|
209
|
+
traceTags?: string[];
|
|
210
|
+
/**
|
|
211
|
+
* Per-call structured-output schema. Overrides the registry binding's `schema`
|
|
212
|
+
* for this call and drives the return type (`InferSchema<Schema>`). Use it when
|
|
213
|
+
* the output contract is dynamic per call (e.g. a schema whose shape depends on
|
|
214
|
+
* runtime input). The schema is the code-owned output contract, not a routing
|
|
215
|
+
* control, so it is honored in every mode.
|
|
216
|
+
*/
|
|
217
|
+
schema?: Schema;
|
|
218
|
+
}
|
|
219
|
+
export interface LLMCallOverrides {
|
|
220
|
+
model?: string;
|
|
221
|
+
provider?: LLMProviders;
|
|
222
|
+
promptVersion?: number;
|
|
223
|
+
promptLabel?: string;
|
|
224
|
+
}
|
|
225
|
+
export type LLMPlainMessageRole = 'user' | 'assistant';
|
|
226
|
+
export interface LLMPlainMessage {
|
|
227
|
+
role: LLMPlainMessageRole;
|
|
228
|
+
text: string;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Maps each registry key to the union of variable names declared by code. The
|
|
232
|
+
* Langfuse prompt body and generated fallback snapshot do not participate in
|
|
233
|
+
* call-site typing.
|
|
234
|
+
*/
|
|
235
|
+
export type LLMPromptVariableMap<Registry extends LLMPromptRegistry> = {
|
|
236
|
+
[Key in keyof Registry]: Registry[Key] extends {
|
|
237
|
+
variables: readonly (infer VariableName extends string)[];
|
|
238
|
+
} ? VariableName : never;
|
|
239
|
+
};
|
|
240
|
+
export interface LLMClient<Registry extends LLMPromptRegistry, VariableMap extends Record<keyof Registry, string> = LLMPromptVariableMap<Registry>> {
|
|
241
|
+
generate<Key extends keyof Registry, Schema extends LLMSchemaInterface = never>(prompt: Key, options: LLMGenerateOptions<Record<VariableMap[Key], LLMVariableValue> & Record<string, LLMVariableValue>, Schema>): Promise<[
|
|
242
|
+
Schema
|
|
243
|
+
] extends [never] ? LLMGenerateResult<Registry[Key]> : InferSchema<Schema>>;
|
|
244
|
+
countTokens<Key extends keyof Registry>(prompt: Key, options: {
|
|
245
|
+
variables: Record<string, LLMVariableValue>;
|
|
246
|
+
history?: LLMPlainMessage[];
|
|
247
|
+
}): Promise<number>;
|
|
248
|
+
defineAgent<Key extends keyof Registry>(definition: LLMAgentDefinition<Registry, VariableMap, Key>): LLMAgent<Registry, VariableMap, Key>;
|
|
249
|
+
runAgent<Key extends keyof Registry>(prompt: Key, options: LLMAgentInlineRunOptions<Record<VariableMap[Key], LLMVariableValue> & Record<string, LLMVariableValue>, Registry, VariableMap>): Promise<LLMAgentRunResult<LLMGenerateResult<Registry[Key]>>>;
|
|
250
|
+
runAgent<Key extends keyof Registry>(agent: LLMAgent<Registry, VariableMap, Key>, options: LLMAgentRunOptions<Record<VariableMap[Key], LLMVariableValue> & Record<string, LLMVariableValue>>): Promise<LLMAgentRunResult<LLMGenerateResult<Registry[Key]>>>;
|
|
251
|
+
describePrompt<Key extends keyof Registry>(prompt: Key): Promise<LLMPromptDescription>;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Read-only routing metadata for a prompt — the `{ provider, model,
|
|
255
|
+
* promptVersion }` the runtime would serve right now (same resolve/cache/fallback
|
|
256
|
+
* path `generate` uses). Lets analytics events record the resolved model without
|
|
257
|
+
* coupling to `generate`'s data-only return. `isFallback` flags the snapshot
|
|
258
|
+
* config was used because the live fetch was unreachable or failed the gate.
|
|
259
|
+
*/
|
|
260
|
+
export interface LLMPromptDescription {
|
|
261
|
+
provider: LLMProviders;
|
|
262
|
+
model: string;
|
|
263
|
+
promptVersion: number;
|
|
264
|
+
isFallback: boolean;
|
|
265
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportingDisabled = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The explicit opt-out for the reporter pipeline; unlike tracing/prompts,
|
|
6
|
+
* reporting has no safe silent default, so tests must opt out loudly. Passed
|
|
7
|
+
* where `reporting` is expected to disable the Reporter/DWHSync wiring (tests,
|
|
8
|
+
* scripts).
|
|
9
|
+
*/
|
|
10
|
+
exports.ReportingDisabled = Symbol('ReportingDisabled');
|
|
11
|
+
//# sourceMappingURL=llmClient.typedefs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llmClient.typedefs.js","sourceRoot":"","sources":["../../src/client/llmClient.typedefs.ts"],"names":[],"mappings":";;;AAiCA;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LLMProviders } from '../LLMService.typedefs';
|
|
3
|
+
/**
|
|
4
|
+
* Hard ceilings the runtime gate enforces on every prompt `config`, independent
|
|
5
|
+
* of provider. A live edit that exceeds one of these never reaches production
|
|
6
|
+
* traffic; the gate serves the fallback snapshot instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LLM_CONFIG_PARAM_CEILINGS: {
|
|
9
|
+
readonly maxOutputTokens: 32768;
|
|
10
|
+
readonly temperature: {
|
|
11
|
+
readonly min: 0;
|
|
12
|
+
readonly max: 2;
|
|
13
|
+
};
|
|
14
|
+
readonly topP: {
|
|
15
|
+
readonly min: 0;
|
|
16
|
+
readonly max: 1;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const REASONING_EFFORT_VALUES: readonly ["minimal", "low", "medium", "high"];
|
|
20
|
+
export declare const llmConfigParamsSchema: z.ZodObject<{
|
|
21
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
topP: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
minimal: "minimal";
|
|
26
|
+
low: "low";
|
|
27
|
+
medium: "medium";
|
|
28
|
+
high: "high";
|
|
29
|
+
}>>;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
/**
|
|
32
|
+
* The gateway-owned shape of a prompt's `config`. The provider routes the call;
|
|
33
|
+
* `model` is checked against `LLM_SERVICE_MODELS` by the runtime gate (a string
|
|
34
|
+
* here because the snapshot is provider-agnostic); `params` are the generation
|
|
35
|
+
* knobs, capped by `LLM_CONFIG_PARAM_CEILINGS`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const llmPromptConfigSchema: z.ZodObject<{
|
|
38
|
+
provider: z.ZodEnum<typeof LLMProviders>;
|
|
39
|
+
model: z.ZodString;
|
|
40
|
+
params: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
topP: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
45
|
+
minimal: "minimal";
|
|
46
|
+
low: "low";
|
|
47
|
+
medium: "medium";
|
|
48
|
+
high: "high";
|
|
49
|
+
}>>;
|
|
50
|
+
}, z.core.$loose>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type LLMPromptConfig = z.infer<typeof llmPromptConfigSchema>;
|
|
53
|
+
export type LLMPromptConfigParams = z.infer<typeof llmConfigParamsSchema>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.llmPromptConfigSchema = exports.llmConfigParamsSchema = exports.REASONING_EFFORT_VALUES = exports.LLM_CONFIG_PARAM_CEILINGS = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const LLMService_typedefs_1 = require("../LLMService.typedefs");
|
|
6
|
+
/**
|
|
7
|
+
* Hard ceilings the runtime gate enforces on every prompt `config`, independent
|
|
8
|
+
* of provider. A live edit that exceeds one of these never reaches production
|
|
9
|
+
* traffic; the gate serves the fallback snapshot instead.
|
|
10
|
+
*/
|
|
11
|
+
exports.LLM_CONFIG_PARAM_CEILINGS = {
|
|
12
|
+
maxOutputTokens: 32_768,
|
|
13
|
+
temperature: { min: 0, max: 2 },
|
|
14
|
+
topP: { min: 0, max: 1 },
|
|
15
|
+
};
|
|
16
|
+
exports.REASONING_EFFORT_VALUES = ['minimal', 'low', 'medium', 'high'];
|
|
17
|
+
exports.llmConfigParamsSchema = zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
temperature: zod_1.z
|
|
20
|
+
.number()
|
|
21
|
+
.min(exports.LLM_CONFIG_PARAM_CEILINGS.temperature.min)
|
|
22
|
+
.max(exports.LLM_CONFIG_PARAM_CEILINGS.temperature.max)
|
|
23
|
+
.optional(),
|
|
24
|
+
topP: zod_1.z
|
|
25
|
+
.number()
|
|
26
|
+
.min(exports.LLM_CONFIG_PARAM_CEILINGS.topP.min)
|
|
27
|
+
.max(exports.LLM_CONFIG_PARAM_CEILINGS.topP.max)
|
|
28
|
+
.optional(),
|
|
29
|
+
maxOutputTokens: zod_1.z
|
|
30
|
+
.number()
|
|
31
|
+
.int()
|
|
32
|
+
.positive()
|
|
33
|
+
.max(exports.LLM_CONFIG_PARAM_CEILINGS.maxOutputTokens)
|
|
34
|
+
.optional(),
|
|
35
|
+
reasoningEffort: zod_1.z.enum(exports.REASONING_EFFORT_VALUES).optional(),
|
|
36
|
+
})
|
|
37
|
+
.passthrough();
|
|
38
|
+
/**
|
|
39
|
+
* The gateway-owned shape of a prompt's `config`. The provider routes the call;
|
|
40
|
+
* `model` is checked against `LLM_SERVICE_MODELS` by the runtime gate (a string
|
|
41
|
+
* here because the snapshot is provider-agnostic); `params` are the generation
|
|
42
|
+
* knobs, capped by `LLM_CONFIG_PARAM_CEILINGS`.
|
|
43
|
+
*/
|
|
44
|
+
exports.llmPromptConfigSchema = zod_1.z.object({
|
|
45
|
+
provider: zod_1.z.nativeEnum(LLMService_typedefs_1.LLMProviders),
|
|
46
|
+
model: zod_1.z.string().min(1),
|
|
47
|
+
params: exports.llmConfigParamsSchema.optional(),
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=llmConfig.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llmConfig.schema.js","sourceRoot":"","sources":["../../src/client/llmConfig.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAqD;AAErD;;;;GAIG;AACU,QAAA,yBAAyB,GAAG;IACvC,eAAe,EAAE,MAAM;IACvB,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;IAC/B,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;CAChB,CAAC;AAEE,QAAA,uBAAuB,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC;AAExE,QAAA,qBAAqB,GAAG,OAAC;KACnC,MAAM,CAAC;IACN,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,iCAAyB,CAAC,WAAW,CAAC,GAAG,CAAC;SAC9C,GAAG,CAAC,iCAAyB,CAAC,WAAW,CAAC,GAAG,CAAC;SAC9C,QAAQ,EAAE;IACb,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,iCAAyB,CAAC,IAAI,CAAC,GAAG,CAAC;SACvC,GAAG,CAAC,iCAAyB,CAAC,IAAI,CAAC,GAAG,CAAC;SACvC,QAAQ,EAAE;IACb,eAAe,EAAE,OAAC;SACf,MAAM,EAAE;SACR,GAAG,EAAE;SACL,QAAQ,EAAE;SACV,GAAG,CAAC,iCAAyB,CAAC,eAAe,CAAC;SAC9C,QAAQ,EAAE;IACb,eAAe,EAAE,OAAC,CAAC,IAAI,CAAC,+BAAuB,CAAC,CAAC,QAAQ,EAAE;CAC5D,CAAC;KACD,WAAW,EAAE,CAAC;AAEjB;;;;;GAKG;AACU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,OAAC,CAAC,UAAU,CAAC,kCAAY,CAAC;IACpC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,MAAM,EAAE,6BAAqB,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LLMRoles, type LLMMessageTextContent } from '../LLMService.typedefs';
|
|
2
|
+
import { type LLMPlainMessage } from '../client/llmClient.typedefs';
|
|
3
|
+
export interface LLMPlainTextContentMessage {
|
|
4
|
+
role: LLMRoles;
|
|
5
|
+
content: LLMMessageTextContent[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Maps the client's persisted plain-message history into the gateway's
|
|
9
|
+
* content-message shape. The single mapper both `generate` and `runAgent` use,
|
|
10
|
+
* so a persisted session replays identically through either surface.
|
|
11
|
+
*/
|
|
12
|
+
export declare function plainMessagesToContentMessages(history: LLMPlainMessage[] | undefined): LLMPlainTextContentMessage[];
|