@alpic80/rivet-core 1.24.0-aidon.4 → 1.24.2-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/README.md +9 -6
- package/dist/cjs/bundle.cjs +1395 -266
- package/dist/cjs/bundle.cjs.map +4 -4
- package/dist/esm/api/createProcessor.js +2 -0
- package/dist/esm/api/streaming.js +39 -6
- package/dist/esm/exports.js +1 -0
- package/dist/esm/integrations/CodeRunner.js +10 -2
- package/dist/esm/integrations/mcp/MCPBase.js +87 -0
- package/dist/esm/integrations/mcp/MCPProvider.js +23 -0
- package/dist/esm/integrations/mcp/MCPUtils.js +33 -0
- package/dist/esm/model/GraphProcessor.js +3 -0
- package/dist/esm/model/NodeRegistration.js +0 -1
- package/dist/esm/model/Nodes.js +9 -0
- package/dist/esm/model/nodes/ChatNodeBase.js +1 -1
- package/dist/esm/model/nodes/CodeNode.js +1 -1
- package/dist/esm/model/nodes/GetAllDatasetsNode.js +1 -1
- package/dist/esm/model/nodes/GraphInputNode.js +2 -0
- package/dist/esm/model/nodes/MCPDiscoveryNode.js +210 -0
- package/dist/esm/model/nodes/MCPGetPromptNode.js +233 -0
- package/dist/esm/model/nodes/MCPToolCallNode.js +261 -0
- package/dist/esm/model/nodes/ObjectNode.js +42 -21
- package/dist/esm/model/nodes/PromptNode.js +1 -1
- package/dist/esm/model/nodes/TextNode.js +13 -2
- package/dist/esm/plugins/anthropic/anthropic.js +22 -3
- package/dist/esm/plugins/anthropic/nodes/ChatAnthropicNode.js +33 -3
- package/dist/esm/plugins/google/google.js +29 -14
- package/dist/esm/plugins/google/nodes/ChatGoogleNode.js +70 -5
- package/dist/esm/utils/interpolation.js +155 -17
- package/dist/esm/utils/openai.js +24 -0
- package/dist/types/api/createProcessor.d.ts +3 -2
- package/dist/types/api/streaming.d.ts +8 -1
- package/dist/types/exports.d.ts +1 -0
- package/dist/types/integrations/CodeRunner.d.ts +4 -3
- package/dist/types/integrations/mcp/MCPBase.d.ts +18 -0
- package/dist/types/integrations/mcp/MCPProvider.d.ts +153 -0
- package/dist/types/integrations/mcp/MCPUtils.d.ts +9 -0
- package/dist/types/model/GraphProcessor.d.ts +1 -1
- package/dist/types/model/Nodes.d.ts +13 -2
- package/dist/types/model/ProcessContext.d.ts +5 -1
- package/dist/types/model/Project.d.ts +2 -0
- package/dist/types/model/nodes/GetAllDatasetsNode.d.ts +2 -2
- package/dist/types/model/nodes/MCPDiscoveryNode.d.ts +9 -0
- package/dist/types/model/nodes/MCPGetPromptNode.d.ts +23 -0
- package/dist/types/model/nodes/MCPToolCallNode.d.ts +26 -0
- package/dist/types/model/nodes/ObjectNode.d.ts +3 -2
- package/dist/types/model/nodes/TextNode.d.ts +2 -1
- package/dist/types/plugins/anthropic/anthropic.d.ts +21 -3
- package/dist/types/plugins/anthropic/nodes/ChatAnthropicNode.d.ts +5 -0
- package/dist/types/plugins/google/google.d.ts +12 -2
- package/dist/types/plugins/google/nodes/ChatGoogleNode.d.ts +7 -0
- package/dist/types/utils/interpolation.d.ts +6 -1
- package/dist/types/utils/openai.d.ts +24 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type NodeId, type Inputs, type Outputs, type GraphOutputs, type GraphProcessor } from '../index.js';
|
|
1
|
+
import { type NodeId, type Inputs, type Outputs, type GraphOutputs, type GraphProcessor, type DataValue, type RunGraphOptions } from '../index.js';
|
|
2
2
|
export type RivetEventStreamFilterSpec = {
|
|
3
3
|
/** Stream partial output deltas for the specified node IDs or node titles. */
|
|
4
4
|
partialOutputs?: string[] | true;
|
|
@@ -16,6 +16,8 @@ export type RivetEventStreamFilterSpec = {
|
|
|
16
16
|
nodeStart?: string[] | true;
|
|
17
17
|
/** Stream node finish events for the specified nodeIDs or node titles. */
|
|
18
18
|
nodeFinish?: string[] | true;
|
|
19
|
+
/** Optional list of user events (comma separated list) to stream as part of the output. */
|
|
20
|
+
userStreamEvents?: string | undefined;
|
|
19
21
|
};
|
|
20
22
|
/** Map of all possible event names to their data for streaming events. */
|
|
21
23
|
export type RivetEventStreamEvent = {
|
|
@@ -38,6 +40,10 @@ export type RivetEventStreamEvent = {
|
|
|
38
40
|
done: {
|
|
39
41
|
graphOutput: GraphOutputs;
|
|
40
42
|
};
|
|
43
|
+
event: {
|
|
44
|
+
name: string;
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
41
47
|
error: {
|
|
42
48
|
error: string;
|
|
43
49
|
};
|
|
@@ -49,6 +55,7 @@ export type RivetEventStreamEventInfo = {
|
|
|
49
55
|
}[keyof RivetEventStreamEvent];
|
|
50
56
|
/** A simplified way to listen and stream processor events, including filtering. */
|
|
51
57
|
export declare function getProcessorEvents(processor: GraphProcessor, spec: RivetEventStreamFilterSpec): AsyncGenerator<RivetEventStreamEventInfo, void>;
|
|
58
|
+
export declare const createOnStreamUserEvents: (eventList: string | undefined, handleUserEvent: (event: string, data: DataValue | undefined) => Promise<void>) => RunGraphOptions["onUserEvent"];
|
|
52
59
|
/**
|
|
53
60
|
* Creates a ReadableStream for processor events, following the Server-Sent Events protocol.
|
|
54
61
|
* https://developer.mozilla.org/en-US/docs/Web/API/EventSource
|
package/dist/types/exports.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './model/ProcessContext.js';
|
|
|
14
14
|
export * from './integrations/integrations.js';
|
|
15
15
|
import './integrations/enableIntegrations.js';
|
|
16
16
|
export * from './integrations/VectorDatabase.js';
|
|
17
|
+
export * from './integrations/mcp/MCPProvider.js';
|
|
17
18
|
export * from './integrations/EmbeddingGenerator.js';
|
|
18
19
|
export * from './integrations/LLMProvider.js';
|
|
19
20
|
export * from './recording/ExecutionRecorder.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Inputs, Outputs } from '../index.js';
|
|
2
|
+
import type { DataValue } from '../model/DataValue.js';
|
|
2
3
|
export interface CodeRunnerOptions {
|
|
3
4
|
includeRequire: boolean;
|
|
4
5
|
includeFetch: boolean;
|
|
@@ -8,11 +9,11 @@ export interface CodeRunnerOptions {
|
|
|
8
9
|
}
|
|
9
10
|
/** An object that can run arbitrary code (evals it). */
|
|
10
11
|
export interface CodeRunner {
|
|
11
|
-
runCode: (code: string, inputs: Inputs, options: CodeRunnerOptions) => Promise<Outputs>;
|
|
12
|
+
runCode: (code: string, inputs: Inputs, options: CodeRunnerOptions, graphInputs?: Record<string, DataValue>, contextValues?: Record<string, DataValue>) => Promise<Outputs>;
|
|
12
13
|
}
|
|
13
14
|
export declare class IsomorphicCodeRunner implements CodeRunner {
|
|
14
|
-
runCode(code: string, inputs: Inputs, options: CodeRunnerOptions): Promise<Outputs>;
|
|
15
|
+
runCode(code: string, inputs: Inputs, options: CodeRunnerOptions, graphInputs?: Record<string, DataValue>, contextValues?: Record<string, DataValue>): Promise<Outputs>;
|
|
15
16
|
}
|
|
16
17
|
export declare class NotAllowedCodeRunner implements CodeRunner {
|
|
17
|
-
runCode(_code: string, _inputs: Inputs, _options: CodeRunnerOptions): Promise<Outputs>;
|
|
18
|
+
runCode(_code: string, _inputs: Inputs, _options: CodeRunnerOptions, _graphInputs?: Record<string, DataValue>, _contextValues?: Record<string, DataValue>): Promise<Outputs>;
|
|
18
19
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EditorDefinition } from '../../model/EditorDefinition.js';
|
|
2
|
+
import type { ChartNode, NodeInputDefinition } from '../../model/NodeBase.js';
|
|
3
|
+
import type { RivetUIContext } from '../../model/RivetUIContext.js';
|
|
4
|
+
import type { MCP } from './MCPProvider.js';
|
|
5
|
+
export interface MCPBaseNodeData {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
transportType: MCP.TransportType;
|
|
9
|
+
serverUrl?: string;
|
|
10
|
+
serverId?: string;
|
|
11
|
+
useNameInput?: boolean;
|
|
12
|
+
useVersionInput?: boolean;
|
|
13
|
+
useServerUrlInput?: boolean;
|
|
14
|
+
useServerIdInput?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type MCPBaseNode = ChartNode<'mcpBase', MCPBaseNodeData>;
|
|
17
|
+
export declare const getMCPBaseInputs: (data: MCPBaseNodeData) => NodeInputDefinition[];
|
|
18
|
+
export declare const getMCPBaseEditors: (context: RivetUIContext, data: MCPBaseNodeData) => Promise<EditorDefinition<MCPBaseNode>[]>;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derived from types here - https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/types.ts
|
|
3
|
+
*/
|
|
4
|
+
export declare namespace MCP {
|
|
5
|
+
export type TransportType = 'stdio' | 'http';
|
|
6
|
+
export interface ServerConfig {
|
|
7
|
+
command: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
env?: Record<string, string>;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
alwaysAllow?: string[];
|
|
12
|
+
}
|
|
13
|
+
export type ServerConfigWithId = {
|
|
14
|
+
config: ServerConfig;
|
|
15
|
+
serverId: string;
|
|
16
|
+
};
|
|
17
|
+
export interface Config {
|
|
18
|
+
mcpServers: Record<string, ServerConfig>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Tools
|
|
22
|
+
*/
|
|
23
|
+
interface ToolAnnotations {
|
|
24
|
+
title?: string;
|
|
25
|
+
readOnlyHint?: boolean;
|
|
26
|
+
destructiveHint?: boolean;
|
|
27
|
+
idempotentHint?: boolean;
|
|
28
|
+
openWorldHint?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface Tool {
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
inputSchema: {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
};
|
|
36
|
+
annotations?: ToolAnnotations;
|
|
37
|
+
}
|
|
38
|
+
export interface ToolCallRequest {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
name: string;
|
|
41
|
+
arguments?: {
|
|
42
|
+
[x: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
id?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ToolCallResponse {
|
|
47
|
+
content: ResponseContent[];
|
|
48
|
+
isError?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Prompts
|
|
52
|
+
*/
|
|
53
|
+
interface PromptArgument {
|
|
54
|
+
name: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
required?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface Prompt {
|
|
59
|
+
name: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
arugments?: PromptArgument[];
|
|
62
|
+
}
|
|
63
|
+
export interface GetPromptRequest {
|
|
64
|
+
[x: string]: unknown;
|
|
65
|
+
name: string;
|
|
66
|
+
arguments?: {
|
|
67
|
+
[x: string]: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface PromptMessage {
|
|
71
|
+
role: 'user' | 'assistant';
|
|
72
|
+
content: ResponseContent;
|
|
73
|
+
}
|
|
74
|
+
export interface GetPromptResponse {
|
|
75
|
+
messages: PromptMessage[];
|
|
76
|
+
description?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Content
|
|
80
|
+
*/
|
|
81
|
+
interface BaseContent {
|
|
82
|
+
type: 'text' | 'image' | 'audio';
|
|
83
|
+
}
|
|
84
|
+
interface TextContent extends BaseContent {
|
|
85
|
+
type: 'text';
|
|
86
|
+
text: string;
|
|
87
|
+
}
|
|
88
|
+
interface ImageContent extends BaseContent {
|
|
89
|
+
type: 'image';
|
|
90
|
+
data: string;
|
|
91
|
+
mimeType: string;
|
|
92
|
+
}
|
|
93
|
+
interface AudioContent extends BaseContent {
|
|
94
|
+
type: 'audio';
|
|
95
|
+
data: string;
|
|
96
|
+
mimeType: string;
|
|
97
|
+
}
|
|
98
|
+
type ResponseContent = TextContent | ImageContent | AudioContent | {
|
|
99
|
+
[key: string]: unknown;
|
|
100
|
+
};
|
|
101
|
+
export {};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Errors
|
|
105
|
+
*/
|
|
106
|
+
export declare enum MCPErrorType {
|
|
107
|
+
CONFIG_NOT_FOUND = "CONFIG_NOT_FOUND",
|
|
108
|
+
SERVER_NOT_FOUND = "SERVER_NOT_FOUND",
|
|
109
|
+
SERVER_COMMUNICATION_FAILED = "SERVER_COMMUNICATION_FAILED",
|
|
110
|
+
INVALID_SCHEMA = "INVALID_SCHEMA"
|
|
111
|
+
}
|
|
112
|
+
export declare class MCPError extends Error {
|
|
113
|
+
type: MCPErrorType;
|
|
114
|
+
details?: unknown | undefined;
|
|
115
|
+
constructor(type: MCPErrorType, message: string, details?: unknown | undefined);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* MCP Provider for Node Implementation
|
|
119
|
+
*/
|
|
120
|
+
export interface MCPProvider {
|
|
121
|
+
getHTTPTools(clientConfig: {
|
|
122
|
+
name: string;
|
|
123
|
+
version: string;
|
|
124
|
+
}, serverUrl: string): Promise<MCP.Tool[]>;
|
|
125
|
+
getStdioTools(clientConfig: {
|
|
126
|
+
name: string;
|
|
127
|
+
version: string;
|
|
128
|
+
}, serverConfig: MCP.ServerConfigWithId): Promise<MCP.Tool[]>;
|
|
129
|
+
getHTTPrompts(clientConfig: {
|
|
130
|
+
name: string;
|
|
131
|
+
version: string;
|
|
132
|
+
}, serverUrl: string): Promise<MCP.Prompt[]>;
|
|
133
|
+
getStdioPrompts(clientConfig: {
|
|
134
|
+
name: string;
|
|
135
|
+
version: string;
|
|
136
|
+
}, serverConfig: MCP.ServerConfigWithId): Promise<MCP.Prompt[]>;
|
|
137
|
+
httpToolCall(clientConfig: {
|
|
138
|
+
name: string;
|
|
139
|
+
version: string;
|
|
140
|
+
}, serverUrl: string, toolCall: MCP.ToolCallRequest): Promise<MCP.ToolCallResponse>;
|
|
141
|
+
stdioToolCall(clientConfig: {
|
|
142
|
+
name: string;
|
|
143
|
+
version: string;
|
|
144
|
+
}, serverConfig: MCP.ServerConfigWithId, toolCall: MCP.ToolCallRequest): Promise<MCP.ToolCallResponse>;
|
|
145
|
+
getHTTPrompt(clientConfig: {
|
|
146
|
+
name: string;
|
|
147
|
+
version: string;
|
|
148
|
+
}, serverUrl: string, getPromptRequest: MCP.GetPromptRequest): Promise<MCP.GetPromptResponse>;
|
|
149
|
+
getStdioPrompt(clientConfig: {
|
|
150
|
+
name: string;
|
|
151
|
+
version: string;
|
|
152
|
+
}, serverConfig: MCP.ServerConfigWithId, getPromptRequest: MCP.GetPromptRequest): Promise<MCP.GetPromptResponse>;
|
|
153
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InternalProcessContext } from '../../model/ProcessContext.js';
|
|
2
|
+
import type { RivetUIContext } from '../../model/RivetUIContext.js';
|
|
3
|
+
import { type MCP } from './MCPProvider.js';
|
|
4
|
+
export declare const loadMCPConfiguration: (context: InternalProcessContext | RivetUIContext) => Promise<MCP.Config>;
|
|
5
|
+
export declare const getServerOptions: (context: RivetUIContext) => Promise<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}[]>;
|
|
9
|
+
export declare const getServerHelperMessage: (context: RivetUIContext, optionsLength: number) => string;
|
|
@@ -166,7 +166,7 @@ export declare class GraphProcessor {
|
|
|
166
166
|
recordingPlaybackChatLatency: number;
|
|
167
167
|
warnOnInvalidGraph: boolean;
|
|
168
168
|
get isRunning(): boolean;
|
|
169
|
-
constructor(project: Project, graphId?: GraphId, registry?: NodeRegistration, includeTrace?: boolean);
|
|
169
|
+
constructor(project: Project, graphId?: GraphId, registry?: NodeRegistration<any, any>, includeTrace?: boolean);
|
|
170
170
|
on: Emittery<ProcessEvents>["on"];
|
|
171
171
|
off: Emittery<ProcessEvents>["off"];
|
|
172
172
|
once: Emittery<ProcessEvents>["once"];
|
|
@@ -81,9 +81,20 @@ export * from './nodes/ToMarkdownTableNode.js';
|
|
|
81
81
|
export * from './nodes/CronNode.js';
|
|
82
82
|
export * from './nodes/ToTreeNode.js';
|
|
83
83
|
export * from './nodes/LoopUntilNode.js';
|
|
84
|
+
export * from './nodes/MCPDiscoveryNode.js';
|
|
85
|
+
export * from './nodes/MCPToolCallNode.js';
|
|
86
|
+
export * from './nodes/MCPGetPromptNode.js';
|
|
84
87
|
export * from './nodes/ReferencedGraphAliasNode.js';
|
|
85
|
-
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "
|
|
86
|
-
|
|
88
|
+
export declare const registerBuiltInNodes: (registry: NodeRegistration) => NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "userInput" | "prompt" | "chat" | "extractRegex" | "readDirectory" | "readFile" | "writeFile" | "ifElse" | "chunk" | "graphInput" | "graphOutput" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "setGlobal" | "raiseEvent" | "getGlobal" | "abortGraph" | "extractObjectPath" | "coalesce" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "imagetoMD" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias", 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/WriteFileNode.js").WriteFileNode | 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/ToolNode.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/ImageToMDNode.js").ImageToMDNode | 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 | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
89
|
+
type: "mcpDiscovery";
|
|
90
|
+
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
91
|
+
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
92
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
93
|
+
declare let globalRivetNodeRegistry: NodeRegistration<"number" | "boolean" | "object" | "pop" | "join" | "slice" | "filter" | "match" | "split" | "image" | "audio" | "document" | "if" | "code" | "text" | "context" | "array" | "userInput" | "prompt" | "chat" | "extractRegex" | "readDirectory" | "readFile" | "writeFile" | "ifElse" | "chunk" | "graphInput" | "graphOutput" | "subGraph" | "extractJson" | "assemblePrompt" | "extractYaml" | "loopController" | "trimChatMessages" | "externalCall" | "setGlobal" | "raiseEvent" | "getGlobal" | "abortGraph" | "extractObjectPath" | "coalesce" | "passthrough" | "waitForEvent" | "gptFunction" | "toYaml" | "getEmbedding" | "vectorStore" | "vectorNearestNeighbors" | "hash" | "raceInputs" | "toJson" | "compare" | "evaluate" | "randomNumber" | "shuffle" | "comment" | "imagetoMD" | "httpCall" | "delay" | "appendToDataset" | "createDataset" | "loadDataset" | "getAllDatasets" | "datasetNearestNeighbors" | "getDatasetRow" | "extractMarkdownCodeBlocks" | "assembleMessage" | "urlReference" | "destructure" | "replaceDataset" | "listGraphs" | "graphReference" | "callGraph" | "delegateFunctionCall" | "playAudio" | "chatLoop" | "readAllFiles" | "toMarkdownTable" | "cron" | "toTree" | "loopUntil" | "mcpDiscovery" | "mcpToolCall" | "mcpGetPrompt" | "referencedGraphAlias", 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/WriteFileNode.js").WriteFileNode | 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/ToolNode.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/ImageToMDNode.js").ImageToMDNode | 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 | import("./nodes/DocumentNode.js").DocumentNode | import("./nodes/ChatLoopNode.js").ChatLoopNode | import("./nodes/ReadAllFilesNode.js").ReadAllFilesNode | import("./nodes/ToMarkdownTableNode.js").ToMarkdownTableNode | import("./nodes/CronNode.js").CronNode | import("./nodes/ToTreeNode.js").ToTreeNode | import("./nodes/LoopUntilNode.js").LoopUntilNode | (import("./NodeBase.js").NodeBase & {
|
|
94
|
+
type: "mcpDiscovery";
|
|
95
|
+
data: import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData;
|
|
96
|
+
variants?: import("./NodeBase.js").ChartNodeVariant<import("./nodes/MCPDiscoveryNode.js").MCPDiscoveryNodeData>[] | undefined;
|
|
97
|
+
}) | import("./nodes/MCPToolCallNode.js").MCPToolCallNode | import("./nodes/MCPGetPromptNode.js").MCPGetPromptNode | import("./nodes/ReferencedGraphAliasNode.js").ReferencedGraphAliasNode>;
|
|
87
98
|
export { globalRivetNodeRegistry };
|
|
88
99
|
export type BuiltInNodes = typeof globalRivetNodeRegistry.NodesType;
|
|
89
100
|
export type BuiltInNodeType = typeof globalRivetNodeRegistry.NodeTypesType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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, type StringArrayDataValue, type ProjectId } from '../index.js';
|
|
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, type StringArrayDataValue, type ProjectId, type MCPProvider } from '../index.js';
|
|
3
3
|
import type { Tokenizer } from '../integrations/Tokenizer.js';
|
|
4
4
|
import type { CodeRunner } from '../integrations/CodeRunner.js';
|
|
5
5
|
import type { ProjectReferenceLoader } from './ProjectReferenceLoader.js';
|
|
@@ -8,6 +8,8 @@ export type ProcessContext = {
|
|
|
8
8
|
nativeApi?: NativeApi;
|
|
9
9
|
/** Sets the dataset provider to be used for all dataset node calls. */
|
|
10
10
|
datasetProvider?: DatasetProvider;
|
|
11
|
+
/** Provider for all MCP node functionality */
|
|
12
|
+
mcpProvider?: MCPProvider;
|
|
11
13
|
/** The provider responsible for being able to play audio. Undefined if unsupported in this context. */
|
|
12
14
|
audioProvider?: AudioProvider;
|
|
13
15
|
/** Sets the tokenizer that will be used for all nodes. If unset, the default GptTokenizerTokenizer will be used. */
|
|
@@ -46,6 +48,8 @@ export type InternalProcessContext<T extends ChartNode = ChartNode> = ProcessCon
|
|
|
46
48
|
graphInputs: Record<string, DataValue>;
|
|
47
49
|
/** Outputs from the graph. A GraphOutputNode will set these. */
|
|
48
50
|
graphOutputs: Record<string, DataValue>;
|
|
51
|
+
/** Stores the resolved output values of GraphInput nodes during execution, keyed by the node's data.id. */
|
|
52
|
+
graphInputNodeValues: Record<string, DataValue>;
|
|
49
53
|
/** The tokenizer to use to tokenize all strings.s */
|
|
50
54
|
tokenizer: Tokenizer;
|
|
51
55
|
/** The current node being executed. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Opaque } from 'type-fest';
|
|
2
2
|
import { type GraphId, type NodeGraph } from './NodeGraph.js';
|
|
3
3
|
import { type PluginLoadSpec } from './PluginLoadSpec.js';
|
|
4
|
+
import type { MCP } from '../integrations/mcp/MCPProvider.js';
|
|
4
5
|
export type ProjectId = Opaque<string, 'ProjectId'>;
|
|
5
6
|
export type DataId = Opaque<string, 'DataId'>;
|
|
6
7
|
export type Project = {
|
|
@@ -17,6 +18,7 @@ export type ProjectMetadata = {
|
|
|
17
18
|
description: string;
|
|
18
19
|
mainGraphId?: GraphId;
|
|
19
20
|
path?: string;
|
|
21
|
+
mcpServer?: MCP.Config;
|
|
20
22
|
};
|
|
21
23
|
/** A reference to another project file. Project references cannot be cyclic. */
|
|
22
24
|
export type ProjectReference = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChartNode, EditorDefinition, InternalProcessContext, NodeInputDefinition, NodeOutputDefinition, NodeUIData, Outputs } from '../../index.js';
|
|
1
|
+
import type { ChartNode, EditorDefinition, InternalProcessContext, NodeInputDefinition, NodeOutputDefinition, NodeUIData, Outputs, Inputs } from '../../index.js';
|
|
2
2
|
import { NodeImpl } from '../NodeImpl.js';
|
|
3
3
|
export type GetAllDatasetsNode = ChartNode<'getAllDatasets', GetAllDatasetsNodeData>;
|
|
4
4
|
type GetAllDatasetsNodeData = {};
|
|
@@ -8,7 +8,7 @@ export declare class GetAllDatasetsNodeImpl extends NodeImpl<GetAllDatasetsNode>
|
|
|
8
8
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
9
9
|
static getUIData(): NodeUIData;
|
|
10
10
|
getEditors(): EditorDefinition<GetAllDatasetsNode>[] | Promise<EditorDefinition<GetAllDatasetsNode>[]>;
|
|
11
|
-
process(context: InternalProcessContext): Promise<Outputs>;
|
|
11
|
+
process(_inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
12
12
|
}
|
|
13
13
|
export declare const getAllDatasetsNode: import("../NodeDefinition.js").NodeDefinition<GetAllDatasetsNode>;
|
|
14
14
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChartNode } from '../NodeBase.js';
|
|
2
|
+
import { type MCPBaseNodeData } from '../../integrations/mcp/MCPBase.js';
|
|
3
|
+
type MCPDiscoveryNode = ChartNode<'mcpDiscovery', MCPDiscoveryNodeData>;
|
|
4
|
+
export type MCPDiscoveryNodeData = MCPBaseNodeData & {
|
|
5
|
+
useToolsOutput?: boolean;
|
|
6
|
+
usePromptsOutput?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const mcpDiscoveryNode: import("../NodeDefinition.js").NodeDefinition<MCPDiscoveryNode>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
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, type InternalProcessContext } from '../../index.js';
|
|
5
|
+
import { type MCPBaseNodeData } from '../../integrations/mcp/MCPBase.js';
|
|
6
|
+
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
7
|
+
export type MCPGetPromptNode = ChartNode<'mcpGetPrompt', MCPGetPromptNodeData>;
|
|
8
|
+
export type MCPGetPromptNodeData = MCPBaseNodeData & {
|
|
9
|
+
promptName: string;
|
|
10
|
+
promptArguments?: string;
|
|
11
|
+
usePromptNameInput?: boolean;
|
|
12
|
+
usePromptArgumentsInput?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare class MCPGetPromptNodeImpl extends NodeImpl<MCPGetPromptNode> {
|
|
15
|
+
static create(): MCPGetPromptNode;
|
|
16
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
17
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
18
|
+
getEditors(context: RivetUIContext): Promise<EditorDefinition<MCPGetPromptNode>[]>;
|
|
19
|
+
getBody(context: RivetUIContext): string;
|
|
20
|
+
static getUIData(): NodeUIData;
|
|
21
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
22
|
+
}
|
|
23
|
+
export declare const mcpGetPromptNode: import("../NodeDefinition.js").NodeDefinition<MCPGetPromptNode>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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 '../../index.js';
|
|
5
|
+
import { type MCPBaseNodeData } from '../../integrations/mcp/MCPBase.js';
|
|
6
|
+
import type { RivetUIContext } from '../RivetUIContext.js';
|
|
7
|
+
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
8
|
+
export type MCPToolCallNode = ChartNode<'mcpToolCall', MCPToolCallNodeData>;
|
|
9
|
+
export type MCPToolCallNodeData = MCPBaseNodeData & {
|
|
10
|
+
toolName: string;
|
|
11
|
+
toolArguments?: string;
|
|
12
|
+
toolCallId?: string;
|
|
13
|
+
useToolNameInput?: boolean;
|
|
14
|
+
useToolArgumentsInput?: boolean;
|
|
15
|
+
useToolCallIdInput?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare class MCPToolCallNodeImpl extends NodeImpl<MCPToolCallNode> {
|
|
18
|
+
static create(): MCPToolCallNode;
|
|
19
|
+
getInputDefinitions(): NodeInputDefinition[];
|
|
20
|
+
getOutputDefinitions(): NodeOutputDefinition[];
|
|
21
|
+
getEditors(context: RivetUIContext): Promise<EditorDefinition<MCPToolCallNode>[]>;
|
|
22
|
+
getBody(context: RivetUIContext): string;
|
|
23
|
+
static getUIData(): NodeUIData;
|
|
24
|
+
process(inputs: Inputs, context: InternalProcessContext): Promise<Outputs>;
|
|
25
|
+
}
|
|
26
|
+
export declare const mcpToolCallNode: import("../NodeDefinition.js").NodeDefinition<MCPToolCallNode>;
|
|
@@ -2,6 +2,7 @@ import { type ChartNode, type NodeInputDefinition, type NodeOutputDefinition } f
|
|
|
2
2
|
import { NodeImpl, type NodeUIData } from '../NodeImpl.js';
|
|
3
3
|
import { type DataValue } from '../DataValue.js';
|
|
4
4
|
import { type EditorDefinition } from '../EditorDefinition.js';
|
|
5
|
+
import type { InternalProcessContext } from '../ProcessContext.js';
|
|
5
6
|
export type ObjectNode = ChartNode<'object', ObjectNodeData>;
|
|
6
7
|
export type ObjectNodeData = {
|
|
7
8
|
jsonTemplate: string;
|
|
@@ -12,7 +13,7 @@ export declare class ObjectNodeImpl extends NodeImpl<ObjectNode> {
|
|
|
12
13
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
13
14
|
getEditors(): EditorDefinition<ObjectNode>[];
|
|
14
15
|
static getUIData(): NodeUIData;
|
|
15
|
-
interpolate(baseString: string, values: Record<string, any>): string;
|
|
16
|
-
process(inputs: Record<string, DataValue
|
|
16
|
+
interpolate(baseString: string, values: Record<string, any>, graphInputNodeValues?: Record<string, DataValue>, contextValues?: Record<string, DataValue>): string;
|
|
17
|
+
process(inputs: Record<string, DataValue>, context: InternalProcessContext): Promise<Record<string, DataValue>>;
|
|
17
18
|
}
|
|
18
19
|
export declare const objectNode: import("../NodeDefinition.js").NodeDefinition<ObjectNode>;
|
|
@@ -5,6 +5,7 @@ import { type EditorDefinition, type NodeBodySpec } from '../../index.js';
|
|
|
5
5
|
export type TextNode = ChartNode<'text', TextNodeData>;
|
|
6
6
|
export type TextNodeData = {
|
|
7
7
|
text: string;
|
|
8
|
+
normalizeLineEndings?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare class TextNodeImpl extends NodeImpl<TextNode> {
|
|
10
11
|
static create(): TextNode;
|
|
@@ -12,7 +13,7 @@ export declare class TextNodeImpl extends NodeImpl<TextNode> {
|
|
|
12
13
|
getOutputDefinitions(): NodeOutputDefinition[];
|
|
13
14
|
getEditors(): EditorDefinition<TextNode>[];
|
|
14
15
|
getBody(): string | NodeBodySpec | undefined;
|
|
15
|
-
process(inputs: Record<string, DataValue
|
|
16
|
+
process(inputs: Record<string, DataValue>, context: any): Promise<Record<string, DataValue>>;
|
|
16
17
|
static getUIData(): NodeUIData;
|
|
17
18
|
}
|
|
18
19
|
export declare const textNode: import("../NodeDefinition.js").NodeDefinition<TextNode>;
|
|
@@ -87,6 +87,22 @@ export declare const anthropicModels: {
|
|
|
87
87
|
};
|
|
88
88
|
displayName: string;
|
|
89
89
|
};
|
|
90
|
+
'claude-sonnet-4-20250514': {
|
|
91
|
+
maxTokens: number;
|
|
92
|
+
cost: {
|
|
93
|
+
prompt: number;
|
|
94
|
+
completion: number;
|
|
95
|
+
};
|
|
96
|
+
displayName: string;
|
|
97
|
+
};
|
|
98
|
+
'claude-opus-4-20250514': {
|
|
99
|
+
maxTokens: number;
|
|
100
|
+
cost: {
|
|
101
|
+
prompt: number;
|
|
102
|
+
completion: number;
|
|
103
|
+
};
|
|
104
|
+
displayName: string;
|
|
105
|
+
};
|
|
90
106
|
};
|
|
91
107
|
export type AnthropicModels = keyof typeof anthropicModels;
|
|
92
108
|
export declare const anthropicModelOptions: {
|
|
@@ -161,6 +177,7 @@ export type ChatMessageOptions = {
|
|
|
161
177
|
input_schema: object;
|
|
162
178
|
}[];
|
|
163
179
|
beta?: string;
|
|
180
|
+
additionalHeaders?: Record<string, string>;
|
|
164
181
|
};
|
|
165
182
|
export type ChatCompletionOptions = {
|
|
166
183
|
apiEndpoint: string;
|
|
@@ -174,6 +191,7 @@ export type ChatCompletionOptions = {
|
|
|
174
191
|
top_k?: number;
|
|
175
192
|
signal?: AbortSignal;
|
|
176
193
|
stream?: boolean;
|
|
194
|
+
additionalHeaders?: Record<string, string>;
|
|
177
195
|
};
|
|
178
196
|
export type ChatCompletionChunk = {
|
|
179
197
|
completion: string;
|
|
@@ -287,9 +305,9 @@ export type ChatMessageCitation = {
|
|
|
287
305
|
page_number: number;
|
|
288
306
|
end_page_number: number;
|
|
289
307
|
};
|
|
290
|
-
export declare function streamChatCompletions({ apiEndpoint, apiKey, signal, ...rest }: ChatCompletionOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
291
|
-
export declare function callMessageApi({ apiEndpoint, apiKey, signal, tools, beta, ...rest }: ChatMessageOptions): Promise<ChatMessageResponse>;
|
|
292
|
-
export declare function streamMessageApi({ apiEndpoint, apiKey, signal, beta, ...rest }: ChatMessageOptions): AsyncGenerator<ChatMessageChunk>;
|
|
308
|
+
export declare function streamChatCompletions({ apiEndpoint, apiKey, signal, additionalHeaders, ...rest }: ChatCompletionOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
309
|
+
export declare function callMessageApi({ apiEndpoint, apiKey, signal, tools, beta, additionalHeaders, ...rest }: ChatMessageOptions): Promise<ChatMessageResponse>;
|
|
310
|
+
export declare function streamMessageApi({ apiEndpoint, apiKey, signal, beta, additionalHeaders, ...rest }: ChatMessageOptions): AsyncGenerator<ChatMessageChunk>;
|
|
293
311
|
export declare class AnthropicError extends Error {
|
|
294
312
|
readonly response: Response;
|
|
295
313
|
readonly responseJson: unknown;
|
|
@@ -13,6 +13,10 @@ export type ChatAnthropicNodeConfigData = {
|
|
|
13
13
|
endpoint?: string;
|
|
14
14
|
overrideModel?: string;
|
|
15
15
|
enableCitations?: boolean;
|
|
16
|
+
headers?: {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
16
20
|
};
|
|
17
21
|
export type ChatAnthropicNodeData = ChatAnthropicNodeConfigData & {
|
|
18
22
|
useModelInput: boolean;
|
|
@@ -25,6 +29,7 @@ export type ChatAnthropicNodeData = ChatAnthropicNodeConfigData & {
|
|
|
25
29
|
useStopInput: boolean;
|
|
26
30
|
useEndpointInput: boolean;
|
|
27
31
|
useOverrideModelInput: boolean;
|
|
32
|
+
useHeadersInput?: boolean;
|
|
28
33
|
/** Given the same set of inputs, return the same output without hitting GPT */
|
|
29
34
|
cache: boolean;
|
|
30
35
|
useAsGraphPartialOutput?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Content, type FunctionCall, type Tool } from '@google/
|
|
1
|
+
import { type Content, type FunctionCall, type Tool } from '@google/genai';
|
|
2
2
|
export type GoogleModelDeprecated = {
|
|
3
3
|
maxTokens: number;
|
|
4
4
|
cost: {
|
|
@@ -27,6 +27,14 @@ export declare const googleModelsDeprecated: {
|
|
|
27
27
|
};
|
|
28
28
|
export type GoogleModelsDeprecated = keyof typeof googleModelsDeprecated;
|
|
29
29
|
export declare const generativeAiGoogleModels: {
|
|
30
|
+
'gemini-2.5-flash-preview-04-17': {
|
|
31
|
+
maxTokens: number;
|
|
32
|
+
cost: {
|
|
33
|
+
prompt: number;
|
|
34
|
+
completion: number;
|
|
35
|
+
};
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
30
38
|
'gemini-2.0-flash-001': {
|
|
31
39
|
maxTokens: number;
|
|
32
40
|
cost: {
|
|
@@ -138,6 +146,8 @@ export type StreamGenerativeAiOptions = {
|
|
|
138
146
|
topK: number | undefined;
|
|
139
147
|
signal?: AbortSignal;
|
|
140
148
|
tools: Tool[] | undefined;
|
|
149
|
+
thinkingBudget?: number;
|
|
150
|
+
additionalHeaders?: Record<string, string>;
|
|
141
151
|
};
|
|
142
|
-
export declare function streamGenerativeAi({ apiKey, model, systemPrompt, prompt, maxOutputTokens, temperature, topP, topK, signal, tools, }: StreamGenerativeAiOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
152
|
+
export declare function streamGenerativeAi({ apiKey, model, systemPrompt, prompt, maxOutputTokens, temperature, topP, topK, signal, tools, thinkingBudget, additionalHeaders, }: StreamGenerativeAiOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
143
153
|
export declare function streamChatCompletions({ project, location, applicationCredentials, model, signal, max_output_tokens, temperature, top_p, top_k, prompt, }: ChatCompletionOptions): AsyncGenerator<ChatCompletionChunk>;
|
|
@@ -8,6 +8,11 @@ export type ChatGoogleNodeConfigData = {
|
|
|
8
8
|
top_p?: number;
|
|
9
9
|
top_k?: number;
|
|
10
10
|
maxTokens: number;
|
|
11
|
+
thinkingBudget: number | undefined;
|
|
12
|
+
headers?: {
|
|
13
|
+
key: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
11
16
|
};
|
|
12
17
|
export type ChatGoogleNodeData = ChatGoogleNodeConfigData & {
|
|
13
18
|
useModelInput: boolean;
|
|
@@ -17,6 +22,8 @@ export type ChatGoogleNodeData = ChatGoogleNodeConfigData & {
|
|
|
17
22
|
useUseTopPInput: boolean;
|
|
18
23
|
useMaxTokensInput: boolean;
|
|
19
24
|
useToolCalling: boolean;
|
|
25
|
+
useThinkingBudgetInput: boolean;
|
|
26
|
+
useHeadersInput?: boolean;
|
|
20
27
|
/** Given the same set of inputs, return the same output without hitting GPT */
|
|
21
28
|
cache: boolean;
|
|
22
29
|
useAsGraphPartialOutput?: boolean;
|