@alpic80/rivet-core 1.19.1-aidon.1
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/LICENSE +7 -0
- package/README.md +176 -0
- package/dist/cjs/bundle.cjs +18915 -0
- package/dist/cjs/bundle.cjs.map +7 -0
- package/dist/esm/api/createProcessor.js +131 -0
- package/dist/esm/api/streaming.js +116 -0
- package/dist/esm/exports.js +32 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/integrations/AudioProvider.js +1 -0
- package/dist/esm/integrations/DatasetProvider.js +92 -0
- package/dist/esm/integrations/EmbeddingGenerator.js +1 -0
- package/dist/esm/integrations/GptTokenizerTokenizer.js +65 -0
- package/dist/esm/integrations/LLMProvider.js +1 -0
- package/dist/esm/integrations/Tokenizer.js +1 -0
- package/dist/esm/integrations/VectorDatabase.js +1 -0
- package/dist/esm/integrations/enableIntegrations.js +3 -0
- package/dist/esm/integrations/integrations.js +19 -0
- package/dist/esm/integrations/openai/OpenAIEmbeddingGenerator.js +23 -0
- package/dist/esm/model/DataValue.js +176 -0
- package/dist/esm/model/Dataset.js +1 -0
- package/dist/esm/model/EditorDefinition.js +1 -0
- package/dist/esm/model/GraphProcessor.js +1198 -0
- package/dist/esm/model/NodeBase.js +1 -0
- package/dist/esm/model/NodeBodySpec.js +1 -0
- package/dist/esm/model/NodeDefinition.js +12 -0
- package/dist/esm/model/NodeGraph.js +14 -0
- package/dist/esm/model/NodeImpl.js +49 -0
- package/dist/esm/model/NodeRegistration.js +144 -0
- package/dist/esm/model/Nodes.js +227 -0
- package/dist/esm/model/PluginLoadSpec.js +1 -0
- package/dist/esm/model/ProcessContext.js +1 -0
- package/dist/esm/model/Project.js +2 -0
- package/dist/esm/model/RivetPlugin.js +1 -0
- package/dist/esm/model/RivetUIContext.js +1 -0
- package/dist/esm/model/Settings.js +1 -0
- package/dist/esm/model/nodes/AbortGraphNode.js +100 -0
- package/dist/esm/model/nodes/AppendToDatasetNode.js +115 -0
- package/dist/esm/model/nodes/ArrayNode.js +144 -0
- package/dist/esm/model/nodes/AssembleMessageNode.js +199 -0
- package/dist/esm/model/nodes/AssemblePromptNode.js +129 -0
- package/dist/esm/model/nodes/AudioNode.js +101 -0
- package/dist/esm/model/nodes/BooleanNode.js +74 -0
- package/dist/esm/model/nodes/CallGraphNode.js +136 -0
- package/dist/esm/model/nodes/ChatNode.js +964 -0
- package/dist/esm/model/nodes/ChunkNode.js +166 -0
- package/dist/esm/model/nodes/CoalesceNode.js +104 -0
- package/dist/esm/model/nodes/CodeNode.js +136 -0
- package/dist/esm/model/nodes/CommentNode.js +69 -0
- package/dist/esm/model/nodes/CompareNode.js +138 -0
- package/dist/esm/model/nodes/ContextNode.js +99 -0
- package/dist/esm/model/nodes/CreateDatasetNode.js +71 -0
- package/dist/esm/model/nodes/DatasetNearestNeigborsNode.js +97 -0
- package/dist/esm/model/nodes/DelayNode.js +105 -0
- package/dist/esm/model/nodes/DelegateFunctionCallNode.js +136 -0
- package/dist/esm/model/nodes/DestructureNode.js +86 -0
- package/dist/esm/model/nodes/EvaluateNode.js +141 -0
- package/dist/esm/model/nodes/ExternalCallNode.js +162 -0
- package/dist/esm/model/nodes/ExtractJsonNode.js +122 -0
- package/dist/esm/model/nodes/ExtractMarkdownCodeBlocksNode.js +100 -0
- package/dist/esm/model/nodes/ExtractObjectPathNode.js +128 -0
- package/dist/esm/model/nodes/ExtractRegexNode.js +201 -0
- package/dist/esm/model/nodes/ExtractYamlNode.js +214 -0
- package/dist/esm/model/nodes/FilterNode.js +73 -0
- package/dist/esm/model/nodes/GetAllDatasetsNode.js +53 -0
- package/dist/esm/model/nodes/GetDatasetRowNode.js +99 -0
- package/dist/esm/model/nodes/GetEmbeddingNode.js +130 -0
- package/dist/esm/model/nodes/GetGlobalNode.js +139 -0
- package/dist/esm/model/nodes/GptFunctionNode.js +169 -0
- package/dist/esm/model/nodes/GraphInputNode.js +130 -0
- package/dist/esm/model/nodes/GraphOutputNode.js +104 -0
- package/dist/esm/model/nodes/GraphReferenceNode.js +128 -0
- package/dist/esm/model/nodes/HashNode.js +97 -0
- package/dist/esm/model/nodes/HttpCallNode.js +257 -0
- package/dist/esm/model/nodes/IfElseNode.js +138 -0
- package/dist/esm/model/nodes/IfNode.js +124 -0
- package/dist/esm/model/nodes/ImageNode.js +107 -0
- package/dist/esm/model/nodes/JoinNode.js +135 -0
- package/dist/esm/model/nodes/ListGraphsNode.js +61 -0
- package/dist/esm/model/nodes/LoadDatasetNode.js +83 -0
- package/dist/esm/model/nodes/LoopControllerNode.js +206 -0
- package/dist/esm/model/nodes/MatchNode.js +137 -0
- package/dist/esm/model/nodes/NumberNode.js +86 -0
- package/dist/esm/model/nodes/ObjectNode.js +121 -0
- package/dist/esm/model/nodes/PassthroughNode.js +78 -0
- package/dist/esm/model/nodes/PlayAudioNode.js +61 -0
- package/dist/esm/model/nodes/PopNode.js +89 -0
- package/dist/esm/model/nodes/PromptNode.js +227 -0
- package/dist/esm/model/nodes/RaceInputsNode.js +86 -0
- package/dist/esm/model/nodes/RaiseEventNode.js +84 -0
- package/dist/esm/model/nodes/RandomNumberNode.js +106 -0
- package/dist/esm/model/nodes/ReadDirectoryNode.js +165 -0
- package/dist/esm/model/nodes/ReadFileNode.js +114 -0
- package/dist/esm/model/nodes/ReplaceDatasetNode.js +118 -0
- package/dist/esm/model/nodes/SetGlobalNode.js +124 -0
- package/dist/esm/model/nodes/ShuffleNode.js +64 -0
- package/dist/esm/model/nodes/SliceNode.js +100 -0
- package/dist/esm/model/nodes/SplitNode.js +101 -0
- package/dist/esm/model/nodes/SubGraphNode.js +181 -0
- package/dist/esm/model/nodes/TextNode.js +97 -0
- package/dist/esm/model/nodes/ToJsonNode.js +78 -0
- package/dist/esm/model/nodes/ToYamlNode.js +68 -0
- package/dist/esm/model/nodes/TrimChatMessagesNode.js +120 -0
- package/dist/esm/model/nodes/URLReferenceNode.js +79 -0
- package/dist/esm/model/nodes/UserInputNode.js +111 -0
- package/dist/esm/model/nodes/VectorNearestNeighborsNode.js +127 -0
- package/dist/esm/model/nodes/VectorStoreNode.js +124 -0
- package/dist/esm/model/nodes/WaitForEventNode.js +88 -0
- package/dist/esm/native/BaseDir.js +32 -0
- package/dist/esm/native/BrowserNativeApi.js +19 -0
- package/dist/esm/native/NativeApi.js +1 -0
- package/dist/esm/plugins/aidon/index.js +2 -0
- package/dist/esm/plugins/aidon/nodes/ChatAidonNode.js +215 -0
- package/dist/esm/plugins/aidon/plugin.js +9 -0
- package/dist/esm/plugins/anthropic/anthropic.js +187 -0
- package/dist/esm/plugins/anthropic/fetchEventSource.js +106 -0
- package/dist/esm/plugins/anthropic/index.js +2 -0
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +652 -0
- package/dist/esm/plugins/anthropic/plugin.js +18 -0
- package/dist/esm/plugins/assemblyAi/LemurActionItemsNode.js +75 -0
- package/dist/esm/plugins/assemblyAi/LemurQaNode.js +155 -0
- package/dist/esm/plugins/assemblyAi/LemurSummaryNode.js +79 -0
- package/dist/esm/plugins/assemblyAi/LemurTaskNode.js +82 -0
- package/dist/esm/plugins/assemblyAi/TranscribeAudioNode.js +125 -0
- package/dist/esm/plugins/assemblyAi/index.js +2 -0
- package/dist/esm/plugins/assemblyAi/lemurHelpers.js +114 -0
- package/dist/esm/plugins/assemblyAi/plugin.js +32 -0
- package/dist/esm/plugins/autoevals/AutoEvalsNode.js +223 -0
- package/dist/esm/plugins/autoevals/index.js +2 -0
- package/dist/esm/plugins/autoevals/plugin.js +8 -0
- package/dist/esm/plugins/gentrace/index.js +2 -0
- package/dist/esm/plugins/gentrace/plugin.js +192 -0
- package/dist/esm/plugins/google/google.js +60 -0
- package/dist/esm/plugins/google/index.js +2 -0
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +364 -0
- package/dist/esm/plugins/google/plugin.js +32 -0
- package/dist/esm/plugins/huggingface/index.js +2 -0
- package/dist/esm/plugins/huggingface/nodes/ChatHuggingFace.js +243 -0
- package/dist/esm/plugins/huggingface/nodes/TextToImageHuggingFace.js +189 -0
- package/dist/esm/plugins/huggingface/plugin.js +26 -0
- package/dist/esm/plugins/openai/handleOpenaiError.js +17 -0
- package/dist/esm/plugins/openai/index.js +2 -0
- package/dist/esm/plugins/openai/nodes/AttachAssistantFileNode.js +123 -0
- package/dist/esm/plugins/openai/nodes/CreateAssistantNode.js +289 -0
- package/dist/esm/plugins/openai/nodes/CreateThreadMessageNode.js +176 -0
- package/dist/esm/plugins/openai/nodes/CreateThreadNode.js +157 -0
- package/dist/esm/plugins/openai/nodes/DeleteAssistantNode.js +104 -0
- package/dist/esm/plugins/openai/nodes/DeleteThreadNode.js +97 -0
- package/dist/esm/plugins/openai/nodes/GetAssistantNode.js +118 -0
- package/dist/esm/plugins/openai/nodes/GetOpenAIFileNode.js +100 -0
- package/dist/esm/plugins/openai/nodes/GetThreadNode.js +108 -0
- package/dist/esm/plugins/openai/nodes/ListAssistantsNode.js +202 -0
- package/dist/esm/plugins/openai/nodes/ListOpenAIFilesNode.js +94 -0
- package/dist/esm/plugins/openai/nodes/ListThreadMessagesNode.js +224 -0
- package/dist/esm/plugins/openai/nodes/RunThreadNode.js +630 -0
- package/dist/esm/plugins/openai/nodes/ThreadMessageNode.js +145 -0
- package/dist/esm/plugins/openai/nodes/UploadFileNode.js +121 -0
- package/dist/esm/plugins/openai/plugin.js +44 -0
- package/dist/esm/plugins/pinecone/PineconeVectorDatabase.js +88 -0
- package/dist/esm/plugins/pinecone/index.js +2 -0
- package/dist/esm/plugins/pinecone/plugin.js +19 -0
- package/dist/esm/plugins.js +21 -0
- package/dist/esm/recording/ExecutionRecorder.js +177 -0
- package/dist/esm/recording/RecordedEvents.js +1 -0
- package/dist/esm/utils/assertNever.js +3 -0
- package/dist/esm/utils/base64.js +25 -0
- package/dist/esm/utils/chatMessageToOpenAIChatCompletionMessage.js +60 -0
- package/dist/esm/utils/coerceType.js +322 -0
- package/dist/esm/utils/compatibility.js +27 -0
- package/dist/esm/utils/copyToClipboard.js +10 -0
- package/dist/esm/utils/defaults.js +2 -0
- package/dist/esm/utils/errors.js +7 -0
- package/dist/esm/utils/expectType.js +34 -0
- package/dist/esm/utils/fetchEventSource.js +120 -0
- package/dist/esm/utils/genericUtilFunctions.js +25 -0
- package/dist/esm/utils/getPluginConfig.js +23 -0
- package/dist/esm/utils/handleEscapeCharacters.js +11 -0
- package/dist/esm/utils/index.js +14 -0
- package/dist/esm/utils/inputs.js +16 -0
- package/dist/esm/utils/interpolation.js +6 -0
- package/dist/esm/utils/misc.js +1 -0
- package/dist/esm/utils/newId.js +4 -0
- package/dist/esm/utils/openai.js +219 -0
- package/dist/esm/utils/outputs.js +14 -0
- package/dist/esm/utils/serialization/serialization.js +86 -0
- package/dist/esm/utils/serialization/serializationUtils.js +13 -0
- package/dist/esm/utils/serialization/serialization_v1.js +19 -0
- package/dist/esm/utils/serialization/serialization_v2.js +24 -0
- package/dist/esm/utils/serialization/serialization_v3.js +145 -0
- package/dist/esm/utils/serialization/serialization_v4.js +200 -0
- package/dist/esm/utils/symbols.js +2 -0
- package/dist/esm/utils/time.js +14 -0
- package/dist/esm/utils/typeSafety.js +42 -0
- package/dist/types/api/createProcessor.d.ts +37 -0
- package/dist/types/api/streaming.d.ts +56 -0
- package/dist/types/exports.d.ts +33 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/integrations/AudioProvider.d.ts +4 -0
- package/dist/types/integrations/DatasetProvider.d.ts +33 -0
- package/dist/types/integrations/EmbeddingGenerator.d.ts +3 -0
- package/dist/types/integrations/GptTokenizerTokenizer.d.ts +20 -0
- package/dist/types/integrations/LLMProvider.d.ts +7 -0
- package/dist/types/integrations/Tokenizer.d.ts +11 -0
- package/dist/types/integrations/VectorDatabase.d.ts +7 -0
- package/dist/types/integrations/enableIntegrations.d.ts +1 -0
- package/dist/types/integrations/integrations.d.ts +12 -0
- package/dist/types/integrations/openai/OpenAIEmbeddingGenerator.d.ts +10 -0
- package/dist/types/model/DataValue.d.ts +138 -0
- package/dist/types/model/Dataset.d.ts +19 -0
- package/dist/types/model/EditorDefinition.d.ts +142 -0
- package/dist/types/model/GraphProcessor.d.ts +192 -0
- package/dist/types/model/NodeBase.d.ts +110 -0
- package/dist/types/model/NodeBodySpec.d.ts +19 -0
- package/dist/types/model/NodeDefinition.d.ts +13 -0
- package/dist/types/model/NodeGraph.d.ts +15 -0
- package/dist/types/model/NodeImpl.d.ts +55 -0
- package/dist/types/model/NodeRegistration.d.ts +24 -0
- package/dist/types/model/Nodes.d.ts +84 -0
- package/dist/types/model/PluginLoadSpec.d.ts +17 -0
- package/dist/types/model/ProcessContext.d.ts +69 -0
- package/dist/types/model/Project.d.ts +17 -0
- package/dist/types/model/RivetPlugin.d.ts +45 -0
- package/dist/types/model/RivetUIContext.d.ts +18 -0
- package/dist/types/model/Settings.d.ts +15 -0
- package/dist/types/model/nodes/AbortGraphNode.d.ts +22 -0
- package/dist/types/model/nodes/AppendToDatasetNode.d.ts +21 -0
- package/dist/types/model/nodes/ArrayNode.d.ts +20 -0
- package/dist/types/model/nodes/AssembleMessageNode.d.ts +23 -0
- package/dist/types/model/nodes/AssemblePromptNode.d.ts +20 -0
- package/dist/types/model/nodes/AudioNode.d.ts +20 -0
- package/dist/types/model/nodes/BooleanNode.d.ts +19 -0
- package/dist/types/model/nodes/CallGraphNode.d.ts +16 -0
- package/dist/types/model/nodes/ChatNode.d.ts +77 -0
- package/dist/types/model/nodes/ChunkNode.d.ts +22 -0
- package/dist/types/model/nodes/CoalesceNode.d.ts +14 -0
- package/dist/types/model/nodes/CodeNode.d.ts +21 -0
- package/dist/types/model/nodes/CommentNode.d.ts +20 -0
- package/dist/types/model/nodes/CompareNode.d.ts +19 -0
- package/dist/types/model/nodes/ContextNode.d.ts +24 -0
- package/dist/types/model/nodes/CreateDatasetNode.d.ts +13 -0
- package/dist/types/model/nodes/DatasetNearestNeigborsNode.d.ts +19 -0
- package/dist/types/model/nodes/DelayNode.d.ts +20 -0
- package/dist/types/model/nodes/DelegateFunctionCallNode.d.ts +25 -0
- package/dist/types/model/nodes/DestructureNode.d.ts +18 -0
- package/dist/types/model/nodes/EvaluateNode.d.ts +19 -0
- package/dist/types/model/nodes/ExternalCallNode.d.ts +22 -0
- package/dist/types/model/nodes/ExtractJsonNode.d.ts +13 -0
- package/dist/types/model/nodes/ExtractMarkdownCodeBlocksNode.d.ts +12 -0
- package/dist/types/model/nodes/ExtractObjectPathNode.d.ts +19 -0
- package/dist/types/model/nodes/ExtractRegexNode.d.ts +22 -0
- package/dist/types/model/nodes/ExtractYamlNode.d.ts +21 -0
- package/dist/types/model/nodes/FilterNode.d.ts +13 -0
- package/dist/types/model/nodes/GetAllDatasetsNode.d.ts +14 -0
- package/dist/types/model/nodes/GetDatasetRowNode.d.ts +19 -0
- package/dist/types/model/nodes/GetEmbeddingNode.d.ts +24 -0
- package/dist/types/model/nodes/GetGlobalNode.d.ts +29 -0
- package/dist/types/model/nodes/GptFunctionNode.d.ts +25 -0
- package/dist/types/model/nodes/GraphInputNode.d.ts +24 -0
- package/dist/types/model/nodes/GraphOutputNode.d.ts +22 -0
- package/dist/types/model/nodes/GraphReferenceNode.d.ts +22 -0
- package/dist/types/model/nodes/HashNode.d.ts +17 -0
- package/dist/types/model/nodes/HttpCallNode.d.ts +27 -0
- package/dist/types/model/nodes/IfElseNode.d.ts +18 -0
- package/dist/types/model/nodes/IfNode.d.ts +17 -0
- package/dist/types/model/nodes/ImageNode.d.ts +20 -0
- package/dist/types/model/nodes/JoinNode.d.ts +21 -0
- package/dist/types/model/nodes/ListGraphsNode.d.ts +14 -0
- package/dist/types/model/nodes/LoadDatasetNode.d.ts +17 -0
- package/dist/types/model/nodes/LoopControllerNode.d.ts +20 -0
- package/dist/types/model/nodes/MatchNode.d.ts +19 -0
- package/dist/types/model/nodes/NumberNode.d.ts +21 -0
- package/dist/types/model/nodes/ObjectNode.d.ts +18 -0
- package/dist/types/model/nodes/PassthroughNode.d.ts +14 -0
- package/dist/types/model/nodes/PlayAudioNode.d.ts +15 -0
- package/dist/types/model/nodes/PopNode.d.ts +19 -0
- package/dist/types/model/nodes/PromptNode.d.ts +23 -0
- package/dist/types/model/nodes/RaceInputsNode.d.ts +17 -0
- package/dist/types/model/nodes/RaiseEventNode.d.ts +22 -0
- package/dist/types/model/nodes/RandomNumberNode.d.ts +23 -0
- package/dist/types/model/nodes/ReadDirectoryNode.d.ts +30 -0
- package/dist/types/model/nodes/ReadFileNode.d.ts +23 -0
- package/dist/types/model/nodes/ReplaceDatasetNode.d.ts +21 -0
- package/dist/types/model/nodes/SetGlobalNode.d.ts +23 -0
- package/dist/types/model/nodes/ShuffleNode.d.ts +12 -0
- package/dist/types/model/nodes/SliceNode.d.ts +22 -0
- package/dist/types/model/nodes/SplitNode.d.ts +19 -0
- package/dist/types/model/nodes/SubGraphNode.d.ts +29 -0
- package/dist/types/model/nodes/TextNode.d.ts +18 -0
- package/dist/types/model/nodes/ToJsonNode.d.ts +18 -0
- package/dist/types/model/nodes/ToYamlNode.d.ts +13 -0
- package/dist/types/model/nodes/TrimChatMessagesNode.d.ts +20 -0
- package/dist/types/model/nodes/URLReferenceNode.d.ts +19 -0
- package/dist/types/model/nodes/UserInputNode.d.ts +21 -0
- package/dist/types/model/nodes/VectorNearestNeighborsNode.d.ts +24 -0
- package/dist/types/model/nodes/VectorStoreNode.d.ts +22 -0
- package/dist/types/model/nodes/WaitForEventNode.d.ts +21 -0
- package/dist/types/native/BaseDir.d.ts +29 -0
- package/dist/types/native/BrowserNativeApi.d.ts +11 -0
- package/dist/types/native/NativeApi.d.ts +17 -0
- package/dist/types/plugins/aidon/index.d.ts +2 -0
- package/dist/types/plugins/aidon/nodes/ChatAidonNode.d.ts +3 -0
- package/dist/types/plugins/aidon/plugin.d.ts +2 -0
- package/dist/types/plugins/anthropic/anthropic.d.ts +216 -0
- package/dist/types/plugins/anthropic/fetchEventSource.d.ts +11 -0
- package/dist/types/plugins/anthropic/index.d.ts +2 -0
- package/dist/types/plugins/anthropic/nodes/ChatAnthropicNode.d.ts +30 -0
- package/dist/types/plugins/anthropic/plugin.d.ts +2 -0
- package/dist/types/plugins/assemblyAi/LemurActionItemsNode.d.ts +6 -0
- package/dist/types/plugins/assemblyAi/LemurQaNode.d.ts +22 -0
- package/dist/types/plugins/assemblyAi/LemurSummaryNode.d.ts +8 -0
- package/dist/types/plugins/assemblyAi/LemurTaskNode.d.ts +8 -0
- package/dist/types/plugins/assemblyAi/TranscribeAudioNode.d.ts +7 -0
- package/dist/types/plugins/assemblyAi/index.d.ts +2 -0
- package/dist/types/plugins/assemblyAi/lemurHelpers.d.ts +67 -0
- package/dist/types/plugins/assemblyAi/plugin.d.ts +2 -0
- package/dist/types/plugins/autoevals/AutoEvalsNode.d.ts +8 -0
- package/dist/types/plugins/autoevals/index.d.ts +2 -0
- package/dist/types/plugins/autoevals/plugin.d.ts +2 -0
- package/dist/types/plugins/gentrace/index.d.ts +2 -0
- package/dist/types/plugins/gentrace/plugin.d.ts +5 -0
- package/dist/types/plugins/google/google.d.ts +60 -0
- package/dist/types/plugins/google/index.d.ts +2 -0
- package/dist/types/plugins/google/nodes/ChatGoogleNode.d.ts +27 -0
- package/dist/types/plugins/google/plugin.d.ts +2 -0
- package/dist/types/plugins/huggingface/index.d.ts +2 -0
- package/dist/types/plugins/huggingface/nodes/ChatHuggingFace.d.ts +24 -0
- package/dist/types/plugins/huggingface/nodes/TextToImageHuggingFace.d.ts +20 -0
- package/dist/types/plugins/huggingface/plugin.d.ts +2 -0
- package/dist/types/plugins/openai/handleOpenaiError.d.ts +1 -0
- package/dist/types/plugins/openai/index.d.ts +2 -0
- package/dist/types/plugins/openai/nodes/AttachAssistantFileNode.d.ts +10 -0
- package/dist/types/plugins/openai/nodes/CreateAssistantNode.d.ts +26 -0
- package/dist/types/plugins/openai/nodes/CreateThreadMessageNode.d.ts +15 -0
- package/dist/types/plugins/openai/nodes/CreateThreadNode.d.ts +13 -0
- package/dist/types/plugins/openai/nodes/DeleteAssistantNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/DeleteThreadNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/GetAssistantNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/GetOpenAIFileNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/GetThreadNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/ListAssistantsNode.d.ts +14 -0
- package/dist/types/plugins/openai/nodes/ListOpenAIFilesNode.d.ts +8 -0
- package/dist/types/plugins/openai/nodes/ListThreadMessagesNode.d.ts +16 -0
- package/dist/types/plugins/openai/nodes/RunThreadNode.d.ts +28 -0
- package/dist/types/plugins/openai/nodes/ThreadMessageNode.d.ts +14 -0
- package/dist/types/plugins/openai/nodes/UploadFileNode.d.ts +7 -0
- package/dist/types/plugins/openai/plugin.d.ts +2 -0
- package/dist/types/plugins/pinecone/PineconeVectorDatabase.d.ts +9 -0
- package/dist/types/plugins/pinecone/index.d.ts +2 -0
- package/dist/types/plugins/pinecone/plugin.d.ts +2 -0
- package/dist/types/plugins.d.ts +20 -0
- package/dist/types/recording/ExecutionRecorder.d.ts +25 -0
- package/dist/types/recording/RecordedEvents.d.ts +100 -0
- package/dist/types/utils/assertNever.d.ts +1 -0
- package/dist/types/utils/base64.d.ts +2 -0
- package/dist/types/utils/chatMessageToOpenAIChatCompletionMessage.d.ts +3 -0
- package/dist/types/utils/coerceType.d.ts +6 -0
- package/dist/types/utils/compatibility.d.ts +3 -0
- package/dist/types/utils/copyToClipboard.d.ts +1 -0
- package/dist/types/utils/defaults.d.ts +2 -0
- package/dist/types/utils/errors.d.ts +2 -0
- package/dist/types/utils/expectType.d.ts +3 -0
- package/dist/types/utils/fetchEventSource.d.ts +12 -0
- package/dist/types/utils/genericUtilFunctions.d.ts +21 -0
- package/dist/types/utils/getPluginConfig.d.ts +2 -0
- package/dist/types/utils/handleEscapeCharacters.d.ts +2 -0
- package/dist/types/utils/index.d.ts +14 -0
- package/dist/types/utils/inputs.d.ts +3 -0
- package/dist/types/utils/interpolation.d.ts +1 -0
- package/dist/types/utils/misc.d.ts +1 -0
- package/dist/types/utils/newId.d.ts +1 -0
- package/dist/types/utils/openai.d.ts +739 -0
- package/dist/types/utils/outputs.d.ts +3 -0
- package/dist/types/utils/serialization/serialization.d.ts +12 -0
- package/dist/types/utils/serialization/serializationUtils.d.ts +6 -0
- package/dist/types/utils/serialization/serialization_v1.d.ts +3 -0
- package/dist/types/utils/serialization/serialization_v2.d.ts +3 -0
- package/dist/types/utils/serialization/serialization_v3.d.ts +19 -0
- package/dist/types/utils/serialization/serialization_v4.d.ts +9 -0
- package/dist/types/utils/symbols.d.ts +3 -0
- package/dist/types/utils/time.d.ts +22 -0
- package/dist/types/utils/typeSafety.d.ts +37 -0
- package/package.json +97 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
2
|
+
import { dedent } from 'ts-dedent';
|
|
3
|
+
import {} from '../../index.js';
|
|
4
|
+
import { pluginNodeDefinition } from '../../model/NodeDefinition.js';
|
|
5
|
+
import { getClient, getLemurParams, lemurEditorDefinitions, lemurInputDefinitions, } from './lemurHelpers.js';
|
|
6
|
+
export const LemurActionItemsNodeImpl = {
|
|
7
|
+
create() {
|
|
8
|
+
const chartNode = {
|
|
9
|
+
type: 'assemblyAiLemurActionItems',
|
|
10
|
+
title: 'LeMUR Action Items',
|
|
11
|
+
id: nanoid(),
|
|
12
|
+
visualData: {
|
|
13
|
+
x: 0,
|
|
14
|
+
y: 0,
|
|
15
|
+
width: 250,
|
|
16
|
+
},
|
|
17
|
+
data: {
|
|
18
|
+
final_model: 'default',
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
return chartNode;
|
|
22
|
+
},
|
|
23
|
+
getInputDefinitions() {
|
|
24
|
+
return [
|
|
25
|
+
...lemurInputDefinitions,
|
|
26
|
+
{
|
|
27
|
+
id: 'context',
|
|
28
|
+
dataType: 'string',
|
|
29
|
+
title: 'Context',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
},
|
|
33
|
+
getOutputDefinitions() {
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
dataType: 'string',
|
|
37
|
+
id: 'response',
|
|
38
|
+
title: 'Response',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
},
|
|
42
|
+
getEditors() {
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
type: 'string',
|
|
46
|
+
label: 'Context',
|
|
47
|
+
dataKey: 'context',
|
|
48
|
+
},
|
|
49
|
+
...lemurEditorDefinitions,
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
getBody() {
|
|
53
|
+
return '';
|
|
54
|
+
},
|
|
55
|
+
getUIData() {
|
|
56
|
+
return {
|
|
57
|
+
infoBoxBody: dedent `Use AssemblyAI LeMUR Action Items to extract action items`,
|
|
58
|
+
infoBoxTitle: 'Use AssemblyAI LeMUR Action Items',
|
|
59
|
+
contextMenuTitle: 'LeMUR Action Items',
|
|
60
|
+
group: ['AI', 'AssemblyAI'],
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
async process(data, inputs, context) {
|
|
64
|
+
const client = getClient(context);
|
|
65
|
+
const params = getLemurParams(inputs, data);
|
|
66
|
+
const { response } = await client.lemur.actionItems(params);
|
|
67
|
+
return {
|
|
68
|
+
['response']: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
value: response,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
export const lemurActionItemsNode = pluginNodeDefinition(LemurActionItemsNodeImpl, 'LeMUR Action Items');
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
2
|
+
import { dedent } from 'ts-dedent';
|
|
3
|
+
import {} from '../../index.js';
|
|
4
|
+
import { getClient, getLemurParams, lemurEditorDefinitions, lemurInputDefinitions, } from './lemurHelpers.js';
|
|
5
|
+
import { coerceType } from '../../utils/coerceType.js';
|
|
6
|
+
import { pluginNodeDefinition } from '../../model/NodeDefinition.js';
|
|
7
|
+
import { AssemblyAI } from 'assemblyai';
|
|
8
|
+
export const LemurQaNodeImpl = {
|
|
9
|
+
create() {
|
|
10
|
+
const chartNode = {
|
|
11
|
+
type: 'assemblyAiLemurQa',
|
|
12
|
+
title: 'LeMUR Question & Answers',
|
|
13
|
+
id: nanoid(),
|
|
14
|
+
visualData: {
|
|
15
|
+
x: 0,
|
|
16
|
+
y: 0,
|
|
17
|
+
width: 250,
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
final_model: 'default',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return chartNode;
|
|
24
|
+
},
|
|
25
|
+
getInputDefinitions() {
|
|
26
|
+
return [
|
|
27
|
+
...lemurInputDefinitions,
|
|
28
|
+
{
|
|
29
|
+
id: 'questions',
|
|
30
|
+
dataType: ['string', 'string[]', 'object', 'object[]', 'any', 'any[]'],
|
|
31
|
+
title: 'Questions',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'context',
|
|
35
|
+
dataType: 'string',
|
|
36
|
+
title: 'Context',
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
},
|
|
40
|
+
getOutputDefinitions() {
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
dataType: 'object[]',
|
|
44
|
+
id: 'response',
|
|
45
|
+
title: 'Response',
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
},
|
|
49
|
+
getEditors() {
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
type: 'string',
|
|
53
|
+
label: 'Context',
|
|
54
|
+
dataKey: 'context',
|
|
55
|
+
},
|
|
56
|
+
...lemurEditorDefinitions,
|
|
57
|
+
{
|
|
58
|
+
type: 'string',
|
|
59
|
+
label: 'Questions Answer Format',
|
|
60
|
+
dataKey: 'questions_answer_format',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: 'string',
|
|
64
|
+
label: 'Questions Context',
|
|
65
|
+
dataKey: 'questions_context',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'string',
|
|
69
|
+
label: 'Questions Answer Options',
|
|
70
|
+
dataKey: 'questions_answer_options',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
},
|
|
74
|
+
getBody() {
|
|
75
|
+
return '';
|
|
76
|
+
},
|
|
77
|
+
getUIData() {
|
|
78
|
+
return {
|
|
79
|
+
infoBoxBody: dedent `Use AssemblyAI LeMUR to ask questions about transcripts`,
|
|
80
|
+
infoBoxTitle: 'Use AssemblyAI LeMUR Question & Answer',
|
|
81
|
+
contextMenuTitle: 'LeMUR Q&A',
|
|
82
|
+
group: ['AI', 'AssemblyAI'],
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
async process(data, inputs, context) {
|
|
86
|
+
const client = getClient(context);
|
|
87
|
+
const questions = getQuestions(inputs).map((question) => applyQuestionEditors(data, question));
|
|
88
|
+
const params = {
|
|
89
|
+
questions,
|
|
90
|
+
...getLemurParams(inputs, data),
|
|
91
|
+
};
|
|
92
|
+
const { response } = await client.lemur.questionAnswer(params);
|
|
93
|
+
return {
|
|
94
|
+
['response']: {
|
|
95
|
+
type: 'object[]',
|
|
96
|
+
value: response,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
function getQuestions(inputs) {
|
|
102
|
+
const input = inputs['questions'];
|
|
103
|
+
if (!input)
|
|
104
|
+
throw new Error('Questions are required.');
|
|
105
|
+
if (input.type === 'string') {
|
|
106
|
+
return [
|
|
107
|
+
{
|
|
108
|
+
question: coerceType(input, 'string'),
|
|
109
|
+
},
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
else if (input.type === 'string[]') {
|
|
113
|
+
return coerceType(input, 'string[]').map((question) => ({ question }));
|
|
114
|
+
}
|
|
115
|
+
else if (input.type === 'object') {
|
|
116
|
+
return [coerceType(input, 'object')];
|
|
117
|
+
}
|
|
118
|
+
else if (input.type === 'object[]') {
|
|
119
|
+
return coerceType(input, 'object[]');
|
|
120
|
+
}
|
|
121
|
+
else if (input.type === 'any' && typeof input.value === 'string') {
|
|
122
|
+
return [
|
|
123
|
+
{
|
|
124
|
+
question: coerceType(input, 'string'),
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
else if ((input.type === 'any' && Array.isArray(input.value)) || input.type === 'any[]') {
|
|
129
|
+
return input.value.map((question) => {
|
|
130
|
+
if (typeof question === 'string') {
|
|
131
|
+
return { question };
|
|
132
|
+
}
|
|
133
|
+
else if (typeof question === 'object') {
|
|
134
|
+
return question;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
throw new Error('Question must be a string or object.');
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
throw new Error('Questions must be a string, string[], a question object, or an array of question objects.');
|
|
142
|
+
}
|
|
143
|
+
function applyQuestionEditors(data, question) {
|
|
144
|
+
if (!('answer_format' in question) && data.questions_answer_format) {
|
|
145
|
+
question.answer_format = data.questions_answer_format;
|
|
146
|
+
}
|
|
147
|
+
if (!('answer_options' in question) && data.questions_answer_options) {
|
|
148
|
+
question.answer_options = data.questions_answer_options.split(';');
|
|
149
|
+
}
|
|
150
|
+
if (!('context' in question) && data.questions_context) {
|
|
151
|
+
question.context = data.questions_context;
|
|
152
|
+
}
|
|
153
|
+
return question;
|
|
154
|
+
}
|
|
155
|
+
export const lemurQaNode = pluginNodeDefinition(LemurQaNodeImpl, 'LeMUR Q&A');
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
2
|
+
import { dedent } from 'ts-dedent';
|
|
3
|
+
import { AssemblyAI } from 'assemblyai';
|
|
4
|
+
import {} from '../../index.js';
|
|
5
|
+
import { getClient, getLemurParams, lemurEditorDefinitions, lemurInputDefinitions, } from './lemurHelpers.js';
|
|
6
|
+
import { pluginNodeDefinition } from '../../model/NodeDefinition.js';
|
|
7
|
+
export const LemurSummaryNodeImpl = {
|
|
8
|
+
create() {
|
|
9
|
+
const chartNode = {
|
|
10
|
+
type: 'assemblyAiLemurSummary',
|
|
11
|
+
title: 'LeMUR Summary',
|
|
12
|
+
id: nanoid(),
|
|
13
|
+
visualData: {
|
|
14
|
+
x: 0,
|
|
15
|
+
y: 0,
|
|
16
|
+
width: 250,
|
|
17
|
+
},
|
|
18
|
+
data: {
|
|
19
|
+
final_model: 'default',
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
return chartNode;
|
|
23
|
+
},
|
|
24
|
+
getInputDefinitions() {
|
|
25
|
+
return [
|
|
26
|
+
...lemurInputDefinitions,
|
|
27
|
+
{
|
|
28
|
+
id: 'context',
|
|
29
|
+
dataType: 'string',
|
|
30
|
+
title: 'Context',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
},
|
|
34
|
+
getOutputDefinitions() {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
dataType: 'string',
|
|
38
|
+
id: 'response',
|
|
39
|
+
title: 'Response',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
},
|
|
43
|
+
getEditors() {
|
|
44
|
+
return [
|
|
45
|
+
{
|
|
46
|
+
type: 'string',
|
|
47
|
+
label: 'Context',
|
|
48
|
+
dataKey: 'context',
|
|
49
|
+
},
|
|
50
|
+
...lemurEditorDefinitions,
|
|
51
|
+
];
|
|
52
|
+
},
|
|
53
|
+
getBody() {
|
|
54
|
+
return '';
|
|
55
|
+
},
|
|
56
|
+
getUIData() {
|
|
57
|
+
return {
|
|
58
|
+
infoBoxBody: dedent `Use AssemblyAI LeMUR Summary to summarize transcripts`,
|
|
59
|
+
infoBoxTitle: 'Use AssemblyAI LeMUR Summary',
|
|
60
|
+
contextMenuTitle: 'LeMUR Summary',
|
|
61
|
+
group: ['AI', 'AssemblyAI'],
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
async process(data, inputs, context) {
|
|
65
|
+
const client = getClient(context);
|
|
66
|
+
const params = getLemurParams(inputs, data);
|
|
67
|
+
if (data.answer_format) {
|
|
68
|
+
params.answer_format = data.answer_format;
|
|
69
|
+
}
|
|
70
|
+
const { response } = await client.lemur.summary(params);
|
|
71
|
+
return {
|
|
72
|
+
['response']: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
value: response,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
export const lemurSummaryNode = pluginNodeDefinition(LemurSummaryNodeImpl, 'LeMUR Summary');
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
2
|
+
import { dedent } from 'ts-dedent';
|
|
3
|
+
import {} from 'assemblyai';
|
|
4
|
+
import {} from '../../index.js';
|
|
5
|
+
import { getClient, getLemurParams, lemurEditorDefinitions, lemurInputDefinitions, } from './lemurHelpers.js';
|
|
6
|
+
import { pluginNodeDefinition } from '../../model/NodeDefinition.js';
|
|
7
|
+
import { coerceTypeOptional } from '../../utils/coerceType.js';
|
|
8
|
+
export const LemurTaskNodeImpl = {
|
|
9
|
+
create() {
|
|
10
|
+
const chartNode = {
|
|
11
|
+
type: 'assemblyAiLemurTask',
|
|
12
|
+
title: 'LeMUR Task',
|
|
13
|
+
id: nanoid(),
|
|
14
|
+
visualData: {
|
|
15
|
+
x: 0,
|
|
16
|
+
y: 0,
|
|
17
|
+
width: 250,
|
|
18
|
+
},
|
|
19
|
+
data: {
|
|
20
|
+
final_model: 'default',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return chartNode;
|
|
24
|
+
},
|
|
25
|
+
getInputDefinitions() {
|
|
26
|
+
return [
|
|
27
|
+
...lemurInputDefinitions,
|
|
28
|
+
{
|
|
29
|
+
id: 'prompt',
|
|
30
|
+
dataType: 'string',
|
|
31
|
+
title: 'Prompt',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
},
|
|
35
|
+
getOutputDefinitions() {
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
dataType: 'string',
|
|
39
|
+
id: 'response',
|
|
40
|
+
title: 'Response',
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
},
|
|
44
|
+
getEditors() {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
type: 'string',
|
|
48
|
+
label: 'Prompt',
|
|
49
|
+
dataKey: 'prompt',
|
|
50
|
+
},
|
|
51
|
+
...lemurEditorDefinitions,
|
|
52
|
+
];
|
|
53
|
+
},
|
|
54
|
+
getBody() {
|
|
55
|
+
return '';
|
|
56
|
+
},
|
|
57
|
+
getUIData() {
|
|
58
|
+
return {
|
|
59
|
+
infoBoxBody: dedent `Use AssemblyAI LeMUR Custom Task to ask anything.`,
|
|
60
|
+
infoBoxTitle: 'Use AssemblyAI LeMUR Custom Task',
|
|
61
|
+
contextMenuTitle: 'LeMUR Custom Task',
|
|
62
|
+
group: ['AI', 'AssemblyAI'],
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
async process(data, inputs, context) {
|
|
66
|
+
const client = getClient(context);
|
|
67
|
+
const params = {
|
|
68
|
+
prompt: coerceTypeOptional(inputs['prompt'], 'string') || data.prompt || '',
|
|
69
|
+
...getLemurParams(inputs, data),
|
|
70
|
+
};
|
|
71
|
+
if (!params.prompt)
|
|
72
|
+
throw new Error('Prompt must be provided.');
|
|
73
|
+
const { response } = await client.lemur.task(params);
|
|
74
|
+
return {
|
|
75
|
+
['response']: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
value: response,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
export const lemurTaskNode = pluginNodeDefinition(LemurTaskNodeImpl, 'LeMUR Task');
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { nanoid } from 'nanoid/non-secure';
|
|
2
|
+
import { dedent } from 'ts-dedent';
|
|
3
|
+
import {} from '../../index.js';
|
|
4
|
+
import { getClient } from './lemurHelpers.js';
|
|
5
|
+
import { pluginNodeDefinition } from '../../model/NodeDefinition.js';
|
|
6
|
+
import { coerceType } from '../../utils/coerceType.js';
|
|
7
|
+
export const TranscribeAudioNodeImpl = {
|
|
8
|
+
create() {
|
|
9
|
+
const chartNode = {
|
|
10
|
+
type: 'assemblyAiTranscribeAudio',
|
|
11
|
+
title: 'Transcribe Audio',
|
|
12
|
+
id: nanoid(),
|
|
13
|
+
visualData: {
|
|
14
|
+
x: 0,
|
|
15
|
+
y: 0,
|
|
16
|
+
width: 250,
|
|
17
|
+
},
|
|
18
|
+
data: {},
|
|
19
|
+
};
|
|
20
|
+
return chartNode;
|
|
21
|
+
},
|
|
22
|
+
getInputDefinitions() {
|
|
23
|
+
return [
|
|
24
|
+
{
|
|
25
|
+
id: 'audio',
|
|
26
|
+
dataType: ['audio', 'string'],
|
|
27
|
+
title: 'Audio',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
getOutputDefinitions() {
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
dataType: 'string',
|
|
35
|
+
id: 'text',
|
|
36
|
+
title: 'Transcript text',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
dataType: 'string',
|
|
40
|
+
id: 'id',
|
|
41
|
+
title: 'Transcript ID',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
dataType: 'object',
|
|
45
|
+
id: 'transcript',
|
|
46
|
+
title: 'Transcript object',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
},
|
|
50
|
+
getEditors() {
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
type: 'code',
|
|
54
|
+
label: 'Transcript Parameters (JSON)',
|
|
55
|
+
language: 'json',
|
|
56
|
+
dataKey: 'transcriptParameters',
|
|
57
|
+
helperMessage: `Configure additional parameters using a JSON object. This will override any other fields you have set.
|
|
58
|
+
For a detailed list of parameters, see [the AssemblyAI API documentation](https://www.assemblyai.com/docs/api-reference/transcripts/submit?utm_source=rivet).`,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
},
|
|
62
|
+
getBody() {
|
|
63
|
+
return '';
|
|
64
|
+
},
|
|
65
|
+
getUIData() {
|
|
66
|
+
return {
|
|
67
|
+
infoBoxBody: dedent `Use AssemblyAI to transcribe audio`,
|
|
68
|
+
infoBoxTitle: 'Transcribe Audio Node',
|
|
69
|
+
contextMenuTitle: 'Transcribe Audio',
|
|
70
|
+
group: ['AI', 'AssemblyAI'],
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
async process(data, inputs, context) {
|
|
74
|
+
const input = inputs['audio'];
|
|
75
|
+
if (!input)
|
|
76
|
+
throw new Error('Audio input is required.');
|
|
77
|
+
const client = getClient(context);
|
|
78
|
+
let audioUrl;
|
|
79
|
+
if (input.type === 'audio') {
|
|
80
|
+
const audio = coerceType(inputs['audio'], 'audio');
|
|
81
|
+
audioUrl = await client.files.upload(audio.data);
|
|
82
|
+
}
|
|
83
|
+
else if (input.type === 'string' || input.type === 'any') {
|
|
84
|
+
audioUrl = coerceType(inputs['audio'], 'string');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
throw new Error('Audio input must be audio or string containing the audio URL.');
|
|
88
|
+
}
|
|
89
|
+
let transcriptParams = { audio: audioUrl };
|
|
90
|
+
transcriptParams = { ...transcriptParams, ...getAdditionalParameters(data) };
|
|
91
|
+
const transcript = await client.transcripts.transcribe(transcriptParams);
|
|
92
|
+
return {
|
|
93
|
+
['text']: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
value: transcript.text,
|
|
96
|
+
},
|
|
97
|
+
['id']: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
value: transcript.id,
|
|
100
|
+
},
|
|
101
|
+
['transcript']: {
|
|
102
|
+
type: 'object',
|
|
103
|
+
value: transcript,
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
export const transcribeAudioNode = pluginNodeDefinition(TranscribeAudioNodeImpl, 'Transcribe Audio');
|
|
109
|
+
function getAdditionalParameters(data) {
|
|
110
|
+
const transcriptParams = data.transcriptParameters?.trim();
|
|
111
|
+
if (!transcriptParams) {
|
|
112
|
+
return {};
|
|
113
|
+
}
|
|
114
|
+
let transcriptParamsObj;
|
|
115
|
+
try {
|
|
116
|
+
transcriptParamsObj = JSON.parse(transcriptParams);
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
throw new Error('The transcript parameters field has to be a valid JSON object, or empty.'); // This message is surfaced to the user
|
|
120
|
+
}
|
|
121
|
+
if (Array.isArray(transcriptParamsObj)) {
|
|
122
|
+
throw new Error('The transcript parameters field should be a JSON object, but is a JSON array'); // This message is surfaced to the user
|
|
123
|
+
}
|
|
124
|
+
return transcriptParamsObj;
|
|
125
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { AssemblyAI } from 'assemblyai';
|
|
2
|
+
import {} from '../../index.js';
|
|
3
|
+
import { coerceType, coerceTypeOptional } from '../../utils/coerceType.js';
|
|
4
|
+
function getTranscriptIds(inputs) {
|
|
5
|
+
const input = inputs['transcript_ids'];
|
|
6
|
+
if (!input)
|
|
7
|
+
return undefined;
|
|
8
|
+
if (input.type === 'string' || (input.type === 'any' && typeof input.value === 'string')) {
|
|
9
|
+
return [coerceType(input, 'string')];
|
|
10
|
+
}
|
|
11
|
+
else if (input.type === 'string[]' ||
|
|
12
|
+
input.type === 'any[]' ||
|
|
13
|
+
(input.type === 'any' && Array.isArray(input.value))) {
|
|
14
|
+
return coerceType(input, 'string[]');
|
|
15
|
+
}
|
|
16
|
+
throw new Error('Transcript IDs must be a string or string[] of transcript IDs.');
|
|
17
|
+
}
|
|
18
|
+
const userAgent = {
|
|
19
|
+
integration: {
|
|
20
|
+
name: 'Rivet',
|
|
21
|
+
version: '1.0.1',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export function getClient(context) {
|
|
25
|
+
const apiKey = context.getPluginConfig('assemblyAiApiKey');
|
|
26
|
+
if (!apiKey) {
|
|
27
|
+
throw new Error('AssemblyAI API key not set.');
|
|
28
|
+
}
|
|
29
|
+
return new AssemblyAI({ apiKey, userAgent });
|
|
30
|
+
}
|
|
31
|
+
export function getLemurParams(inputs, editorData) {
|
|
32
|
+
const params = {
|
|
33
|
+
transcript_ids: getTranscriptIds(inputs),
|
|
34
|
+
input_text: coerceTypeOptional(inputs['input_text'], 'string'),
|
|
35
|
+
context: coerceTypeOptional(inputs['context'], 'string') || editorData.context || undefined,
|
|
36
|
+
final_model: editorData.final_model && editorData.final_model !== 'default' ? editorData.final_model : undefined,
|
|
37
|
+
max_output_size: editorData.max_output_size,
|
|
38
|
+
temperature: editorData.temperature,
|
|
39
|
+
};
|
|
40
|
+
return params;
|
|
41
|
+
}
|
|
42
|
+
export const lemurInputDefinitions = [
|
|
43
|
+
{
|
|
44
|
+
id: 'transcript_ids',
|
|
45
|
+
dataType: ['string', 'string[]', 'any', 'any[]'],
|
|
46
|
+
title: 'Transcript IDs',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'input_text',
|
|
50
|
+
dataType: ['string'],
|
|
51
|
+
title: 'Input Text',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
export const lemurEditorDefinitions = [
|
|
55
|
+
{
|
|
56
|
+
type: 'dropdown',
|
|
57
|
+
label: 'Final Model',
|
|
58
|
+
dataKey: 'final_model',
|
|
59
|
+
options: [
|
|
60
|
+
{
|
|
61
|
+
value: 'anthropic/claude-3-5-sonnet',
|
|
62
|
+
label: 'Claude 3.5 Sonnet (on Anthropic)',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: 'anthropic/claude-3-opus',
|
|
66
|
+
label: 'Claude 3 Opus (on Anthropic)',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
value: 'anthropic/claude-3-haiku',
|
|
70
|
+
label: 'Claude 3 Haiku (on Anthropic)',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: 'anthropic/claude-3-sonnet',
|
|
74
|
+
label: 'Claude 3 Sonnet (on Anthropic)',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: 'anthropic/claude-2-1',
|
|
78
|
+
label: 'Claude 2.1 (on Anthropic)',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
value: 'anthropic/claude-2',
|
|
82
|
+
label: 'Claude 2.1 (on Anthropic)',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
value: 'default',
|
|
86
|
+
label: 'Default',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
value: 'anthropic/claude-instant-1-2',
|
|
90
|
+
label: 'Claude Instant 1.2 (on Anthropic)',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
value: 'basic',
|
|
94
|
+
label: 'Basic',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
value: 'assemblyai/mistral-7b',
|
|
98
|
+
label: 'Mistral 7B (hosted by AssemblyAI)',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: 'number',
|
|
104
|
+
label: 'Maximum Output Size',
|
|
105
|
+
dataKey: 'max_output_size',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: 'number',
|
|
109
|
+
label: 'Temperature',
|
|
110
|
+
dataKey: 'temperature',
|
|
111
|
+
min: 0,
|
|
112
|
+
max: 1,
|
|
113
|
+
},
|
|
114
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {} from '../../index.js';
|
|
2
|
+
import { lemurQaNode } from './LemurQaNode.js';
|
|
3
|
+
import { transcribeAudioNode } from './TranscribeAudioNode.js';
|
|
4
|
+
import { lemurSummaryNode } from './LemurSummaryNode.js';
|
|
5
|
+
import { lemurTaskNode } from './LemurTaskNode.js';
|
|
6
|
+
import { lemurActionItemsNode } from './LemurActionItemsNode.js';
|
|
7
|
+
export const assemblyAiPlugin = {
|
|
8
|
+
id: 'assemblyAi',
|
|
9
|
+
name: 'AssemblyAI',
|
|
10
|
+
register: (register) => {
|
|
11
|
+
register(transcribeAudioNode);
|
|
12
|
+
register(lemurSummaryNode);
|
|
13
|
+
register(lemurQaNode);
|
|
14
|
+
register(lemurTaskNode);
|
|
15
|
+
register(lemurActionItemsNode);
|
|
16
|
+
},
|
|
17
|
+
configSpec: {
|
|
18
|
+
assemblyAiApiKey: {
|
|
19
|
+
type: 'secret',
|
|
20
|
+
label: 'AssemblyAI API Key',
|
|
21
|
+
description: 'The API key for the AssemblyAI service.',
|
|
22
|
+
pullEnvironmentVariable: 'ASSEMBLYAI_API_KEY',
|
|
23
|
+
helperText: 'You may also set the ASSEMBLYAI_API_KEY environment variable.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
contextMenuGroups: [
|
|
27
|
+
{
|
|
28
|
+
id: 'add-node-group:assemblyai',
|
|
29
|
+
label: 'AssemblyAI',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|