@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,739 @@
|
|
|
1
|
+
export type OpenAIModel = {
|
|
2
|
+
maxTokens: number;
|
|
3
|
+
cost: {
|
|
4
|
+
prompt: number;
|
|
5
|
+
completion: number;
|
|
6
|
+
};
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const openaiModels: {
|
|
10
|
+
'gpt-4': {
|
|
11
|
+
maxTokens: number;
|
|
12
|
+
cost: {
|
|
13
|
+
prompt: number;
|
|
14
|
+
completion: number;
|
|
15
|
+
};
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
'gpt-4-32k': {
|
|
19
|
+
maxTokens: number;
|
|
20
|
+
cost: {
|
|
21
|
+
prompt: number;
|
|
22
|
+
completion: number;
|
|
23
|
+
};
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
'gpt-4-0613': {
|
|
27
|
+
maxTokens: number;
|
|
28
|
+
cost: {
|
|
29
|
+
prompt: number;
|
|
30
|
+
completion: number;
|
|
31
|
+
};
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
'gpt-4-32k-0613': {
|
|
35
|
+
maxTokens: number;
|
|
36
|
+
cost: {
|
|
37
|
+
prompt: number;
|
|
38
|
+
completion: number;
|
|
39
|
+
};
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
42
|
+
'gpt-3.5-turbo': {
|
|
43
|
+
maxTokens: number;
|
|
44
|
+
cost: {
|
|
45
|
+
prompt: number;
|
|
46
|
+
completion: number;
|
|
47
|
+
};
|
|
48
|
+
displayName: string;
|
|
49
|
+
};
|
|
50
|
+
'gpt-3.5-turbo-16k': {
|
|
51
|
+
maxTokens: number;
|
|
52
|
+
cost: {
|
|
53
|
+
prompt: number;
|
|
54
|
+
completion: number;
|
|
55
|
+
};
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
'gpt-3.5-turbo-0613': {
|
|
59
|
+
maxTokens: number;
|
|
60
|
+
cost: {
|
|
61
|
+
prompt: number;
|
|
62
|
+
completion: number;
|
|
63
|
+
};
|
|
64
|
+
displayName: string;
|
|
65
|
+
};
|
|
66
|
+
'gpt-3.5-turbo-1106': {
|
|
67
|
+
maxTokens: number;
|
|
68
|
+
cost: {
|
|
69
|
+
prompt: number;
|
|
70
|
+
completion: number;
|
|
71
|
+
};
|
|
72
|
+
displayName: string;
|
|
73
|
+
};
|
|
74
|
+
'gpt-3.5-turbo-16k-0613': {
|
|
75
|
+
maxTokens: number;
|
|
76
|
+
cost: {
|
|
77
|
+
prompt: number;
|
|
78
|
+
completion: number;
|
|
79
|
+
};
|
|
80
|
+
displayName: string;
|
|
81
|
+
};
|
|
82
|
+
'gpt-3.5-turbo-0301': {
|
|
83
|
+
maxTokens: number;
|
|
84
|
+
cost: {
|
|
85
|
+
prompt: number;
|
|
86
|
+
completion: number;
|
|
87
|
+
};
|
|
88
|
+
displayName: string;
|
|
89
|
+
};
|
|
90
|
+
'gpt-4-0314': {
|
|
91
|
+
maxTokens: number;
|
|
92
|
+
cost: {
|
|
93
|
+
prompt: number;
|
|
94
|
+
completion: number;
|
|
95
|
+
};
|
|
96
|
+
displayName: string;
|
|
97
|
+
};
|
|
98
|
+
'gpt-4-32k-0314': {
|
|
99
|
+
maxTokens: number;
|
|
100
|
+
cost: {
|
|
101
|
+
prompt: number;
|
|
102
|
+
completion: number;
|
|
103
|
+
};
|
|
104
|
+
displayName: string;
|
|
105
|
+
};
|
|
106
|
+
'gpt-4-1106-preview': {
|
|
107
|
+
maxTokens: number;
|
|
108
|
+
cost: {
|
|
109
|
+
prompt: number;
|
|
110
|
+
completion: number;
|
|
111
|
+
};
|
|
112
|
+
displayName: string;
|
|
113
|
+
};
|
|
114
|
+
'gpt-4-turbo': {
|
|
115
|
+
maxTokens: number;
|
|
116
|
+
cost: {
|
|
117
|
+
prompt: number;
|
|
118
|
+
completion: number;
|
|
119
|
+
};
|
|
120
|
+
displayName: string;
|
|
121
|
+
};
|
|
122
|
+
'gpt-4-vision-preview': {
|
|
123
|
+
maxTokens: number;
|
|
124
|
+
cost: {
|
|
125
|
+
prompt: number;
|
|
126
|
+
completion: number;
|
|
127
|
+
};
|
|
128
|
+
displayName: string;
|
|
129
|
+
};
|
|
130
|
+
'gpt-4o': {
|
|
131
|
+
maxTokens: number;
|
|
132
|
+
cost: {
|
|
133
|
+
prompt: number;
|
|
134
|
+
completion: number;
|
|
135
|
+
};
|
|
136
|
+
displayName: string;
|
|
137
|
+
};
|
|
138
|
+
'gpt-4o-mini': {
|
|
139
|
+
maxTokens: number;
|
|
140
|
+
cost: {
|
|
141
|
+
prompt: number;
|
|
142
|
+
completion: number;
|
|
143
|
+
};
|
|
144
|
+
displayName: string;
|
|
145
|
+
};
|
|
146
|
+
'gpt-4o-mini-2024-07-18': {
|
|
147
|
+
maxTokens: number;
|
|
148
|
+
cost: {
|
|
149
|
+
prompt: number;
|
|
150
|
+
completion: number;
|
|
151
|
+
};
|
|
152
|
+
displayName: string;
|
|
153
|
+
};
|
|
154
|
+
'local-model': {
|
|
155
|
+
maxTokens: number;
|
|
156
|
+
cost: {
|
|
157
|
+
prompt: number;
|
|
158
|
+
completion: number;
|
|
159
|
+
};
|
|
160
|
+
displayName: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
export declare const openAiModelOptions: {
|
|
164
|
+
value: string;
|
|
165
|
+
label: string;
|
|
166
|
+
}[];
|
|
167
|
+
export declare class OpenAIError extends Error {
|
|
168
|
+
readonly status: number;
|
|
169
|
+
readonly responseJson: any;
|
|
170
|
+
constructor(status: number, responseJson: any);
|
|
171
|
+
}
|
|
172
|
+
export type ChatCompletionRole = ChatCompletionRequestMessage['role'];
|
|
173
|
+
export type ChatCompletionRequestMessage = ChatCompletionRequestSystemMessage | ChatCompletionRequestUserMessage | ChatCompletionRequestAssistantMessage | ChatCompletionRequestToolMessage;
|
|
174
|
+
export type ChatCompletionRequestSystemMessage = {
|
|
175
|
+
role: 'system';
|
|
176
|
+
content: string | null;
|
|
177
|
+
};
|
|
178
|
+
export type ChatCompletionRequestUserMessage = {
|
|
179
|
+
role: 'user';
|
|
180
|
+
content: string | ChatCompletionRequestUserMessageContent[];
|
|
181
|
+
};
|
|
182
|
+
export type ChatCompletionRequestUserMessageContent = ChatCompletionRequestUserMessageTextContent | ChatCompletionRequestUserMessageImageContent;
|
|
183
|
+
export type ChatCompletionRequestUserMessageTextContent = {
|
|
184
|
+
type: 'text';
|
|
185
|
+
text: string;
|
|
186
|
+
};
|
|
187
|
+
export type ChatCompletionRequestUserMessageImageContent = {
|
|
188
|
+
type: 'image_url';
|
|
189
|
+
image_url: {
|
|
190
|
+
url: string;
|
|
191
|
+
/**
|
|
192
|
+
* low will disable the “high res” model. The model will receive a low-res 512 x 512 version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail.
|
|
193
|
+
* high will enable “high res” mode, which first allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens.
|
|
194
|
+
*/
|
|
195
|
+
detail?: 'low' | 'high';
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
export type ChatCompletionRequestAssistantMessage = {
|
|
199
|
+
role: 'assistant';
|
|
200
|
+
content: string | null;
|
|
201
|
+
tool_calls?: ChatCompletionRequestAssistantMessageToolCall[];
|
|
202
|
+
};
|
|
203
|
+
export type ChatCompletionRequestAssistantMessageToolCall = {
|
|
204
|
+
type: 'function';
|
|
205
|
+
id: string;
|
|
206
|
+
function: GptFunctionCall;
|
|
207
|
+
};
|
|
208
|
+
export type ChatCompletionRequestToolMessage = {
|
|
209
|
+
role: 'tool';
|
|
210
|
+
content: string | null;
|
|
211
|
+
tool_call_id: string;
|
|
212
|
+
};
|
|
213
|
+
export type ChatCompletionOptions = {
|
|
214
|
+
endpoint: string;
|
|
215
|
+
auth: {
|
|
216
|
+
apiKey: string;
|
|
217
|
+
organization?: string;
|
|
218
|
+
};
|
|
219
|
+
headers?: Record<string, string>;
|
|
220
|
+
signal?: AbortSignal;
|
|
221
|
+
/** The timeout in milliseconds before an initial response, before retrying. */
|
|
222
|
+
timeout?: number;
|
|
223
|
+
model: string;
|
|
224
|
+
messages: ChatCompletionRequestMessage[];
|
|
225
|
+
temperature?: number;
|
|
226
|
+
top_p?: number;
|
|
227
|
+
max_tokens?: number;
|
|
228
|
+
n?: number;
|
|
229
|
+
stop?: string | string[];
|
|
230
|
+
presence_penalty?: number;
|
|
231
|
+
frequency_penalty?: number;
|
|
232
|
+
logit_bias?: {
|
|
233
|
+
[key: number]: number;
|
|
234
|
+
};
|
|
235
|
+
/** This feature is in Beta. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed, and you should refer to the system_fingerprint response parameter to monitor changes in the backend. */
|
|
236
|
+
seed?: number;
|
|
237
|
+
tools?: ChatCompletionTool[];
|
|
238
|
+
tool_choice?: 'none' | 'auto' | 'required' | {
|
|
239
|
+
type: 'function';
|
|
240
|
+
function: {
|
|
241
|
+
name: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
/** An object specifying the format that the model must output. Used to enable JSON mode. */
|
|
245
|
+
response_format?: {
|
|
246
|
+
type: 'text';
|
|
247
|
+
} | {
|
|
248
|
+
/**
|
|
249
|
+
* Setting to json_object enables JSON mode. This guarantees that the message the model generates is valid JSON.
|
|
250
|
+
* Note that your system prompt must still instruct the model to produce JSON, and to help ensure you don't forget, the API will throw an error if the string JSON does not appear in your system message. Also note that the message content may be partial (i.e. cut off) if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
|
|
251
|
+
* Must be one of text or json_object.
|
|
252
|
+
*/
|
|
253
|
+
type: 'json_object';
|
|
254
|
+
} | {
|
|
255
|
+
type: 'json_schema';
|
|
256
|
+
json_schema: {
|
|
257
|
+
name: string;
|
|
258
|
+
strict: boolean;
|
|
259
|
+
schema: object;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
};
|
|
263
|
+
export type ChatCompletionResponse = {
|
|
264
|
+
/** A unique identifier for the chat completion. */
|
|
265
|
+
id: string;
|
|
266
|
+
/** The object type, which is always chat.completion. */
|
|
267
|
+
object: 'text_completion';
|
|
268
|
+
/** The Unix timestamp (in seconds) of when the chat completion was created. */
|
|
269
|
+
created: number;
|
|
270
|
+
/** The model used for the chat completion. */
|
|
271
|
+
model: string;
|
|
272
|
+
/**
|
|
273
|
+
* This fingerprint represents the backend configuration that the model runs with.
|
|
274
|
+
* Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
|
|
275
|
+
*/
|
|
276
|
+
system_fingerprint: string;
|
|
277
|
+
/** Usage statistics for the completion request. */
|
|
278
|
+
usage: {
|
|
279
|
+
/** Number of tokens in the generated completion. */
|
|
280
|
+
completion_tokens: number;
|
|
281
|
+
/** Number of tokens in the prompt. */
|
|
282
|
+
prompt_tokens: number;
|
|
283
|
+
/** Total number of tokens used in the request (prompt + completion). */
|
|
284
|
+
total_tokens: number;
|
|
285
|
+
};
|
|
286
|
+
/** A list of chat completion choices. Can be more than one if n is greater than 1. */
|
|
287
|
+
choices: ChatCompletionResponseChoice[];
|
|
288
|
+
};
|
|
289
|
+
export type ChatCompletionResponseChoice = {
|
|
290
|
+
/** The index of the choice in the list of choices. */
|
|
291
|
+
index: number;
|
|
292
|
+
/**
|
|
293
|
+
* The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence,
|
|
294
|
+
* length if the maximum number of tokens specified in the request was reached, content_filter if content was omitted due to a flag
|
|
295
|
+
* from our content filters, tool_calls if the model called a tool, or function_call (deprecated) if the model called a function.
|
|
296
|
+
*/
|
|
297
|
+
finish_reason: 'stop' | 'length' | 'content_filter' | 'insufficient_tokens' | 'tool_calls';
|
|
298
|
+
/** A chat completion message generated by the model. */
|
|
299
|
+
message: ChatCompletionResponseMessage;
|
|
300
|
+
};
|
|
301
|
+
export type ChatCompletionResponseMessage = {
|
|
302
|
+
/** The role of the author of this message. */
|
|
303
|
+
role: ChatCompletionRole;
|
|
304
|
+
/** The contents of the message. */
|
|
305
|
+
content: string | null;
|
|
306
|
+
/** The tool calls generated by the model, such as function calls. */
|
|
307
|
+
tool_calls: OpenAIFunctionToolCall[];
|
|
308
|
+
};
|
|
309
|
+
export type ChatCompletionChunk = {
|
|
310
|
+
object: 'chat.completion.chunk';
|
|
311
|
+
created: number;
|
|
312
|
+
model: string;
|
|
313
|
+
choices?: ChatCompletionChunkChoice[];
|
|
314
|
+
};
|
|
315
|
+
export type GptFunctionCall = {
|
|
316
|
+
name: string;
|
|
317
|
+
arguments: string;
|
|
318
|
+
};
|
|
319
|
+
export type GptFunctionCallDelta = {
|
|
320
|
+
name?: string;
|
|
321
|
+
arguments?: string;
|
|
322
|
+
};
|
|
323
|
+
export type ChatCompletionChunkChoice = {
|
|
324
|
+
index: number;
|
|
325
|
+
message_index: number;
|
|
326
|
+
delta: {
|
|
327
|
+
role?: 'assistant';
|
|
328
|
+
content?: string;
|
|
329
|
+
tool_calls?: ChatCompletionChunkChoiceToolCall[];
|
|
330
|
+
};
|
|
331
|
+
finish_reason: null | 'stop' | 'length' | 'insufficient_tokens' | 'content_filter' | 'tool_calls';
|
|
332
|
+
};
|
|
333
|
+
export type ChatCompletionChunkChoiceToolCall = {
|
|
334
|
+
index: number;
|
|
335
|
+
id: string;
|
|
336
|
+
type: 'function';
|
|
337
|
+
function: GptFunctionCall;
|
|
338
|
+
};
|
|
339
|
+
export type ChatCompletionTool = ChatCompletionFunctionTool;
|
|
340
|
+
export type ChatCompletionFunctionTool = {
|
|
341
|
+
type: 'function';
|
|
342
|
+
function: ChatCompletionFunction;
|
|
343
|
+
};
|
|
344
|
+
export type ChatCompletionFunction = {
|
|
345
|
+
name: string;
|
|
346
|
+
description: string;
|
|
347
|
+
parameters: object;
|
|
348
|
+
strict: boolean;
|
|
349
|
+
};
|
|
350
|
+
export declare function streamChatCompletions({ endpoint, auth, signal, headers, timeout, ...rest }: ChatCompletionOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
351
|
+
export type OpenAIAssistant = {
|
|
352
|
+
/** The identifier, which can be referenced in API endpoints. */
|
|
353
|
+
id: string;
|
|
354
|
+
/** The object type, which is always assistant. */
|
|
355
|
+
object: 'assistant';
|
|
356
|
+
/** The Unix timestamp (in seconds) for when the assistant was created. */
|
|
357
|
+
created_at: number;
|
|
358
|
+
/** The name of the assistant. The maximum length is 256 characters. */
|
|
359
|
+
name: string | null;
|
|
360
|
+
/** The description of the assistant. The maximum length is 512 characters. */
|
|
361
|
+
description: string | null;
|
|
362
|
+
/** ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them. */
|
|
363
|
+
model: string;
|
|
364
|
+
/** The system instructions that the assistant uses. The maximum length is 32768 characters. */
|
|
365
|
+
instructions: string | null;
|
|
366
|
+
/** A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, retrieval, or function. */
|
|
367
|
+
tools: OpenAIAssistantTool[];
|
|
368
|
+
/** A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. */
|
|
369
|
+
file_ids: string[];
|
|
370
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
371
|
+
metadata: Record<string, string>;
|
|
372
|
+
};
|
|
373
|
+
export type OpenAIAssistantCodeInterpreterTool = {
|
|
374
|
+
/** The type of tool being defined: code_interpreter */
|
|
375
|
+
type: 'code_interpreter';
|
|
376
|
+
};
|
|
377
|
+
export type OpenAIAssistantRetrievalTool = {
|
|
378
|
+
/** The type of tool being defined: retrieval */
|
|
379
|
+
type: 'retrieval';
|
|
380
|
+
};
|
|
381
|
+
export type OpenAIAssistantFunctionTool = {
|
|
382
|
+
/** The type of tool being defined: function */
|
|
383
|
+
type: 'function';
|
|
384
|
+
/** The function definition. */
|
|
385
|
+
function: ChatCompletionFunction;
|
|
386
|
+
};
|
|
387
|
+
export type OpenAIAssistantTool = OpenAIAssistantCodeInterpreterTool | OpenAIAssistantRetrievalTool | OpenAIAssistantFunctionTool;
|
|
388
|
+
/**
|
|
389
|
+
* POST https://api.openai.com/v1/assistants
|
|
390
|
+
* Create an assistant with a model and instructions.
|
|
391
|
+
*/
|
|
392
|
+
export type CreateAssistantBody = {
|
|
393
|
+
/** ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them. */
|
|
394
|
+
model?: string;
|
|
395
|
+
/** The name of the assistant. The maximum length is 256 characters. */
|
|
396
|
+
name?: string | null;
|
|
397
|
+
/** The description of the assistant. The maximum length is 512 characters. */
|
|
398
|
+
description?: string | null;
|
|
399
|
+
/** The system instructions that the assistant uses. The maximum length is 32768 characters. */
|
|
400
|
+
instructions?: string | null;
|
|
401
|
+
/** A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter, retrieval, or function. */
|
|
402
|
+
tools?: OpenAIAssistantTool[];
|
|
403
|
+
/** A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant. Files are ordered by their creation date in ascending order. */
|
|
404
|
+
file_ids?: string[];
|
|
405
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
406
|
+
metadata?: Record<string, string>;
|
|
407
|
+
};
|
|
408
|
+
export type CreateAssistantResponse = OpenAIAssistant;
|
|
409
|
+
export type OpenAIPaginationQuery = {
|
|
410
|
+
/** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
|
|
411
|
+
limit?: string;
|
|
412
|
+
/** Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. */
|
|
413
|
+
order?: string;
|
|
414
|
+
/** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */
|
|
415
|
+
after?: string;
|
|
416
|
+
/** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */
|
|
417
|
+
before?: string;
|
|
418
|
+
};
|
|
419
|
+
export type OpenAIAssistantFile = {
|
|
420
|
+
/** The identifier, which can be referenced in API endpoints. */
|
|
421
|
+
id: string;
|
|
422
|
+
/** The object type, which is always assistant.file. */
|
|
423
|
+
object: 'assistant.file';
|
|
424
|
+
/** The Unix timestamp (in seconds) for when the assistant file was created. */
|
|
425
|
+
created_at: number;
|
|
426
|
+
/** The assistant ID that the file is attached to. */
|
|
427
|
+
assistant_id: string;
|
|
428
|
+
};
|
|
429
|
+
export type CreateAssistantFileBody = {
|
|
430
|
+
file_id: string;
|
|
431
|
+
};
|
|
432
|
+
export type OpenAIFile = {
|
|
433
|
+
/** The file identifier, which can be referenced in the API endpoints. */
|
|
434
|
+
id: string;
|
|
435
|
+
/** The size of the file, in bytes. */
|
|
436
|
+
bytes: number;
|
|
437
|
+
/** The Unix timestamp (in seconds) for when the file was created. */
|
|
438
|
+
created_at: number;
|
|
439
|
+
/** The name of the file. */
|
|
440
|
+
filename: string;
|
|
441
|
+
/** The object type, which is always file. */
|
|
442
|
+
object: 'file';
|
|
443
|
+
/** The intended purpose of the file. Supported values are fine-tune, fine-tune-results, assistants, and assistants_output. */
|
|
444
|
+
purpose: OpenAIFilePurpose;
|
|
445
|
+
};
|
|
446
|
+
export type OpenAIFilePurpose = 'fine-tune' | 'fine-tune-results' | 'assistants' | 'assistants_output';
|
|
447
|
+
export declare const openAIFilePurposeOptions: {
|
|
448
|
+
value: string;
|
|
449
|
+
label: string;
|
|
450
|
+
}[];
|
|
451
|
+
export declare const openAIFileUploadPurposeOptions: {
|
|
452
|
+
value: string;
|
|
453
|
+
label: string;
|
|
454
|
+
}[];
|
|
455
|
+
export type OpenAIThread = {
|
|
456
|
+
/** The identifier, which can be referenced in API endpoints. */
|
|
457
|
+
id: string;
|
|
458
|
+
/** The object type, which is always thread. */
|
|
459
|
+
object: 'thread';
|
|
460
|
+
/** The Unix timestamp (in seconds) for when the thread was created. */
|
|
461
|
+
created_at: number;
|
|
462
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
463
|
+
metadata: Record<string, string>;
|
|
464
|
+
};
|
|
465
|
+
export type OpenAIThreadMessage = {
|
|
466
|
+
/** The identifier, which can be referenced in API endpoints. */
|
|
467
|
+
id: string;
|
|
468
|
+
/** The object type, which is always thread.message. */
|
|
469
|
+
object: 'thread.message';
|
|
470
|
+
/** The Unix timestamp (in seconds) for when the message was created. */
|
|
471
|
+
created_at: number;
|
|
472
|
+
/** The thread ID that this message belongs to. */
|
|
473
|
+
thread_id: string;
|
|
474
|
+
/** The entity that produced the message. One of user or assistant. */
|
|
475
|
+
role: 'user' | 'assistant';
|
|
476
|
+
/** The content of the message in array of text and/or images. */
|
|
477
|
+
content: OpenAIThreadMessageContent[];
|
|
478
|
+
};
|
|
479
|
+
export type OpenAIThreadMessageContent = OpenAIThreadMessageImageFileContent | OpenAIThreadMessageTextContent;
|
|
480
|
+
/** References an image File in the content of a message. */
|
|
481
|
+
export type OpenAIThreadMessageImageFileContent = {
|
|
482
|
+
/** Always image_file. */
|
|
483
|
+
type: 'image_file';
|
|
484
|
+
image_file: {
|
|
485
|
+
/** The File ID of the image in the message content. */
|
|
486
|
+
file_id: string;
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
/** The text content that is part of a message. */
|
|
490
|
+
export type OpenAIThreadMessageTextContent = {
|
|
491
|
+
/** Always text. */
|
|
492
|
+
type: 'text';
|
|
493
|
+
text: {
|
|
494
|
+
/** The data that makes up the text. */
|
|
495
|
+
value: string;
|
|
496
|
+
annotations: OpenAIThreadMessageContentAnnotation[];
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
export type OpenAIThreadMessageContentAnnotation = OpenAIThreadMessageTextContentFileCitationAnnotation | OpenAIThreadMessageTextContentFilePathAnnotation;
|
|
500
|
+
/** A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "retrieval" tool to search files. */
|
|
501
|
+
export type OpenAIThreadMessageTextContentFileCitationAnnotation = {
|
|
502
|
+
/** Always file_citation. */
|
|
503
|
+
type: 'file_citation';
|
|
504
|
+
/** The text in the message content that needs to be replaced. */
|
|
505
|
+
text: string;
|
|
506
|
+
file_citation: {
|
|
507
|
+
/** The ID of the specific File the citation is from. */
|
|
508
|
+
file_id: string;
|
|
509
|
+
/** The specific quote in the file. */
|
|
510
|
+
quote: string;
|
|
511
|
+
};
|
|
512
|
+
start_index: number;
|
|
513
|
+
end_index: number;
|
|
514
|
+
};
|
|
515
|
+
/** A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file. */
|
|
516
|
+
export type OpenAIThreadMessageTextContentFilePathAnnotation = {
|
|
517
|
+
/** Always file_path. */
|
|
518
|
+
type: 'file_path';
|
|
519
|
+
/** The text in the message content that needs to be replaced. */
|
|
520
|
+
text: string;
|
|
521
|
+
file_path: {
|
|
522
|
+
/** The ID of the file that was generated. */
|
|
523
|
+
file_id: string;
|
|
524
|
+
};
|
|
525
|
+
start_index: number;
|
|
526
|
+
end_index: number;
|
|
527
|
+
};
|
|
528
|
+
export type CreateMessageBody = {
|
|
529
|
+
/** The role of the entity that is creating the message. Currently only user is supported. */
|
|
530
|
+
role: 'user';
|
|
531
|
+
/** The content of the message. */
|
|
532
|
+
content: string;
|
|
533
|
+
/** A list of File IDs that the message should use. There can be a maximum of 10 files attached to a message. Useful for tools like retrieval and code_interpreter that can access and use files. */
|
|
534
|
+
file_ids?: string[];
|
|
535
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
536
|
+
metadata?: Record<string, string>;
|
|
537
|
+
};
|
|
538
|
+
export type CreateThreadBody = {
|
|
539
|
+
/** A list of messages to start the thread with. */
|
|
540
|
+
messages: CreateMessageBody[];
|
|
541
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
542
|
+
metadata: Record<string, string>;
|
|
543
|
+
};
|
|
544
|
+
export type OpenAIRun = {
|
|
545
|
+
/** The identifier, which can be referenced in API endpoints. */
|
|
546
|
+
id: string;
|
|
547
|
+
/** The object type, which is always assistant.run. */
|
|
548
|
+
object: 'assistant.run';
|
|
549
|
+
/** The Unix timestamp (in seconds) for when the run was created. */
|
|
550
|
+
created_at: number;
|
|
551
|
+
/** The ID of the thread that was executed on as a part of this run. */
|
|
552
|
+
thread_id: string;
|
|
553
|
+
/** The ID of the assistant used for execution of this run. */
|
|
554
|
+
assistant_id: string;
|
|
555
|
+
/** The status of the run, which can be either queued, in_progress, requires_action, cancelling, cancelled, failed, completed, or expired. */
|
|
556
|
+
status: 'queued' | 'in_progress' | 'requires_action' | 'cancelling' | 'cancelled' | 'failed' | 'completed' | 'expired';
|
|
557
|
+
/** Details on the action required to continue the run. Will be null if no action is required. */
|
|
558
|
+
required_action: OpenAIRunRequiredAction | null;
|
|
559
|
+
/** The last error associated with this run. Will be null if there are no errors. */
|
|
560
|
+
last_error: {
|
|
561
|
+
/** One of server_error or rate_limit_exceeded. */
|
|
562
|
+
code: string;
|
|
563
|
+
/** A human-readable description of the error. */
|
|
564
|
+
message: string;
|
|
565
|
+
} | null;
|
|
566
|
+
/** The Unix timestamp (in seconds) for when the run will expire. */
|
|
567
|
+
expires_at: number;
|
|
568
|
+
/** The Unix timestamp (in seconds) for when the run was started. */
|
|
569
|
+
started_at: number;
|
|
570
|
+
/** The Unix timestamp (in seconds) for when the run was cancelled. */
|
|
571
|
+
cancelled_at: number;
|
|
572
|
+
/** The Unix timestamp (in seconds) for when the run failed. */
|
|
573
|
+
failed_at: number;
|
|
574
|
+
/** The Unix timestamp (in seconds) for when the run was completed. */
|
|
575
|
+
completed_at: number;
|
|
576
|
+
/** The model that the assistant used for this run. */
|
|
577
|
+
model: string;
|
|
578
|
+
/** The instructions that the assistant used for this run. */
|
|
579
|
+
instructions: string;
|
|
580
|
+
/** The list of tools that the assistant used for this run. */
|
|
581
|
+
tools: OpenAIAssistantTool[];
|
|
582
|
+
/** The list of File IDs the assistant used for this run. */
|
|
583
|
+
file_ids: string[];
|
|
584
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
585
|
+
metadata: Record<string, string>;
|
|
586
|
+
};
|
|
587
|
+
export type OpenAIRunRequiredAction = OpenAIRunRequiredActionSubmitToolOutputs;
|
|
588
|
+
export type OpenAIRunRequiredActionSubmitToolOutputs = {
|
|
589
|
+
/** For now, this is always submit_tool_outputs. */
|
|
590
|
+
type: 'submit_tool_outputs';
|
|
591
|
+
/** Details on the tool outputs needed for this run to continue. */
|
|
592
|
+
submit_tool_outputs: {
|
|
593
|
+
/** A list of the relevant tool calls. */
|
|
594
|
+
tool_calls: OpenAIFunctionToolCall[];
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
export type OpenAIRunToolCall = OpenAIFunctionToolCall | OpenAIRunRetrievalToolCall | OpenAIRunCodeInterpreterToolCall;
|
|
598
|
+
export type OpenAIFunctionToolCall = {
|
|
599
|
+
/** The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the Submit tool outputs to run endpoint. */
|
|
600
|
+
id: string;
|
|
601
|
+
/** The type of tool call the output is required for. For now, this is always function. */
|
|
602
|
+
type: 'function';
|
|
603
|
+
/** The function definition. */
|
|
604
|
+
function: OpenAIRunFunctionToolCallFunction;
|
|
605
|
+
};
|
|
606
|
+
export type OpenAIRunFunctionToolCallFunction = {
|
|
607
|
+
/** The name of the function. */
|
|
608
|
+
name: string;
|
|
609
|
+
/** The arguments that the model expects you to pass to the function. */
|
|
610
|
+
arguments: string;
|
|
611
|
+
/** The output of the function. This will be null if the outputs have not been submitted yet. Ignore when submitting tool calls. */
|
|
612
|
+
output?: string | null;
|
|
613
|
+
};
|
|
614
|
+
export type OpenAIRunRetrievalToolCall = {
|
|
615
|
+
/** The ID of the tool call object. */
|
|
616
|
+
id: string;
|
|
617
|
+
/** The type of tool call. This is always going to be retrieval for this type of tool call. */
|
|
618
|
+
type: 'retrieval';
|
|
619
|
+
/** For now, this is always going to be an empty object. */
|
|
620
|
+
retrieval: {};
|
|
621
|
+
};
|
|
622
|
+
/** Details of the Code Interpreter tool call the run step was involved in. */
|
|
623
|
+
export type OpenAIRunCodeInterpreterToolCall = {
|
|
624
|
+
/** The ID of the tool call. */
|
|
625
|
+
id: string;
|
|
626
|
+
/** The type of tool call. This is always going to be code_interpreter for this type of tool call. */
|
|
627
|
+
type: 'code_interpreter';
|
|
628
|
+
/** The Code Interpreter tool call definition. */
|
|
629
|
+
code_interpreter: {
|
|
630
|
+
/**I The input to the Code Interpreter tool call. */
|
|
631
|
+
input: string;
|
|
632
|
+
/** The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (logs) or images (image). Each of these are represented by a different object type. */
|
|
633
|
+
outputs: OpenAIRunCodeInterpreterToolCallOutput[];
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
export type OpenAIRunCodeInterpreterToolCallOutput = OpenAIRunCodeInterpreterToolCallLogOutput | OpenAIRunCodeInterpreterToolCallImageOutput;
|
|
637
|
+
/** Text output from the Code Interpreter tool call as part of a run step. */
|
|
638
|
+
export type OpenAIRunCodeInterpreterToolCallLogOutput = {
|
|
639
|
+
/** Always logs. */
|
|
640
|
+
type: 'logs';
|
|
641
|
+
/** The text output from the Code Interpreter tool call. */
|
|
642
|
+
logs: string;
|
|
643
|
+
};
|
|
644
|
+
/** Code interpreter image output */
|
|
645
|
+
export type OpenAIRunCodeInterpreterToolCallImageOutput = {
|
|
646
|
+
/** Always image. */
|
|
647
|
+
type: 'image';
|
|
648
|
+
image: {
|
|
649
|
+
/** The file ID of the image. */
|
|
650
|
+
file_id: string;
|
|
651
|
+
};
|
|
652
|
+
};
|
|
653
|
+
export type ListThreadMessagesQuery = {
|
|
654
|
+
/** A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. */
|
|
655
|
+
limit?: number;
|
|
656
|
+
/** Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order. */
|
|
657
|
+
order?: string;
|
|
658
|
+
/** A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. */
|
|
659
|
+
after?: string;
|
|
660
|
+
/** A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. */
|
|
661
|
+
before?: string;
|
|
662
|
+
};
|
|
663
|
+
export type CreateRunBody = {
|
|
664
|
+
assistant_id: string;
|
|
665
|
+
model?: string;
|
|
666
|
+
instructions?: string;
|
|
667
|
+
tools?: OpenAIAssistantTool[];
|
|
668
|
+
metadata?: Record<string, string>;
|
|
669
|
+
};
|
|
670
|
+
export type SubmitToolOutputsBody = {
|
|
671
|
+
tool_outputs: SubmitToolOutputsBodyToolOutput[];
|
|
672
|
+
};
|
|
673
|
+
export type SubmitToolOutputsBodyToolOutput = {
|
|
674
|
+
/** The ID of the tool call in the required_action object within the run object the output is being submitted for. */
|
|
675
|
+
tool_call_id?: string;
|
|
676
|
+
/** The output of the tool call to be submitted to continue the run. */
|
|
677
|
+
output?: string;
|
|
678
|
+
};
|
|
679
|
+
/** Represents a step in execution of a run. */
|
|
680
|
+
export type OpenAIRunStep = {
|
|
681
|
+
/** The identifier of the run step, which can be referenced in API endpoints. */
|
|
682
|
+
id: string;
|
|
683
|
+
/** The object type, which is always `assistant.run.step``. */
|
|
684
|
+
object: 'thread.run.step';
|
|
685
|
+
/** The Unix timestamp (in seconds) for when the run step was created. */
|
|
686
|
+
created_at: number;
|
|
687
|
+
/** The ID of the assistant associated with the run step. */
|
|
688
|
+
assistant_id: string;
|
|
689
|
+
/** The ID of the thread that was run. */
|
|
690
|
+
thread_id: string;
|
|
691
|
+
/** The ID of the run that this run step is a part of. */
|
|
692
|
+
run_id: string;
|
|
693
|
+
/** The type of run step, which can be either message_creation or tool_calls. */
|
|
694
|
+
type: 'message_creation' | 'tool_calls';
|
|
695
|
+
/** The status of the run, which can be either in_progress, cancelled, failed, completed, or expired. */
|
|
696
|
+
status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired';
|
|
697
|
+
/** The details of the run step. */
|
|
698
|
+
step_details: OpenAIRunStepDetails;
|
|
699
|
+
/** The last error associated with this run step. Will be null if there are no errors. */
|
|
700
|
+
last_error: OpenAIErrorInfo | null;
|
|
701
|
+
/** The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. */
|
|
702
|
+
expired_at: number | null;
|
|
703
|
+
/** The Unix timestamp (in seconds) for when the run step was cancelled. */
|
|
704
|
+
cancelled_at: number | null;
|
|
705
|
+
/** The Unix timestamp (in seconds) for when the run step failed. */
|
|
706
|
+
failed_at: number | null;
|
|
707
|
+
/** The Unix timestamp (in seconds) for when the run step completed. */
|
|
708
|
+
completed_at: number | null;
|
|
709
|
+
/** Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long. */
|
|
710
|
+
metadata: Record<string, string>;
|
|
711
|
+
};
|
|
712
|
+
export type OpenAIRunStepDetails = OpenAIMessageCreationRunStepDetails | OpenAIToolCallRunStepDetails;
|
|
713
|
+
/** Details of the message creation by the run step. */
|
|
714
|
+
export type OpenAIMessageCreationRunStepDetails = {
|
|
715
|
+
/** Always `message_creation``. */
|
|
716
|
+
type: 'message_creation';
|
|
717
|
+
message_creation: {
|
|
718
|
+
/** The ID of the message that was created by this run step. */
|
|
719
|
+
message_id: string;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
export type OpenAIErrorInfo = {
|
|
723
|
+
/** One of server_error or rate_limit_exceeded. */
|
|
724
|
+
code: 'server_error' | 'rate_limit_exceeded';
|
|
725
|
+
/** A human-readable description of the error. */
|
|
726
|
+
message: string;
|
|
727
|
+
};
|
|
728
|
+
export type OpenAIToolCallRunStepDetails = {
|
|
729
|
+
type: 'tool_calls';
|
|
730
|
+
/** An array of tool calls the run step was involved in. These can be associated with one of three types of tools: code_interpreter, retrieval, or function. */
|
|
731
|
+
tool_calls: OpenAIRunToolCall[];
|
|
732
|
+
};
|
|
733
|
+
export type OpenAIListResponse<T> = {
|
|
734
|
+
object: 'list';
|
|
735
|
+
data: T[];
|
|
736
|
+
first_id: string;
|
|
737
|
+
last_id: string;
|
|
738
|
+
has_more: boolean;
|
|
739
|
+
};
|