@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,55 @@
|
|
|
1
|
+
import type { Inputs, Outputs } from './GraphProcessor.js';
|
|
2
|
+
import type { ChartNode, NodeConnection, NodeId, NodeInputDefinition, NodeOutputDefinition } from './NodeBase.js';
|
|
3
|
+
import type { Project } from './Project.js';
|
|
4
|
+
import type { InternalProcessContext } from './ProcessContext.js';
|
|
5
|
+
import type { EditorDefinition } from './EditorDefinition.js';
|
|
6
|
+
import type { NodeBodySpec } from './NodeBodySpec.js';
|
|
7
|
+
import type { RivetUIContext } from './RivetUIContext.js';
|
|
8
|
+
export interface PluginNodeImpl<T extends ChartNode> {
|
|
9
|
+
getInputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
10
|
+
getOutputDefinitions(data: T['data'], connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
11
|
+
process(data: T['data'], inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
12
|
+
getEditors(data: T['data'], context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
13
|
+
getBody(data: T['data'], context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
14
|
+
create(): T;
|
|
15
|
+
getUIData(context: RivetUIContext): NodeUIData | Promise<NodeUIData>;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class NodeImpl<T extends ChartNode, Type extends T['type'] = T['type']> {
|
|
18
|
+
readonly chartNode: T;
|
|
19
|
+
constructor(chartNode: T);
|
|
20
|
+
get id(): string;
|
|
21
|
+
get type(): Type;
|
|
22
|
+
get title(): string;
|
|
23
|
+
get visualData(): {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
get data(): T['data'];
|
|
28
|
+
abstract getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
29
|
+
abstract getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
30
|
+
abstract process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
31
|
+
getEditors(_context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
32
|
+
getBody(_context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
33
|
+
}
|
|
34
|
+
export type NodeBody = string | NodeBodySpec | NodeBodySpec[] | undefined;
|
|
35
|
+
export declare class PluginNodeImplClass<T extends ChartNode, Type extends T['type'] = T['type']> extends NodeImpl<T, Type> {
|
|
36
|
+
readonly impl: PluginNodeImpl<T>;
|
|
37
|
+
constructor(chartNode: T, impl: PluginNodeImpl<T>);
|
|
38
|
+
getInputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeInputDefinition[];
|
|
39
|
+
getOutputDefinitions(connections: NodeConnection[], nodes: Record<NodeId, ChartNode>, project: Project): NodeOutputDefinition[];
|
|
40
|
+
process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
41
|
+
getEditors(context: RivetUIContext): EditorDefinition<T>[] | Promise<EditorDefinition<T>[]>;
|
|
42
|
+
getBody(context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
43
|
+
}
|
|
44
|
+
export type NodeUIData = {
|
|
45
|
+
contextMenuTitle?: string;
|
|
46
|
+
infoBoxTitle?: string;
|
|
47
|
+
infoBoxBody?: string;
|
|
48
|
+
infoBoxImageUri?: string;
|
|
49
|
+
group?: string | string[];
|
|
50
|
+
};
|
|
51
|
+
export type NodeImplConstructor<T extends ChartNode> = {
|
|
52
|
+
new (chartNode: T, pluginImpl: PluginNodeImpl<T> | undefined): NodeImpl<T>;
|
|
53
|
+
create(pluginImpl?: PluginNodeImpl<T>): T;
|
|
54
|
+
getUIData(context: RivetUIContext): NodeUIData | Promise<NodeUIData>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ChartNode, type NodeImplConstructor, type NodeImpl } from '../index.js';
|
|
2
|
+
import type { NodeDefinition, PluginNodeDefinition } from './NodeDefinition.js';
|
|
3
|
+
import { type RivetPlugin } from './RivetPlugin.js';
|
|
4
|
+
export declare class NodeRegistration<NodeTypes extends string = never, Nodes extends ChartNode = never> {
|
|
5
|
+
#private;
|
|
6
|
+
NodesType: Nodes;
|
|
7
|
+
NodeTypesType: NodeTypes;
|
|
8
|
+
register<T extends ChartNode>(definition: NodeDefinition<T>, plugin?: RivetPlugin): NodeRegistration<NodeTypes | T['type'], Nodes | T>;
|
|
9
|
+
registerPluginNode<T extends ChartNode>(definition: PluginNodeDefinition<T>, plugin: RivetPlugin): NodeRegistration<NodeTypes | T['type'], Nodes | T>;
|
|
10
|
+
registerPlugin(plugin: RivetPlugin): void;
|
|
11
|
+
create<T extends NodeTypes>(type: T): Extract<Nodes, {
|
|
12
|
+
type: T;
|
|
13
|
+
}>;
|
|
14
|
+
createDynamic(type: string): ChartNode;
|
|
15
|
+
createImpl<T extends Nodes>(node: T): NodeImpl<T>;
|
|
16
|
+
createDynamicImpl(node: ChartNode): NodeImpl<ChartNode>;
|
|
17
|
+
getDisplayName<T extends NodeTypes>(type: T): string;
|
|
18
|
+
getDynamicDisplayName(type: string): string;
|
|
19
|
+
isRegistered(type: NodeTypes): boolean;
|
|
20
|
+
getNodeTypes(): NodeTypes[];
|
|
21
|
+
getNodeConstructors(): NodeImplConstructor<ChartNode>[];
|
|
22
|
+
getPluginFor(type: string): RivetPlugin | undefined;
|
|
23
|
+
getPlugins(): RivetPlugin[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { NodeRegistration } from './NodeRegistration.js';
|
|
2
|
+
export * from './nodes/UserInputNode.js';
|
|
3
|
+
export * from './nodes/TextNode.js';
|
|
4
|
+
export * from './nodes/ChatNode.js';
|
|
5
|
+
export * from './nodes/PromptNode.js';
|
|
6
|
+
export * from './nodes/ExtractRegexNode.js';
|
|
7
|
+
export * from './nodes/CodeNode.js';
|
|
8
|
+
export * from './nodes/MatchNode.js';
|
|
9
|
+
export * from './nodes/IfNode.js';
|
|
10
|
+
export * from './nodes/ReadDirectoryNode.js';
|
|
11
|
+
export * from './nodes/ReadFileNode.js';
|
|
12
|
+
export * from './nodes/IfElseNode.js';
|
|
13
|
+
export * from './nodes/ChunkNode.js';
|
|
14
|
+
export * from './nodes/GraphInputNode.js';
|
|
15
|
+
export * from './nodes/GraphOutputNode.js';
|
|
16
|
+
export * from './nodes/SubGraphNode.js';
|
|
17
|
+
export * from './nodes/ArrayNode.js';
|
|
18
|
+
export * from './nodes/ExtractJsonNode.js';
|
|
19
|
+
export * from './nodes/ExtractYamlNode.js';
|
|
20
|
+
export * from './nodes/AssemblePromptNode.js';
|
|
21
|
+
export * from './nodes/LoopControllerNode.js';
|
|
22
|
+
export * from './nodes/TrimChatMessagesNode.js';
|
|
23
|
+
export * from './nodes/ExternalCallNode.js';
|
|
24
|
+
export * from './nodes/ExtractObjectPathNode.js';
|
|
25
|
+
export * from './nodes/RaiseEventNode.js';
|
|
26
|
+
export * from './nodes/ContextNode.js';
|
|
27
|
+
export * from './nodes/CoalesceNode.js';
|
|
28
|
+
export * from './nodes/PassthroughNode.js';
|
|
29
|
+
export * from './nodes/PopNode.js';
|
|
30
|
+
export * from './nodes/SetGlobalNode.js';
|
|
31
|
+
export * from './nodes/GetGlobalNode.js';
|
|
32
|
+
export * from './nodes/WaitForEventNode.js';
|
|
33
|
+
export * from './nodes/GptFunctionNode.js';
|
|
34
|
+
export * from './nodes/ToYamlNode.js';
|
|
35
|
+
export * from './nodes/GetEmbeddingNode.js';
|
|
36
|
+
export * from './nodes/VectorStoreNode.js';
|
|
37
|
+
export * from './nodes/VectorNearestNeighborsNode.js';
|
|
38
|
+
export * from './nodes/HashNode.js';
|
|
39
|
+
export * from './nodes/AbortGraphNode.js';
|
|
40
|
+
export * from './nodes/RaceInputsNode.js';
|
|
41
|
+
export * from './nodes/ToJsonNode.js';
|
|
42
|
+
export * from './nodes/JoinNode.js';
|
|
43
|
+
export * from './nodes/FilterNode.js';
|
|
44
|
+
export * from './nodes/ObjectNode.js';
|
|
45
|
+
export * from './nodes/BooleanNode.js';
|
|
46
|
+
export * from './nodes/CompareNode.js';
|
|
47
|
+
export * from './nodes/EvaluateNode.js';
|
|
48
|
+
export * from './nodes/NumberNode.js';
|
|
49
|
+
export * from './nodes/RandomNumberNode.js';
|
|
50
|
+
export * from './nodes/ShuffleNode.js';
|
|
51
|
+
export * from './nodes/CommentNode.js';
|
|
52
|
+
export * from './nodes/ImageNode.js';
|
|
53
|
+
export * from './nodes/AudioNode.js';
|
|
54
|
+
export * from './nodes/HttpCallNode.js';
|
|
55
|
+
export * from './nodes/DelayNode.js';
|
|
56
|
+
export * from './nodes/AppendToDatasetNode.js';
|
|
57
|
+
export * from './nodes/CreateDatasetNode.js';
|
|
58
|
+
export * from './nodes/LoadDatasetNode.js';
|
|
59
|
+
export * from './nodes/GetAllDatasetsNode.js';
|
|
60
|
+
export * from './nodes/SplitNode.js';
|
|
61
|
+
export * from './nodes/DatasetNearestNeigborsNode.js';
|
|
62
|
+
export * from './nodes/GetDatasetRowNode.js';
|
|
63
|
+
export * from './nodes/SliceNode.js';
|
|
64
|
+
export * from './nodes/ExtractMarkdownCodeBlocksNode.js';
|
|
65
|
+
export * from './nodes/AssembleMessageNode.js';
|
|
66
|
+
export * from './nodes/URLReferenceNode.js';
|
|
67
|
+
export * from './nodes/DestructureNode.js';
|
|
68
|
+
export * from './nodes/ReplaceDatasetNode.js';
|
|
69
|
+
export * from './nodes/ListGraphsNode.js';
|
|
70
|
+
export * from './nodes/GraphReferenceNode.js';
|
|
71
|
+
export * from './nodes/CallGraphNode.js';
|
|
72
|
+
export * from './nodes/DelegateFunctionCallNode.js';
|
|
73
|
+
export * from './nodes/PlayAudioNode.js';
|
|
74
|
+
export * from './nodes/CallGraphNode.js';
|
|
75
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "code" | "array" | "userInput" | "prompt" | "text" | "chat" | "extractRegex" | "if" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "graphInput" | "graphOutput" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "setGlobal" | "raiseEvent" | "getGlobal" | "abortGraph" | "extractObjectPath" | "context" | "coalesce" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio", import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/GptFunctionNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode>;
|
|
76
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "code" | "array" | "userInput" | "prompt" | "text" | "chat" | "extractRegex" | "if" | "readDirectory" | "readFile" | "ifElse" | "chunk" | "graphInput" | "graphOutput" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "setGlobal" | "raiseEvent" | "getGlobal" | "abortGraph" | "extractObjectPath" | "context" | "coalesce" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio", import("./nodes/UserInputNode.js").UserInputNode | import("./nodes/TextNode.js").TextNode | import("./nodes/ChatNode.js").ChatNode | import("./nodes/PromptNode.js").PromptNode | import("./nodes/ExtractRegexNode.js").ExtractRegexNode | import("./nodes/CodeNode.js").CodeNode | import("./nodes/MatchNode.js").MatchNode | import("./nodes/IfNode.js").IfNode | import("./nodes/ReadDirectoryNode.js").ReadDirectoryNode | import("./nodes/ReadFileNode.js").ReadFileNode | import("./nodes/IfElseNode.js").IfElseNode | import("./nodes/ChunkNode.js").ChunkNode | import("./nodes/GraphInputNode.js").GraphInputNode | import("./nodes/GraphOutputNode.js").GraphOutputNode | import("./nodes/SubGraphNode.js").SubGraphNode | import("./nodes/ArrayNode.js").ArrayNode | import("./nodes/ExtractJsonNode.js").ExtractJsonNode | import("./nodes/AssemblePromptNode.js").AssemblePromptNode | import("./nodes/ExtractYamlNode.js").ExtractYamlNode | import("./nodes/LoopControllerNode.js").LoopControllerNode | import("./nodes/TrimChatMessagesNode.js").TrimChatMessagesNode | import("./nodes/ExternalCallNode.js").ExternalCallNode | import("./nodes/ExtractObjectPathNode.js").ExtractObjectPathNode | import("./nodes/RaiseEventNode.js").RaiseEventNode | import("./nodes/ContextNode.js").ContextNode | import("./nodes/CoalesceNode.js").CoalesceNode | import("./nodes/PassthroughNode.js").PassthroughNode | import("./nodes/PopNode.js").PopNode | import("./nodes/SetGlobalNode.js").SetGlobalNode | import("./nodes/GetGlobalNode.js").GetGlobalNode | import("./nodes/WaitForEventNode.js").WaitForEventNode | import("./nodes/GptFunctionNode.js").GptFunctionNode | import("./nodes/ToYamlNode.js").ToYamlNode | import("./nodes/GetEmbeddingNode.js").GetEmbeddingNode | import("./nodes/VectorStoreNode.js").VectorStoreNode | import("./nodes/VectorNearestNeighborsNode.js").VectorNearestNeighborsNode | import("./nodes/HashNode.js").HashNode | import("./nodes/AbortGraphNode.js").AbortGraphNode | import("./nodes/RaceInputsNode.js").RaceInputsNode | import("./nodes/ToJsonNode.js").ToJsonNode | import("./nodes/JoinNode.js").JoinNode | import("./nodes/FilterNode.js").FilterNode | import("./nodes/ObjectNode.js").ObjectNode | import("./nodes/BooleanNode.js").BooleanNode | import("./nodes/CompareNode.js").CompareNode | import("./nodes/EvaluateNode.js").EvaluateNode | import("./nodes/NumberNode.js").NumberNode | import("./nodes/RandomNumberNode.js").RandomNumberNode | import("./nodes/ShuffleNode.js").ShuffleNode | import("./nodes/CommentNode.js").CommentNode | import("./nodes/ImageNode.js").ImageNode | import("./nodes/AudioNode.js").AudioNode | import("./nodes/HttpCallNode.js").HttpCallNode | import("./nodes/DelayNode.js").DelayNode | import("./nodes/AppendToDatasetNode.js").AppendToDatasetNode | import("./nodes/CreateDatasetNode.js").CreateDatasetNode | import("./nodes/LoadDatasetNode.js").LoadDatasetNode | import("./nodes/GetAllDatasetsNode.js").GetAllDatasetsNode | import("./nodes/SplitNode.js").SplitNode | import("./nodes/DatasetNearestNeigborsNode.js").DatasetNearestNeighborsNode | import("./nodes/GetDatasetRowNode.js").GetDatasetRowNode | import("./nodes/SliceNode.js").SliceNode | import("./nodes/ExtractMarkdownCodeBlocksNode.js").ExtractMarkdownCodeBlocksNode | import("./nodes/AssembleMessageNode.js").AssembleMessageNode | import("./nodes/URLReferenceNode.js").UrlReferenceNode | import("./nodes/DestructureNode.js").DestructureNode | import("./nodes/ReplaceDatasetNode.js").ReplaceDatasetNode | import("./nodes/ListGraphsNode.js").ListGraphsNode | import("./nodes/GraphReferenceNode.js").GraphReferenceNode | import("./nodes/CallGraphNode.js").CallGraphNode | import("./nodes/DelegateFunctionCallNode.js").DelegateFunctionCallNode | import("./nodes/PlayAudioNode.js").PlayAudioNode>;
|
|
77
|
+
export { globalRivetNodeRegistry };
|
|
78
|
+
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
79
|
+
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
80
|
+
export type NodeOfType<T extends BuiltInNodeType> = Extract<BuiltInNodes, {
|
|
81
|
+
type: T;
|
|
82
|
+
}>;
|
|
83
|
+
/** Resets the global node registry to a fresh one with only built-in nodes registered. */
|
|
84
|
+
export declare function resetGlobalRivetNodeRegistry(): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type BuiltInPluginLoadSpec = {
|
|
2
|
+
type: 'built-in';
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
export type URIPluginLoadSpec = {
|
|
7
|
+
type: 'uri';
|
|
8
|
+
id: string;
|
|
9
|
+
uri: string;
|
|
10
|
+
};
|
|
11
|
+
export type PackagePluginLoadSpec = {
|
|
12
|
+
type: 'package';
|
|
13
|
+
id: string;
|
|
14
|
+
package: string;
|
|
15
|
+
tag: string;
|
|
16
|
+
};
|
|
17
|
+
export type PluginLoadSpec = URIPluginLoadSpec | BuiltInPluginLoadSpec | PackagePluginLoadSpec;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Opaque } from 'type-fest';
|
|
2
|
+
import { type Settings, type NativeApi, type Project, type DataValue, type ExternalFunction, type Outputs, type GraphId, type GraphProcessor, type ScalarOrArrayDataValue, type DatasetProvider, type ChartNode, type AttachedNodeData, type AudioProvider } from '../index.js';
|
|
3
|
+
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
4
|
+
export type ProcessContext = {
|
|
5
|
+
settings: Settings;
|
|
6
|
+
nativeApi?: NativeApi;
|
|
7
|
+
/** Sets the dataset provider to be used for all dataset node calls. */
|
|
8
|
+
datasetProvider?: DatasetProvider;
|
|
9
|
+
/** The provider responsible for being able to play audio. Undefined if unsupported in this context. */
|
|
10
|
+
audioProvider?: AudioProvider;
|
|
11
|
+
/** Sets the tokenizer that will be used for all nodes. If unset, the default GptTokenizerTokenizer will be used. */
|
|
12
|
+
tokenizer?: Tokenizer;
|
|
13
|
+
/**
|
|
14
|
+
* If implemented, chat nodes will first call this to resolve their configured endpoint to a final endpoint.
|
|
15
|
+
* You can use this for adding auth headers, or to load balance between multiple endpoints.
|
|
16
|
+
*/
|
|
17
|
+
getChatNodeEndpoint?: (configuredEndpoint: string, configuredModel: string) => ChatNodeEndpointInfo | Promise<ChatNodeEndpointInfo>;
|
|
18
|
+
};
|
|
19
|
+
export type ChatNodeEndpointInfo = {
|
|
20
|
+
endpoint: string;
|
|
21
|
+
headers: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
export type ProcessId = Opaque<string, 'ProcessId'>;
|
|
24
|
+
export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessContext & {
|
|
25
|
+
/** The executor that is running the current processor. */
|
|
26
|
+
executor: 'nodejs' | 'browser';
|
|
27
|
+
/** The project being executed. */
|
|
28
|
+
project: Project;
|
|
29
|
+
/** A signal that can be used when abort() is called on the GraphProcessor to abort the node's execution. */
|
|
30
|
+
signal: AbortSignal;
|
|
31
|
+
/** A unique ID for this specific execution of the node. */
|
|
32
|
+
processId: ProcessId;
|
|
33
|
+
/** Context values that are accessible on graphs and all subgraphs. */
|
|
34
|
+
contextValues: Record<string, DataValue>;
|
|
35
|
+
/** Inputs that were passed to the curent graph. Used for GraphInputNode. */
|
|
36
|
+
graphInputs: Record<string, DataValue>;
|
|
37
|
+
/** Outputs from the graph. A GraphOutputNode will set these. */
|
|
38
|
+
graphOutputs: Record<string, DataValue>;
|
|
39
|
+
/** The tokenizer to use to tokenize all strings.s */
|
|
40
|
+
tokenizer: Tokenizer;
|
|
41
|
+
/** The current node being executed. */
|
|
42
|
+
node: T;
|
|
43
|
+
/** For internal and advanced cases, gets the arbitrary data attached to the node during graph execution. */
|
|
44
|
+
attachedData: AttachedNodeData;
|
|
45
|
+
/** Raises a user event that can be listened for on the GraphProcessor. */
|
|
46
|
+
raiseEvent: (eventName: string, data: DataValue | undefined) => void;
|
|
47
|
+
waitEvent: (eventName: string) => Promise<DataValue | undefined>;
|
|
48
|
+
/** External functions that have been defined on the GraphProcessor (or its parent). */
|
|
49
|
+
externalFunctions: Record<string, ExternalFunction>;
|
|
50
|
+
/** Global cache shared by all nodes, is present for the entire execution of a graph (and shared in subgraphs). */
|
|
51
|
+
executionCache: Map<string, unknown>;
|
|
52
|
+
/** Call when the node has partial data but has not finished execution yet. */
|
|
53
|
+
onPartialOutputs?: (outputs: Outputs) => void;
|
|
54
|
+
/** Creates a subprocessor, for executing subgraphs. */
|
|
55
|
+
createSubProcessor: (subGraphId: GraphId | undefined, options?: {
|
|
56
|
+
signal?: AbortSignal;
|
|
57
|
+
}) => GraphProcessor;
|
|
58
|
+
/** Like context, but variables that are set during the run of the graph and can be read during the graph. Shared among all graphs and subgraphs. */
|
|
59
|
+
getGlobal: (id: string) => ScalarOrArrayDataValue | undefined;
|
|
60
|
+
/** Like context, but variables that are set during the run of the graph and can be read during the graph. Shared among all graphs and subgraphs. */
|
|
61
|
+
setGlobal: (id: string, value: ScalarOrArrayDataValue) => void;
|
|
62
|
+
waitForGlobal: (id: string) => Promise<ScalarOrArrayDataValue>;
|
|
63
|
+
/** Logs to GraphProcessor's trace event. */
|
|
64
|
+
trace: (message: string) => void;
|
|
65
|
+
/** Aborts the current graph, if there is an error, the graph is error aborted, and if undefined, then it is simply early-exited. */
|
|
66
|
+
abortGraph: (error?: Error | string) => void;
|
|
67
|
+
/** Gets a string plugin config value from the settings, falling back to a specified environment variable if set. */
|
|
68
|
+
getPluginConfig(name: string): string | undefined;
|
|
69
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Opaque } from 'type-fest';
|
|
2
|
+
import { type GraphId, type NodeGraph } from './NodeGraph.js';
|
|
3
|
+
import { type PluginLoadSpec } from './PluginLoadSpec.js';
|
|
4
|
+
export type ProjectId = Opaque<string, 'ProjectId'>;
|
|
5
|
+
export type DataId = Opaque<string, 'DataId'>;
|
|
6
|
+
export type Project = {
|
|
7
|
+
metadata: {
|
|
8
|
+
id: ProjectId;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
mainGraphId?: GraphId;
|
|
12
|
+
path?: string;
|
|
13
|
+
};
|
|
14
|
+
plugins?: PluginLoadSpec[];
|
|
15
|
+
graphs: Record<GraphId, NodeGraph>;
|
|
16
|
+
data?: Record<DataId, string>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ChartNode } from './NodeBase.js';
|
|
2
|
+
import type { PluginNodeDefinition } from './NodeDefinition.js';
|
|
3
|
+
export type RivetPlugin = {
|
|
4
|
+
/** The unique identifier of the plugin. Should be unique across all plugins. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The display name of the plugin - what is shown in the UI fr the plugin. */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** Registers new nodes for the plugin to add. */
|
|
9
|
+
register?: (register: <T extends ChartNode>(definition: PluginNodeDefinition<T>) => void) => void;
|
|
10
|
+
/** The available configuration items and their specification, for configuring a plugin in the UI. */
|
|
11
|
+
configSpec?: RivetPluginConfigSpecs;
|
|
12
|
+
/** Defines additional context menu groups that the plugin adds. */
|
|
13
|
+
contextMenuGroups?: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
export type RivetPluginConfigSpecs = Record<string, PluginConfigurationSpec>;
|
|
19
|
+
export type PluginConfigurationSpecBase<T> = {
|
|
20
|
+
/** The type of the config value, how it should show as an editor in the UI. */
|
|
21
|
+
type: string;
|
|
22
|
+
/** The default value of the config item if unset. */
|
|
23
|
+
default?: T;
|
|
24
|
+
/** A description to show in the UI for the config setting. */
|
|
25
|
+
description?: string;
|
|
26
|
+
/** The label of the setting in the UI. */
|
|
27
|
+
label: string;
|
|
28
|
+
};
|
|
29
|
+
export type StringPluginConfigurationSpec = {
|
|
30
|
+
type: 'string';
|
|
31
|
+
default?: string;
|
|
32
|
+
label: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
pullEnvironmentVariable?: true | string;
|
|
35
|
+
helperText?: string;
|
|
36
|
+
};
|
|
37
|
+
export type SecretPluginConfigurationSpec = {
|
|
38
|
+
type: 'secret';
|
|
39
|
+
default?: string;
|
|
40
|
+
label: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
pullEnvironmentVariable?: true | string;
|
|
43
|
+
helperText?: string;
|
|
44
|
+
};
|
|
45
|
+
export type PluginConfigurationSpec = StringPluginConfigurationSpec | SecretPluginConfigurationSpec | PluginConfigurationSpecBase<number> | PluginConfigurationSpecBase<boolean>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ChartNode, type DatasetProvider, type NodeGraph, type Project, type Settings } from '../index.js';
|
|
2
|
+
/** Context accessible to UI functions such as getEditors() and getBody(). */
|
|
3
|
+
export type RivetUIContext = {
|
|
4
|
+
/** The settings configured in the UI. */
|
|
5
|
+
settings: Settings;
|
|
6
|
+
/** The selected executor. */
|
|
7
|
+
executor: 'nodejs' | 'browser';
|
|
8
|
+
/** The provider that can control datasets. */
|
|
9
|
+
datasetProvider: DatasetProvider;
|
|
10
|
+
/** The current project loaded in the UI. */
|
|
11
|
+
project: Project;
|
|
12
|
+
/** The current graph selected in the UI. */
|
|
13
|
+
graph?: NodeGraph;
|
|
14
|
+
/** The current node selected in the UI. */
|
|
15
|
+
node?: ChartNode;
|
|
16
|
+
/** Gets a string plugin config value from the settings, falling back to a specified environment variable if set. */
|
|
17
|
+
getPluginConfig(name: string): string | undefined;
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Settings<PluginSettings = Record<string, Record<string, unknown>>> {
|
|
2
|
+
recordingPlaybackLatency?: number;
|
|
3
|
+
/** Configurable settings that a plugin can get and set. Settings can be available in the settings modal and are stored */
|
|
4
|
+
pluginSettings?: PluginSettings;
|
|
5
|
+
/** A plugin can request environment variables to configure itself. Those can be populated here. */
|
|
6
|
+
pluginEnv?: {
|
|
7
|
+
[key: string]: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
openAiKey?: string;
|
|
10
|
+
openAiOrganization?: string;
|
|
11
|
+
openAiEndpoint?: string;
|
|
12
|
+
/** Timeout in milliseconds before retrying a chat node call. */
|
|
13
|
+
chatNodeTimeout?: number;
|
|
14
|
+
chatNodeHeaders?: Record<string, string>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChartNode, NodeOutputDefinition, NodeInputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
5
|
+
import type { EditorDefinition } from '../../index.js';
|
|
6
|
+
export type AbortGraphNode = ChartNode<'abortGraph', AbortGraphNodeData>;
|
|
7
|
+
export type AbortGraphNodeData = {
|
|
8
|
+
/** Did the graph abort, but it's a success? Use this for early-exit instead of "error abort". */
|
|
9
|
+
successfully: boolean;
|
|
10
|
+
useSuccessfullyInput?: boolean;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class AbortGraphNodeImpl extends NodeImpl<AbortGraphNode> {
|
|
14
|
+
static create(): AbortGraphNode;
|
|
15
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
16
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
17
|
+
getEditors(): EditorDefinition<AbortGraphNode>[];
|
|
18
|
+
getBody(): string | undefined;
|
|
19
|
+
static getUIData(): NodeUIData;
|
|
20
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
21
|
+
}
|
|
22
|
+
export declare const abortGraphNode: import("../NodeDefinition.js").NodeDefinition<AbortGraphNode>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ChartNode, NodeInputDefinition, NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
4
|
+
import type { DatasetId } from '../Dataset.js';
|
|
5
|
+
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
6
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
7
|
+
export type AppendToDatasetNode = ChartNode<'appendToDataset', AppendToDatasetNodeData>;
|
|
8
|
+
type AppendToDatasetNodeData = {
|
|
9
|
+
datasetId: DatasetId;
|
|
10
|
+
useDatasetIdInput?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare class AppendToDatasetNodeImpl extends NodeImpl<AppendToDatasetNode> {
|
|
13
|
+
static create(): AppendToDatasetNode;
|
|
14
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
15
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
16
|
+
static getUIData(): NodeUIData;
|
|
17
|
+
getEditors(): EditorDefinition<AppendToDatasetNode>[] | Promise<EditorDefinition<AppendToDatasetNode>[]>;
|
|
18
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
19
|
+
}
|
|
20
|
+
export declare const appendToDatasetNode: import("../NodeDefinition.js").NodeDefinition<AppendToDatasetNode>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChartNode, type NodeConnection, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeBody, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
5
|
+
export type ArrayNode = ChartNode<'array', ArrayNodeData>;
|
|
6
|
+
export type ArrayNodeData = {
|
|
7
|
+
flatten?: boolean;
|
|
8
|
+
flattenDeep?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class ArrayNodeImpl extends NodeImpl<ArrayNode> {
|
|
11
|
+
#private;
|
|
12
|
+
static create(): ArrayNode;
|
|
13
|
+
getInputDefinitions(connections: NodeConnection[]): NodeInputDefinition[];
|
|
14
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
15
|
+
getEditors(): EditorDefinition<ArrayNode>[];
|
|
16
|
+
static getUIData(): NodeUIData;
|
|
17
|
+
getBody(): NodeBody;
|
|
18
|
+
process(inputs: Inputs): Promise<Outputs>;
|
|
19
|
+
}
|
|
20
|
+
export declare const arrayNode: import("../NodeDefinition.js").NodeDefinition<ArrayNode>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ChartNode, type NodeConnection, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeBody, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
5
|
+
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
6
|
+
export type AssembleMessageNode = ChartNode<'assembleMessage', AssembleMessageNodeData>;
|
|
7
|
+
export type AssembleMessageNodeData = {
|
|
8
|
+
type: 'system' | 'user' | 'assistant' | 'function';
|
|
9
|
+
useTypeInput: boolean;
|
|
10
|
+
toolCallId: string;
|
|
11
|
+
useToolCallIdInput?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare class AssembleMessageNodeImpl extends NodeImpl<AssembleMessageNode> {
|
|
14
|
+
#private;
|
|
15
|
+
static create(): AssembleMessageNode;
|
|
16
|
+
getInputDefinitions(connections: NodeConnection[]): NodeInputDefinition[];
|
|
17
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
18
|
+
getEditors(): EditorDefinition<AssembleMessageNode>[];
|
|
19
|
+
static getUIData(): NodeUIData;
|
|
20
|
+
getBody(_context: RivetUIContext): NodeBody | Promise<NodeBody>;
|
|
21
|
+
process(inputs: Inputs): Promise<Outputs>;
|
|
22
|
+
}
|
|
23
|
+
export declare const assembleMessageNode: import("../NodeDefinition.js").NodeDefinition<AssembleMessageNode>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChartNode, type NodeConnection, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import type { EditorDefinition } from '../EditorDefinition.js';
|
|
5
|
+
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
6
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
7
|
+
export type AssemblePromptNode = ChartNode<'assemblePrompt', AssemblePromptNodeData>;
|
|
8
|
+
export type AssemblePromptNodeData = {
|
|
9
|
+
computeTokenCount?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare class AssemblePromptNodeImpl extends NodeImpl<AssemblePromptNode> {
|
|
12
|
+
#private;
|
|
13
|
+
static create(): AssemblePromptNode;
|
|
14
|
+
getInputDefinitions(connections: NodeConnection[]): NodeInputDefinition[];
|
|
15
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
16
|
+
static getUIData(): NodeUIData;
|
|
17
|
+
getEditors(_context: RivetUIContext): EditorDefinition<AssemblePromptNode>[];
|
|
18
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
19
|
+
}
|
|
20
|
+
export declare const assemblePromptNode: import("../NodeDefinition.js").NodeDefinition<AssemblePromptNode>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type DataRef, type EditorDefinition, type Inputs, type InternalProcessContext, type Outputs } from '../../index.js';
|
|
4
|
+
export type AudioNode = ChartNode<'audio', AudioNodeData>;
|
|
5
|
+
type AudioNodeData = {
|
|
6
|
+
data?: DataRef;
|
|
7
|
+
useDataInput: boolean;
|
|
8
|
+
mediaType?: 'audio/wav' | 'audio/mp3' | 'audio/ogg';
|
|
9
|
+
useMediaTypeInput: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare class AudioNodeImpl extends NodeImpl<AudioNode> {
|
|
12
|
+
static create(): AudioNode;
|
|
13
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
14
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
15
|
+
getEditors(): EditorDefinition<AudioNode>[];
|
|
16
|
+
static getUIData(): NodeUIData;
|
|
17
|
+
process(inputData: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
18
|
+
}
|
|
19
|
+
export declare const audioNode: import("../NodeDefinition.js").NodeDefinition<AudioNode>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import { type EditorDefinition } from '../../index.js';
|
|
5
|
+
export type BooleanNode = ChartNode<'boolean', BooleanNodeData>;
|
|
6
|
+
export type BooleanNodeData = {
|
|
7
|
+
value?: boolean;
|
|
8
|
+
useValueInput?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class BooleanNodeImpl extends NodeImpl<BooleanNode> {
|
|
11
|
+
static create(): BooleanNode;
|
|
12
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
13
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
14
|
+
getEditors(): EditorDefinition<BooleanNode>[];
|
|
15
|
+
getBody(): string | undefined;
|
|
16
|
+
static getUIData(): NodeUIData;
|
|
17
|
+
process(inputs: Inputs): Promise<Outputs>;
|
|
18
|
+
}
|
|
19
|
+
export declare const booleanNode: import("../NodeDefinition.js").NodeDefinition<BooleanNode>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type Inputs, type Outputs } from '../GraphProcessor.js';
|
|
4
|
+
import { type InternalProcessContext } from '../ProcessContext.js';
|
|
5
|
+
export type CallGraphNode = ChartNode<'callGraph', CallGraphNodeData>;
|
|
6
|
+
export type CallGraphNodeData = {
|
|
7
|
+
useErrorOutput?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare class CallGraphNodeImpl extends NodeImpl<CallGraphNode> {
|
|
10
|
+
static create(): CallGraphNode;
|
|
11
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
12
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
13
|
+
static getUIData(): NodeUIData;
|
|
14
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
15
|
+
}
|
|
16
|
+
export declare const callGraphNode: import("../NodeDefinition.js").NodeDefinition<CallGraphNode>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } from '../NodeBase.js';
|
|
2
|
+
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
|
+
import { type ChatMessage } from '../DataValue.js';
|
|
4
|
+
import type { Inputs, Outputs } from '../GraphProcessor.js';
|
|
5
|
+
import { type InternalProcessContext } from '../ProcessContext.js';
|
|
6
|
+
import { type EditorDefinition } from '../../index.js';
|
|
7
|
+
export type ChatNode = ChartNode<'chat', ChatNodeData>;
|
|
8
|
+
export type ChatNodeConfigData = {
|
|
9
|
+
model: string;
|
|
10
|
+
temperature: number;
|
|
11
|
+
useTopP: boolean;
|
|
12
|
+
top_p?: number;
|
|
13
|
+
maxTokens: number;
|
|
14
|
+
stop?: string;
|
|
15
|
+
presencePenalty?: number;
|
|
16
|
+
frequencyPenalty?: number;
|
|
17
|
+
enableFunctionUse?: boolean;
|
|
18
|
+
user?: string;
|
|
19
|
+
numberOfChoices?: number;
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
overrideModel?: string;
|
|
22
|
+
overrideMaxTokens?: number;
|
|
23
|
+
headers?: {
|
|
24
|
+
key: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
seed?: number;
|
|
28
|
+
toolChoice?: 'none' | 'auto' | 'function';
|
|
29
|
+
toolChoiceFunction?: string;
|
|
30
|
+
responseFormat?: '' | 'text' | 'json' | 'json_schema';
|
|
31
|
+
parallelFunctionCalling?: boolean;
|
|
32
|
+
additionalParameters?: {
|
|
33
|
+
key: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
responseSchemaName?: string;
|
|
37
|
+
};
|
|
38
|
+
export type ChatNodeData = ChatNodeConfigData & {
|
|
39
|
+
useModelInput: boolean;
|
|
40
|
+
useTemperatureInput: boolean;
|
|
41
|
+
useTopPInput: boolean;
|
|
42
|
+
useTopP: boolean;
|
|
43
|
+
useUseTopPInput: boolean;
|
|
44
|
+
useMaxTokensInput: boolean;
|
|
45
|
+
useStop: boolean;
|
|
46
|
+
useStopInput: boolean;
|
|
47
|
+
usePresencePenaltyInput: boolean;
|
|
48
|
+
useFrequencyPenaltyInput: boolean;
|
|
49
|
+
useUserInput?: boolean;
|
|
50
|
+
useNumberOfChoicesInput?: boolean;
|
|
51
|
+
useEndpointInput?: boolean;
|
|
52
|
+
useHeadersInput?: boolean;
|
|
53
|
+
useSeedInput?: boolean;
|
|
54
|
+
useToolChoiceInput?: boolean;
|
|
55
|
+
useToolChoiceFunctionInput?: boolean;
|
|
56
|
+
useResponseFormatInput?: boolean;
|
|
57
|
+
useAdditionalParametersInput?: boolean;
|
|
58
|
+
useResponseSchemaNameInput?: boolean;
|
|
59
|
+
/** Given the same set of inputs, return the same output without hitting GPT */
|
|
60
|
+
cache: boolean;
|
|
61
|
+
useAsGraphPartialOutput?: boolean;
|
|
62
|
+
};
|
|
63
|
+
export declare class ChatNodeImpl extends NodeImpl<ChatNode> {
|
|
64
|
+
static create(): ChatNode;
|
|
65
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
66
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
67
|
+
static getUIData(): NodeUIData;
|
|
68
|
+
getEditors(): EditorDefinition<ChatNode>[];
|
|
69
|
+
getBody(): string;
|
|
70
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
71
|
+
}
|
|
72
|
+
export declare const chatNode: import("../NodeDefinition.js").NodeDefinition<ChatNode>;
|
|
73
|
+
export declare function getChatNodeMessages(inputs: Inputs): {
|
|
74
|
+
messages: ChatMessage[];
|
|
75
|
+
systemPrompt: import("../DataValue.js").DataValue | undefined;
|
|
76
|
+
};
|
|
77
|
+
export declare function getCostForTokens(tokenCount: number, type: 'prompt' | 'completion', costPerThousand: number): number;
|