@librechat/agents 2.4.322 → 3.0.0-rc10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/agents/AgentContext.cjs +218 -0
- package/dist/cjs/agents/AgentContext.cjs.map +1 -0
- package/dist/cjs/common/enum.cjs +15 -5
- package/dist/cjs/common/enum.cjs.map +1 -1
- package/dist/cjs/events.cjs +10 -6
- package/dist/cjs/events.cjs.map +1 -1
- package/dist/cjs/graphs/Graph.cjs +309 -213
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/graphs/MultiAgentGraph.cjs +507 -0
- package/dist/cjs/graphs/MultiAgentGraph.cjs.map +1 -0
- package/dist/cjs/llm/anthropic/index.cjs +54 -9
- package/dist/cjs/llm/anthropic/index.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/types.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/message_inputs.cjs +52 -6
- package/dist/cjs/llm/anthropic/utils/message_inputs.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/message_outputs.cjs +22 -2
- package/dist/cjs/llm/anthropic/utils/message_outputs.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/tools.cjs +29 -0
- package/dist/cjs/llm/anthropic/utils/tools.cjs.map +1 -0
- package/dist/cjs/llm/google/index.cjs +144 -0
- package/dist/cjs/llm/google/index.cjs.map +1 -0
- package/dist/cjs/llm/google/utils/common.cjs +477 -0
- package/dist/cjs/llm/google/utils/common.cjs.map +1 -0
- package/dist/cjs/llm/ollama/index.cjs +67 -0
- package/dist/cjs/llm/ollama/index.cjs.map +1 -0
- package/dist/cjs/llm/ollama/utils.cjs +158 -0
- package/dist/cjs/llm/ollama/utils.cjs.map +1 -0
- package/dist/cjs/llm/openai/index.cjs +422 -3
- package/dist/cjs/llm/openai/index.cjs.map +1 -1
- package/dist/cjs/llm/openai/utils/index.cjs +672 -0
- package/dist/cjs/llm/openai/utils/index.cjs.map +1 -0
- package/dist/cjs/llm/providers.cjs +15 -15
- package/dist/cjs/llm/providers.cjs.map +1 -1
- package/dist/cjs/llm/text.cjs +14 -3
- package/dist/cjs/llm/text.cjs.map +1 -1
- package/dist/cjs/llm/vertexai/index.cjs +330 -0
- package/dist/cjs/llm/vertexai/index.cjs.map +1 -0
- package/dist/cjs/main.cjs +11 -0
- package/dist/cjs/main.cjs.map +1 -1
- package/dist/cjs/run.cjs +137 -85
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/stream.cjs +86 -52
- package/dist/cjs/stream.cjs.map +1 -1
- package/dist/cjs/tools/ToolNode.cjs +10 -4
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/handlers.cjs +119 -13
- package/dist/cjs/tools/handlers.cjs.map +1 -1
- package/dist/cjs/tools/search/anthropic.cjs +40 -0
- package/dist/cjs/tools/search/anthropic.cjs.map +1 -0
- package/dist/cjs/tools/search/firecrawl.cjs +55 -9
- package/dist/cjs/tools/search/firecrawl.cjs.map +1 -1
- package/dist/cjs/tools/search/format.cjs +6 -6
- package/dist/cjs/tools/search/format.cjs.map +1 -1
- package/dist/cjs/tools/search/rerankers.cjs +7 -29
- package/dist/cjs/tools/search/rerankers.cjs.map +1 -1
- package/dist/cjs/tools/search/search.cjs +86 -16
- package/dist/cjs/tools/search/search.cjs.map +1 -1
- package/dist/cjs/tools/search/tool.cjs +4 -2
- package/dist/cjs/tools/search/tool.cjs.map +1 -1
- package/dist/cjs/tools/search/utils.cjs +1 -1
- package/dist/cjs/tools/search/utils.cjs.map +1 -1
- package/dist/cjs/utils/events.cjs +31 -0
- package/dist/cjs/utils/events.cjs.map +1 -0
- package/dist/cjs/utils/title.cjs +57 -21
- package/dist/cjs/utils/title.cjs.map +1 -1
- package/dist/cjs/utils/tokens.cjs +54 -7
- package/dist/cjs/utils/tokens.cjs.map +1 -1
- package/dist/esm/agents/AgentContext.mjs +216 -0
- package/dist/esm/agents/AgentContext.mjs.map +1 -0
- package/dist/esm/common/enum.mjs +16 -6
- package/dist/esm/common/enum.mjs.map +1 -1
- package/dist/esm/events.mjs +10 -6
- package/dist/esm/events.mjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +311 -215
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/graphs/MultiAgentGraph.mjs +505 -0
- package/dist/esm/graphs/MultiAgentGraph.mjs.map +1 -0
- package/dist/esm/llm/anthropic/index.mjs +54 -9
- package/dist/esm/llm/anthropic/index.mjs.map +1 -1
- package/dist/esm/llm/anthropic/types.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/message_inputs.mjs +52 -6
- package/dist/esm/llm/anthropic/utils/message_inputs.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/message_outputs.mjs +22 -2
- package/dist/esm/llm/anthropic/utils/message_outputs.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/tools.mjs +27 -0
- package/dist/esm/llm/anthropic/utils/tools.mjs.map +1 -0
- package/dist/esm/llm/google/index.mjs +142 -0
- package/dist/esm/llm/google/index.mjs.map +1 -0
- package/dist/esm/llm/google/utils/common.mjs +471 -0
- package/dist/esm/llm/google/utils/common.mjs.map +1 -0
- package/dist/esm/llm/ollama/index.mjs +65 -0
- package/dist/esm/llm/ollama/index.mjs.map +1 -0
- package/dist/esm/llm/ollama/utils.mjs +155 -0
- package/dist/esm/llm/ollama/utils.mjs.map +1 -0
- package/dist/esm/llm/openai/index.mjs +421 -4
- package/dist/esm/llm/openai/index.mjs.map +1 -1
- package/dist/esm/llm/openai/utils/index.mjs +666 -0
- package/dist/esm/llm/openai/utils/index.mjs.map +1 -0
- package/dist/esm/llm/providers.mjs +5 -5
- package/dist/esm/llm/providers.mjs.map +1 -1
- package/dist/esm/llm/text.mjs +14 -3
- package/dist/esm/llm/text.mjs.map +1 -1
- package/dist/esm/llm/vertexai/index.mjs +328 -0
- package/dist/esm/llm/vertexai/index.mjs.map +1 -0
- package/dist/esm/main.mjs +6 -5
- package/dist/esm/main.mjs.map +1 -1
- package/dist/esm/run.mjs +138 -87
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/stream.mjs +88 -55
- package/dist/esm/stream.mjs.map +1 -1
- package/dist/esm/tools/ToolNode.mjs +10 -4
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/handlers.mjs +119 -15
- package/dist/esm/tools/handlers.mjs.map +1 -1
- package/dist/esm/tools/search/anthropic.mjs +37 -0
- package/dist/esm/tools/search/anthropic.mjs.map +1 -0
- package/dist/esm/tools/search/firecrawl.mjs +55 -9
- package/dist/esm/tools/search/firecrawl.mjs.map +1 -1
- package/dist/esm/tools/search/format.mjs +7 -7
- package/dist/esm/tools/search/format.mjs.map +1 -1
- package/dist/esm/tools/search/rerankers.mjs +7 -29
- package/dist/esm/tools/search/rerankers.mjs.map +1 -1
- package/dist/esm/tools/search/search.mjs +86 -16
- package/dist/esm/tools/search/search.mjs.map +1 -1
- package/dist/esm/tools/search/tool.mjs +4 -2
- package/dist/esm/tools/search/tool.mjs.map +1 -1
- package/dist/esm/tools/search/utils.mjs +1 -1
- package/dist/esm/tools/search/utils.mjs.map +1 -1
- package/dist/esm/utils/events.mjs +29 -0
- package/dist/esm/utils/events.mjs.map +1 -0
- package/dist/esm/utils/title.mjs +57 -22
- package/dist/esm/utils/title.mjs.map +1 -1
- package/dist/esm/utils/tokens.mjs +54 -8
- package/dist/esm/utils/tokens.mjs.map +1 -1
- package/dist/types/agents/AgentContext.d.ts +91 -0
- package/dist/types/common/enum.d.ts +17 -7
- package/dist/types/events.d.ts +5 -4
- package/dist/types/graphs/Graph.d.ts +64 -67
- package/dist/types/graphs/MultiAgentGraph.d.ts +47 -0
- package/dist/types/graphs/index.d.ts +1 -0
- package/dist/types/llm/anthropic/index.d.ts +11 -0
- package/dist/types/llm/anthropic/types.d.ts +9 -3
- package/dist/types/llm/anthropic/utils/message_inputs.d.ts +1 -1
- package/dist/types/llm/anthropic/utils/output_parsers.d.ts +4 -4
- package/dist/types/llm/anthropic/utils/tools.d.ts +3 -0
- package/dist/types/llm/google/index.d.ts +13 -0
- package/dist/types/llm/google/types.d.ts +32 -0
- package/dist/types/llm/google/utils/common.d.ts +19 -0
- package/dist/types/llm/google/utils/tools.d.ts +10 -0
- package/dist/types/llm/google/utils/zod_to_genai_parameters.d.ts +14 -0
- package/dist/types/llm/ollama/index.d.ts +7 -0
- package/dist/types/llm/ollama/utils.d.ts +7 -0
- package/dist/types/llm/openai/index.d.ts +82 -3
- package/dist/types/llm/openai/types.d.ts +10 -0
- package/dist/types/llm/openai/utils/index.d.ts +20 -0
- package/dist/types/llm/text.d.ts +1 -1
- package/dist/types/llm/vertexai/index.d.ts +293 -0
- package/dist/types/messages/reducer.d.ts +9 -0
- package/dist/types/run.d.ts +19 -12
- package/dist/types/stream.d.ts +10 -3
- package/dist/types/tools/CodeExecutor.d.ts +2 -2
- package/dist/types/tools/ToolNode.d.ts +1 -1
- package/dist/types/tools/handlers.d.ts +17 -4
- package/dist/types/tools/search/anthropic.d.ts +16 -0
- package/dist/types/tools/search/firecrawl.d.ts +15 -0
- package/dist/types/tools/search/rerankers.d.ts +0 -1
- package/dist/types/tools/search/types.d.ts +30 -9
- package/dist/types/types/graph.d.ts +129 -15
- package/dist/types/types/llm.d.ts +25 -10
- package/dist/types/types/run.d.ts +50 -8
- package/dist/types/types/stream.d.ts +16 -2
- package/dist/types/types/tools.d.ts +1 -1
- package/dist/types/utils/events.d.ts +6 -0
- package/dist/types/utils/title.d.ts +2 -1
- package/dist/types/utils/tokens.d.ts +24 -0
- package/package.json +41 -17
- package/src/agents/AgentContext.ts +315 -0
- package/src/common/enum.ts +15 -5
- package/src/events.ts +24 -13
- package/src/graphs/Graph.ts +495 -313
- package/src/graphs/MultiAgentGraph.ts +598 -0
- package/src/graphs/index.ts +2 -1
- package/src/llm/anthropic/Jacob_Lee_Resume_2023.pdf +0 -0
- package/src/llm/anthropic/index.ts +78 -13
- package/src/llm/anthropic/llm.spec.ts +491 -115
- package/src/llm/anthropic/types.ts +39 -3
- package/src/llm/anthropic/utils/message_inputs.ts +67 -11
- package/src/llm/anthropic/utils/message_outputs.ts +21 -2
- package/src/llm/anthropic/utils/output_parsers.ts +25 -6
- package/src/llm/anthropic/utils/tools.ts +29 -0
- package/src/llm/google/index.ts +218 -0
- package/src/llm/google/types.ts +43 -0
- package/src/llm/google/utils/common.ts +646 -0
- package/src/llm/google/utils/tools.ts +160 -0
- package/src/llm/google/utils/zod_to_genai_parameters.ts +86 -0
- package/src/llm/ollama/index.ts +89 -0
- package/src/llm/ollama/utils.ts +193 -0
- package/src/llm/openai/index.ts +641 -14
- package/src/llm/openai/types.ts +24 -0
- package/src/llm/openai/utils/index.ts +912 -0
- package/src/llm/openai/utils/isReasoningModel.test.ts +90 -0
- package/src/llm/providers.ts +10 -9
- package/src/llm/text.ts +26 -7
- package/src/llm/vertexai/index.ts +360 -0
- package/src/messages/reducer.ts +80 -0
- package/src/run.ts +196 -116
- package/src/scripts/ant_web_search.ts +158 -0
- package/src/scripts/args.ts +12 -8
- package/src/scripts/cli4.ts +29 -21
- package/src/scripts/cli5.ts +29 -21
- package/src/scripts/code_exec.ts +54 -23
- package/src/scripts/code_exec_files.ts +48 -17
- package/src/scripts/code_exec_simple.ts +46 -27
- package/src/scripts/handoff-test.ts +135 -0
- package/src/scripts/image.ts +52 -20
- package/src/scripts/multi-agent-chain.ts +278 -0
- package/src/scripts/multi-agent-conditional.ts +220 -0
- package/src/scripts/multi-agent-document-review-chain.ts +197 -0
- package/src/scripts/multi-agent-hybrid-flow.ts +310 -0
- package/src/scripts/multi-agent-parallel.ts +341 -0
- package/src/scripts/multi-agent-sequence.ts +212 -0
- package/src/scripts/multi-agent-supervisor.ts +362 -0
- package/src/scripts/multi-agent-test.ts +186 -0
- package/src/scripts/search.ts +1 -9
- package/src/scripts/simple.ts +25 -10
- package/src/scripts/test-custom-prompt-key.ts +145 -0
- package/src/scripts/test-handoff-input.ts +170 -0
- package/src/scripts/test-multi-agent-list-handoff.ts +261 -0
- package/src/scripts/test-tools-before-handoff.ts +233 -0
- package/src/scripts/tools.ts +48 -18
- package/src/specs/anthropic.simple.test.ts +150 -34
- package/src/specs/azure.simple.test.ts +325 -0
- package/src/specs/openai.simple.test.ts +140 -33
- package/src/specs/openrouter.simple.test.ts +107 -0
- package/src/specs/prune.test.ts +4 -9
- package/src/specs/reasoning.test.ts +80 -44
- package/src/specs/token-memoization.test.ts +39 -0
- package/src/stream.test.ts +94 -0
- package/src/stream.ts +143 -61
- package/src/tools/ToolNode.ts +21 -7
- package/src/tools/handlers.ts +192 -18
- package/src/tools/search/anthropic.ts +51 -0
- package/src/tools/search/firecrawl.ts +69 -20
- package/src/tools/search/format.ts +6 -8
- package/src/tools/search/rerankers.ts +7 -40
- package/src/tools/search/search.ts +97 -16
- package/src/tools/search/tool.ts +5 -2
- package/src/tools/search/types.ts +30 -10
- package/src/tools/search/utils.ts +1 -1
- package/src/types/graph.ts +318 -103
- package/src/types/llm.ts +26 -12
- package/src/types/run.ts +56 -13
- package/src/types/stream.ts +22 -1
- package/src/types/tools.ts +16 -10
- package/src/utils/events.ts +32 -0
- package/src/utils/llmConfig.ts +19 -7
- package/src/utils/title.ts +104 -30
- package/src/utils/tokens.ts +69 -10
- package/dist/types/scripts/abort.d.ts +0 -1
- package/dist/types/scripts/args.d.ts +0 -6
- package/dist/types/scripts/caching.d.ts +0 -1
- package/dist/types/scripts/cli.d.ts +0 -1
- package/dist/types/scripts/cli2.d.ts +0 -1
- package/dist/types/scripts/cli3.d.ts +0 -1
- package/dist/types/scripts/cli4.d.ts +0 -1
- package/dist/types/scripts/cli5.d.ts +0 -1
- package/dist/types/scripts/code_exec.d.ts +0 -1
- package/dist/types/scripts/code_exec_files.d.ts +0 -1
- package/dist/types/scripts/code_exec_simple.d.ts +0 -1
- package/dist/types/scripts/content.d.ts +0 -1
- package/dist/types/scripts/empty_input.d.ts +0 -1
- package/dist/types/scripts/image.d.ts +0 -1
- package/dist/types/scripts/memory.d.ts +0 -1
- package/dist/types/scripts/search.d.ts +0 -1
- package/dist/types/scripts/simple.d.ts +0 -1
- package/dist/types/scripts/stream.d.ts +0 -1
- package/dist/types/scripts/thinking.d.ts +0 -1
- package/dist/types/scripts/tools.d.ts +0 -1
- package/dist/types/specs/spec.utils.d.ts +0 -1
package/src/scripts/cli4.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type * as t from '@/types';
|
|
|
8
8
|
import { ModelEndHandler, ToolEndHandler } from '@/events';
|
|
9
9
|
import { ChatModelStreamHandler } from '@/stream';
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
import { getArgs } from '@/scripts/args';
|
|
13
12
|
import { Run } from '@/run';
|
|
14
13
|
import { GraphEvents, Callback, Providers } from '@/common';
|
|
@@ -25,31 +24,35 @@ async function testStandardStreaming(): Promise<void> {
|
|
|
25
24
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
26
25
|
console.log('====== ON_RUN_STEP_COMPLETED ======');
|
|
27
26
|
console.dir(data, { depth: null });
|
|
28
|
-
}
|
|
27
|
+
},
|
|
29
28
|
},
|
|
30
29
|
[GraphEvents.ON_RUN_STEP]: {
|
|
31
30
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
32
31
|
console.log('====== ON_RUN_STEP ======');
|
|
33
32
|
console.dir(data, { depth: null });
|
|
34
|
-
}
|
|
33
|
+
},
|
|
35
34
|
},
|
|
36
35
|
[GraphEvents.ON_RUN_STEP_DELTA]: {
|
|
37
36
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
38
37
|
console.log('====== ON_RUN_STEP_DELTA ======');
|
|
39
38
|
console.dir(data, { depth: null });
|
|
40
|
-
}
|
|
39
|
+
},
|
|
41
40
|
},
|
|
42
41
|
[GraphEvents.ON_MESSAGE_DELTA]: {
|
|
43
42
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
44
43
|
console.log('====== ON_MESSAGE_DELTA ======');
|
|
45
44
|
console.dir(data, { depth: null });
|
|
46
|
-
}
|
|
45
|
+
},
|
|
47
46
|
},
|
|
48
47
|
[GraphEvents.TOOL_START]: {
|
|
49
|
-
handle: (
|
|
48
|
+
handle: (
|
|
49
|
+
_event: string,
|
|
50
|
+
data: t.StreamEventData,
|
|
51
|
+
metadata?: Record<string, unknown>
|
|
52
|
+
): void => {
|
|
50
53
|
console.log('====== TOOL_START ======');
|
|
51
54
|
console.dir(data, { depth: null });
|
|
52
|
-
}
|
|
55
|
+
},
|
|
53
56
|
},
|
|
54
57
|
// [GraphEvents.LLM_STREAM]: new LLMStreamHandler(),
|
|
55
58
|
// [GraphEvents.LLM_START]: {
|
|
@@ -90,11 +93,12 @@ async function testStandardStreaming(): Promise<void> {
|
|
|
90
93
|
// const llmConfig = getLLMConfig(provider);
|
|
91
94
|
let llmConfig = getLLMConfig(Providers.OPENAI);
|
|
92
95
|
|
|
93
|
-
const graphConfig: t.
|
|
96
|
+
const graphConfig: t.LegacyGraphConfig = {
|
|
94
97
|
type: 'standard',
|
|
95
98
|
llmConfig,
|
|
96
99
|
tools: [new TavilySearchResults()],
|
|
97
|
-
instructions:
|
|
100
|
+
instructions:
|
|
101
|
+
'You are a friendly AI assistant. Always address the user by their name.',
|
|
98
102
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
99
103
|
};
|
|
100
104
|
|
|
@@ -116,21 +120,25 @@ async function testStandardStreaming(): Promise<void> {
|
|
|
116
120
|
console.log(' Test 1: OpenAI Tool Usage');
|
|
117
121
|
|
|
118
122
|
// conversationHistory.push(new HumanMessage(`Hi I'm ${userName}.`));
|
|
119
|
-
conversationHistory.push(
|
|
120
|
-
|
|
123
|
+
conversationHistory.push(
|
|
124
|
+
new HumanMessage(`search for good sunrise hikes near ${location}
|
|
125
|
+
then search weather in ${location} for today which is ${currentDate}`)
|
|
126
|
+
);
|
|
121
127
|
let inputs = {
|
|
122
128
|
messages: conversationHistory,
|
|
123
129
|
};
|
|
124
|
-
const contentParts = await run.processStream(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
const contentParts = await run.processStream(
|
|
131
|
+
inputs,
|
|
132
|
+
config
|
|
133
|
+
// {
|
|
134
|
+
// [Callback.TOOL_START]: (graph, ...args) => {
|
|
135
|
+
// console.log('TOOL_START callback');
|
|
136
|
+
// },
|
|
137
|
+
// [Callback.TOOL_END]: (graph, ...args) => {
|
|
138
|
+
// console.log('TOOL_END callback');
|
|
139
|
+
// },
|
|
140
|
+
// }
|
|
141
|
+
);
|
|
134
142
|
const finalMessages = run.getRunMessages();
|
|
135
143
|
if (finalMessages) {
|
|
136
144
|
conversationHistory.push(...finalMessages);
|
package/src/scripts/cli5.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type * as t from '@/types';
|
|
|
8
8
|
import { ModelEndHandler, ToolEndHandler } from '@/events';
|
|
9
9
|
import { ChatModelStreamHandler } from '@/stream';
|
|
10
10
|
|
|
11
|
-
|
|
12
11
|
import { getArgs } from '@/scripts/args';
|
|
13
12
|
import { Run } from '@/run';
|
|
14
13
|
import { GraphEvents, Callback, Providers } from '@/common';
|
|
@@ -25,31 +24,35 @@ async function testStandardStreaming(): Promise<void> {
|
|
|
25
24
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
26
25
|
console.log('====== ON_RUN_STEP_COMPLETED ======');
|
|
27
26
|
console.dir(data, { depth: null });
|
|
28
|
-
}
|
|
27
|
+
},
|
|
29
28
|
},
|
|
30
29
|
[GraphEvents.ON_RUN_STEP]: {
|
|
31
30
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
32
31
|
console.log('====== ON_RUN_STEP ======');
|
|
33
32
|
console.dir(data, { depth: null });
|
|
34
|
-
}
|
|
33
|
+
},
|
|
35
34
|
},
|
|
36
35
|
[GraphEvents.ON_RUN_STEP_DELTA]: {
|
|
37
36
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
38
37
|
console.log('====== ON_RUN_STEP_DELTA ======');
|
|
39
38
|
console.dir(data, { depth: null });
|
|
40
|
-
}
|
|
39
|
+
},
|
|
41
40
|
},
|
|
42
41
|
[GraphEvents.ON_MESSAGE_DELTA]: {
|
|
43
42
|
handle: (_event: string, data: t.StreamEventData): void => {
|
|
44
43
|
console.log('====== ON_MESSAGE_DELTA ======');
|
|
45
44
|
console.dir(data, { depth: null });
|
|
46
|
-
}
|
|
45
|
+
},
|
|
47
46
|
},
|
|
48
47
|
[GraphEvents.TOOL_START]: {
|
|
49
|
-
handle: (
|
|
48
|
+
handle: (
|
|
49
|
+
_event: string,
|
|
50
|
+
data: t.StreamEventData,
|
|
51
|
+
metadata?: Record<string, unknown>
|
|
52
|
+
): void => {
|
|
50
53
|
console.log('====== TOOL_START ======');
|
|
51
54
|
console.dir(data, { depth: null });
|
|
52
|
-
}
|
|
55
|
+
},
|
|
53
56
|
},
|
|
54
57
|
// [GraphEvents.LLM_STREAM]: new LLMStreamHandler(),
|
|
55
58
|
// [GraphEvents.LLM_START]: {
|
|
@@ -90,11 +93,12 @@ async function testStandardStreaming(): Promise<void> {
|
|
|
90
93
|
// const llmConfig = getLLMConfig(provider);
|
|
91
94
|
let llmConfig = getLLMConfig(Providers.ANTHROPIC);
|
|
92
95
|
|
|
93
|
-
const graphConfig: t.
|
|
96
|
+
const graphConfig: t.LegacyGraphConfig = {
|
|
94
97
|
type: 'standard',
|
|
95
98
|
llmConfig,
|
|
96
99
|
tools: [new TavilySearchResults()],
|
|
97
|
-
instructions:
|
|
100
|
+
instructions:
|
|
101
|
+
'You are a friendly AI assistant. Always address the user by their name.',
|
|
98
102
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
99
103
|
};
|
|
100
104
|
|
|
@@ -116,21 +120,25 @@ async function testStandardStreaming(): Promise<void> {
|
|
|
116
120
|
console.log(' Test 1: Anthropic Tool Usage');
|
|
117
121
|
|
|
118
122
|
// conversationHistory.push(new HumanMessage(`Hi I'm ${userName}.`));
|
|
119
|
-
conversationHistory.push(
|
|
120
|
-
|
|
123
|
+
conversationHistory.push(
|
|
124
|
+
new HumanMessage(`search for good sunrise hikes near ${location}
|
|
125
|
+
then search weather in ${location} for today which is ${currentDate}`)
|
|
126
|
+
);
|
|
121
127
|
let inputs = {
|
|
122
128
|
messages: conversationHistory,
|
|
123
129
|
};
|
|
124
|
-
const contentParts = await run.processStream(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
const contentParts = await run.processStream(
|
|
131
|
+
inputs,
|
|
132
|
+
config
|
|
133
|
+
// {
|
|
134
|
+
// [Callback.TOOL_START]: (graph, ...args) => {
|
|
135
|
+
// console.log('TOOL_START callback');
|
|
136
|
+
// },
|
|
137
|
+
// [Callback.TOOL_END]: (graph, ...args) => {
|
|
138
|
+
// console.log('TOOL_END callback');
|
|
139
|
+
// },
|
|
140
|
+
// }
|
|
141
|
+
);
|
|
134
142
|
const finalMessages = run.getRunMessages();
|
|
135
143
|
if (finalMessages) {
|
|
136
144
|
conversationHistory.push(...finalMessages);
|
package/src/scripts/code_exec.ts
CHANGED
|
@@ -6,7 +6,11 @@ import { TavilySearchResults } from '@langchain/community/tools/tavily_search';
|
|
|
6
6
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
7
7
|
import type * as t from '@/types';
|
|
8
8
|
import { ChatModelStreamHandler, createContentAggregator } from '@/stream';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ToolEndHandler,
|
|
11
|
+
ModelEndHandler,
|
|
12
|
+
createMetadataAggregator,
|
|
13
|
+
} from '@/events';
|
|
10
14
|
import { getLLMConfig } from '@/utils/llmConfig';
|
|
11
15
|
import { getArgs } from '@/scripts/args';
|
|
12
16
|
import { GraphEvents } from '@/common';
|
|
@@ -23,38 +27,57 @@ async function testCodeExecution(): Promise<void> {
|
|
|
23
27
|
[GraphEvents.CHAT_MODEL_END]: new ModelEndHandler(),
|
|
24
28
|
[GraphEvents.CHAT_MODEL_STREAM]: new ChatModelStreamHandler(),
|
|
25
29
|
[GraphEvents.ON_RUN_STEP_COMPLETED]: {
|
|
26
|
-
handle: (
|
|
30
|
+
handle: (
|
|
31
|
+
event: GraphEvents.ON_RUN_STEP_COMPLETED,
|
|
32
|
+
data: t.StreamEventData
|
|
33
|
+
): void => {
|
|
27
34
|
console.log('====== ON_RUN_STEP_COMPLETED ======');
|
|
28
35
|
console.dir(data, { depth: null });
|
|
29
|
-
aggregateContent({
|
|
30
|
-
|
|
36
|
+
aggregateContent({
|
|
37
|
+
event,
|
|
38
|
+
data: data as unknown as { result: t.ToolEndEvent },
|
|
39
|
+
});
|
|
40
|
+
},
|
|
31
41
|
},
|
|
32
42
|
[GraphEvents.ON_RUN_STEP]: {
|
|
33
|
-
handle: (
|
|
43
|
+
handle: (
|
|
44
|
+
event: GraphEvents.ON_RUN_STEP,
|
|
45
|
+
data: t.StreamEventData
|
|
46
|
+
): void => {
|
|
34
47
|
console.log('====== ON_RUN_STEP ======');
|
|
35
48
|
console.dir(data, { depth: null });
|
|
36
49
|
aggregateContent({ event, data: data as t.RunStep });
|
|
37
|
-
}
|
|
50
|
+
},
|
|
38
51
|
},
|
|
39
52
|
[GraphEvents.ON_RUN_STEP_DELTA]: {
|
|
40
|
-
handle: (
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
handle: (
|
|
54
|
+
event: GraphEvents.ON_RUN_STEP_DELTA,
|
|
55
|
+
data: t.StreamEventData
|
|
56
|
+
): void => {
|
|
57
|
+
// console.log('====== ON_RUN_STEP_DELTA ======');
|
|
58
|
+
// console.dir(data, { depth: null });
|
|
43
59
|
aggregateContent({ event, data: data as t.RunStepDeltaEvent });
|
|
44
|
-
}
|
|
60
|
+
},
|
|
45
61
|
},
|
|
46
62
|
[GraphEvents.ON_MESSAGE_DELTA]: {
|
|
47
|
-
handle: (
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
handle: (
|
|
64
|
+
event: GraphEvents.ON_MESSAGE_DELTA,
|
|
65
|
+
data: t.StreamEventData
|
|
66
|
+
): void => {
|
|
67
|
+
// console.log('====== ON_MESSAGE_DELTA ======');
|
|
68
|
+
// console.dir(data, { depth: null });
|
|
50
69
|
aggregateContent({ event, data: data as t.MessageDeltaEvent });
|
|
51
|
-
}
|
|
70
|
+
},
|
|
52
71
|
},
|
|
53
72
|
[GraphEvents.TOOL_START]: {
|
|
54
|
-
handle: (
|
|
73
|
+
handle: (
|
|
74
|
+
_event: string,
|
|
75
|
+
data: t.StreamEventData,
|
|
76
|
+
metadata?: Record<string, unknown>
|
|
77
|
+
): void => {
|
|
55
78
|
console.log('====== TOOL_START ======');
|
|
56
79
|
console.dir(data, { depth: null });
|
|
57
|
-
}
|
|
80
|
+
},
|
|
58
81
|
},
|
|
59
82
|
};
|
|
60
83
|
|
|
@@ -66,14 +89,19 @@ async function testCodeExecution(): Promise<void> {
|
|
|
66
89
|
type: 'standard',
|
|
67
90
|
llmConfig,
|
|
68
91
|
tools: [new TavilySearchResults(), createCodeExecutionTool()],
|
|
69
|
-
instructions:
|
|
92
|
+
instructions:
|
|
93
|
+
'You are a friendly AI assistant with coding capabilities. Always address the user by their name.',
|
|
70
94
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
71
95
|
},
|
|
72
96
|
returnContent: true,
|
|
73
97
|
customHandlers,
|
|
74
98
|
});
|
|
75
99
|
|
|
76
|
-
const config: Partial<RunnableConfig> & {
|
|
100
|
+
const config: Partial<RunnableConfig> & {
|
|
101
|
+
version: 'v1' | 'v2';
|
|
102
|
+
run_id?: string;
|
|
103
|
+
streamMode: string;
|
|
104
|
+
} = {
|
|
77
105
|
configurable: {
|
|
78
106
|
provider,
|
|
79
107
|
thread_id: 'conversation-num-1',
|
|
@@ -148,16 +176,19 @@ async function testCodeExecution(): Promise<void> {
|
|
|
148
176
|
conversationHistory.push(...finalMessages2);
|
|
149
177
|
}
|
|
150
178
|
console.log('\n\n====================\n\n');
|
|
151
|
-
console.dir(
|
|
179
|
+
console.dir(finalContentParts2, { depth: null });
|
|
152
180
|
|
|
153
181
|
const { handleLLMEnd, collected } = createMetadataAggregator();
|
|
154
182
|
const titleResult = await run.generateTitle({
|
|
183
|
+
provider,
|
|
155
184
|
inputText: userMessage2,
|
|
156
185
|
contentParts,
|
|
157
186
|
chainOptions: {
|
|
158
|
-
callbacks: [
|
|
159
|
-
|
|
160
|
-
|
|
187
|
+
callbacks: [
|
|
188
|
+
{
|
|
189
|
+
handleLLMEnd,
|
|
190
|
+
},
|
|
191
|
+
],
|
|
161
192
|
},
|
|
162
193
|
});
|
|
163
194
|
console.log('Generated Title:', titleResult);
|
|
@@ -180,4 +211,4 @@ testCodeExecution().catch((err) => {
|
|
|
180
211
|
console.log('Conversation history:');
|
|
181
212
|
console.dir(conversationHistory, { depth: null });
|
|
182
213
|
process.exit(1);
|
|
183
|
-
});
|
|
214
|
+
});
|
|
@@ -5,7 +5,11 @@ import { HumanMessage, BaseMessage } from '@langchain/core/messages';
|
|
|
5
5
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
6
6
|
import type * as t from '@/types';
|
|
7
7
|
import { ChatModelStreamHandler, createContentAggregator } from '@/stream';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
ToolEndHandler,
|
|
10
|
+
ModelEndHandler,
|
|
11
|
+
createMetadataAggregator,
|
|
12
|
+
} from '@/events';
|
|
9
13
|
import { getLLMConfig } from '@/utils/llmConfig';
|
|
10
14
|
import { getArgs } from '@/scripts/args';
|
|
11
15
|
import { GraphEvents } from '@/common';
|
|
@@ -22,38 +26,57 @@ async function testCodeExecution(): Promise<void> {
|
|
|
22
26
|
[GraphEvents.CHAT_MODEL_END]: new ModelEndHandler(),
|
|
23
27
|
[GraphEvents.CHAT_MODEL_STREAM]: new ChatModelStreamHandler(),
|
|
24
28
|
[GraphEvents.ON_RUN_STEP_COMPLETED]: {
|
|
25
|
-
handle: (
|
|
29
|
+
handle: (
|
|
30
|
+
event: GraphEvents.ON_RUN_STEP_COMPLETED,
|
|
31
|
+
data: t.StreamEventData
|
|
32
|
+
): void => {
|
|
26
33
|
console.log('====== ON_RUN_STEP_COMPLETED ======');
|
|
27
34
|
console.dir(data, { depth: null });
|
|
28
|
-
aggregateContent({
|
|
29
|
-
|
|
35
|
+
aggregateContent({
|
|
36
|
+
event,
|
|
37
|
+
data: data as unknown as { result: t.ToolEndEvent },
|
|
38
|
+
});
|
|
39
|
+
},
|
|
30
40
|
},
|
|
31
41
|
[GraphEvents.ON_RUN_STEP]: {
|
|
32
|
-
handle: (
|
|
42
|
+
handle: (
|
|
43
|
+
event: GraphEvents.ON_RUN_STEP,
|
|
44
|
+
data: t.StreamEventData
|
|
45
|
+
): void => {
|
|
33
46
|
console.log('====== ON_RUN_STEP ======');
|
|
34
47
|
console.dir(data, { depth: null });
|
|
35
48
|
aggregateContent({ event, data: data as t.RunStep });
|
|
36
|
-
}
|
|
49
|
+
},
|
|
37
50
|
},
|
|
38
51
|
[GraphEvents.ON_RUN_STEP_DELTA]: {
|
|
39
|
-
handle: (
|
|
52
|
+
handle: (
|
|
53
|
+
event: GraphEvents.ON_RUN_STEP_DELTA,
|
|
54
|
+
data: t.StreamEventData
|
|
55
|
+
): void => {
|
|
40
56
|
console.log('====== ON_RUN_STEP_DELTA ======');
|
|
41
57
|
console.dir(data, { depth: null });
|
|
42
58
|
aggregateContent({ event, data: data as t.RunStepDeltaEvent });
|
|
43
|
-
}
|
|
59
|
+
},
|
|
44
60
|
},
|
|
45
61
|
[GraphEvents.ON_MESSAGE_DELTA]: {
|
|
46
|
-
handle: (
|
|
62
|
+
handle: (
|
|
63
|
+
event: GraphEvents.ON_MESSAGE_DELTA,
|
|
64
|
+
data: t.StreamEventData
|
|
65
|
+
): void => {
|
|
47
66
|
console.log('====== ON_MESSAGE_DELTA ======');
|
|
48
67
|
console.dir(data, { depth: null });
|
|
49
68
|
aggregateContent({ event, data: data as t.MessageDeltaEvent });
|
|
50
|
-
}
|
|
69
|
+
},
|
|
51
70
|
},
|
|
52
71
|
[GraphEvents.TOOL_START]: {
|
|
53
|
-
handle: (
|
|
72
|
+
handle: (
|
|
73
|
+
_event: string,
|
|
74
|
+
data: t.StreamEventData,
|
|
75
|
+
metadata?: Record<string, unknown>
|
|
76
|
+
): void => {
|
|
54
77
|
console.log('====== TOOL_START ======');
|
|
55
78
|
console.dir(data, { depth: null });
|
|
56
|
-
}
|
|
79
|
+
},
|
|
57
80
|
},
|
|
58
81
|
};
|
|
59
82
|
|
|
@@ -65,14 +88,19 @@ async function testCodeExecution(): Promise<void> {
|
|
|
65
88
|
type: 'standard',
|
|
66
89
|
llmConfig,
|
|
67
90
|
tools: [createCodeExecutionTool()],
|
|
68
|
-
instructions:
|
|
91
|
+
instructions:
|
|
92
|
+
'You are a friendly AI assistant with coding capabilities. Always address the user by their name.',
|
|
69
93
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}. The current date is ${currentDate}.`,
|
|
70
94
|
},
|
|
71
95
|
returnContent: true,
|
|
72
96
|
customHandlers,
|
|
73
97
|
});
|
|
74
98
|
|
|
75
|
-
const config: Partial<RunnableConfig> & {
|
|
99
|
+
const config: Partial<RunnableConfig> & {
|
|
100
|
+
version: 'v1' | 'v2';
|
|
101
|
+
run_id?: string;
|
|
102
|
+
streamMode: string;
|
|
103
|
+
} = {
|
|
76
104
|
configurable: {
|
|
77
105
|
provider,
|
|
78
106
|
thread_id: 'conversation-num-1',
|
|
@@ -131,12 +159,15 @@ async function testCodeExecution(): Promise<void> {
|
|
|
131
159
|
|
|
132
160
|
const { handleLLMEnd, collected } = createMetadataAggregator();
|
|
133
161
|
const titleResult = await run.generateTitle({
|
|
162
|
+
provider,
|
|
134
163
|
inputText: userMessage2,
|
|
135
164
|
contentParts,
|
|
136
165
|
chainOptions: {
|
|
137
|
-
callbacks: [
|
|
138
|
-
|
|
139
|
-
|
|
166
|
+
callbacks: [
|
|
167
|
+
{
|
|
168
|
+
handleLLMEnd,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
140
171
|
},
|
|
141
172
|
});
|
|
142
173
|
console.log('Generated Title:', titleResult);
|
|
@@ -23,45 +23,74 @@ async function testCodeExecution(): Promise<void> {
|
|
|
23
23
|
[GraphEvents.CHAT_MODEL_END]: new ModelEndHandler(),
|
|
24
24
|
[GraphEvents.CHAT_MODEL_STREAM]: new ChatModelStreamHandler(),
|
|
25
25
|
[GraphEvents.ON_RUN_STEP_COMPLETED]: {
|
|
26
|
-
handle: (
|
|
26
|
+
handle: (
|
|
27
|
+
event: GraphEvents.ON_RUN_STEP_COMPLETED,
|
|
28
|
+
data: t.StreamEventData
|
|
29
|
+
): void => {
|
|
27
30
|
console.log('====== ON_RUN_STEP_COMPLETED ======');
|
|
28
31
|
console.dir(data, { depth: null });
|
|
29
|
-
aggregateContent({
|
|
30
|
-
|
|
32
|
+
aggregateContent({
|
|
33
|
+
event,
|
|
34
|
+
data: data as unknown as { result: t.ToolEndEvent },
|
|
35
|
+
});
|
|
36
|
+
},
|
|
31
37
|
},
|
|
32
38
|
[GraphEvents.ON_RUN_STEP]: {
|
|
33
|
-
handle: (
|
|
39
|
+
handle: (
|
|
40
|
+
event: GraphEvents.ON_RUN_STEP,
|
|
41
|
+
data: t.StreamEventData
|
|
42
|
+
): void => {
|
|
34
43
|
console.log('====== ON_RUN_STEP ======');
|
|
35
44
|
console.dir(data, { depth: null });
|
|
36
45
|
aggregateContent({ event, data: data as t.RunStep });
|
|
37
|
-
}
|
|
46
|
+
},
|
|
38
47
|
},
|
|
39
48
|
[GraphEvents.ON_RUN_STEP_DELTA]: {
|
|
40
|
-
handle: (
|
|
49
|
+
handle: (
|
|
50
|
+
event: GraphEvents.ON_RUN_STEP_DELTA,
|
|
51
|
+
data: t.StreamEventData
|
|
52
|
+
): void => {
|
|
41
53
|
console.log('====== ON_RUN_STEP_DELTA ======');
|
|
42
54
|
console.dir(data, { depth: null });
|
|
43
55
|
aggregateContent({ event, data: data as t.RunStepDeltaEvent });
|
|
44
|
-
}
|
|
56
|
+
},
|
|
45
57
|
},
|
|
46
58
|
[GraphEvents.ON_MESSAGE_DELTA]: {
|
|
47
|
-
handle: (
|
|
59
|
+
handle: (
|
|
60
|
+
event: GraphEvents.ON_MESSAGE_DELTA,
|
|
61
|
+
data: t.StreamEventData
|
|
62
|
+
): void => {
|
|
48
63
|
console.log('====== ON_MESSAGE_DELTA ======');
|
|
49
64
|
console.dir(data, { depth: null });
|
|
50
65
|
aggregateContent({ event, data: data as t.MessageDeltaEvent });
|
|
51
|
-
}
|
|
66
|
+
},
|
|
52
67
|
},
|
|
53
68
|
[GraphEvents.TOOL_START]: {
|
|
54
|
-
handle: (
|
|
69
|
+
handle: (
|
|
70
|
+
_event: string,
|
|
71
|
+
data: t.StreamEventData,
|
|
72
|
+
metadata?: Record<string, unknown>
|
|
73
|
+
): void => {
|
|
55
74
|
console.log('====== TOOL_START ======');
|
|
56
75
|
console.dir(data, { depth: null });
|
|
57
|
-
}
|
|
76
|
+
},
|
|
58
77
|
},
|
|
59
78
|
};
|
|
60
79
|
|
|
61
80
|
const llmConfig = getLLMConfig(provider);
|
|
62
|
-
const instructions =
|
|
81
|
+
const instructions =
|
|
82
|
+
'You are a friendly AI assistant with coding capabilities. Always address the user by their name.';
|
|
63
83
|
const additional_instructions = `The user's name is ${userName} and they are located in ${location}.`;
|
|
64
84
|
|
|
85
|
+
// const userMessage1 = `how much memory is this (its in bytes) in MB? 31192000`;
|
|
86
|
+
// const userMessage1 = `can you show me a good use case for rscript by running some code`;
|
|
87
|
+
const userMessage1 = `Run hello world in french and in english, using python. please run 2 parallel code executions.`;
|
|
88
|
+
const humanMessage = new HumanMessage(userMessage1);
|
|
89
|
+
const tokenCounter = await createTokenCounter();
|
|
90
|
+
const indexTokenCountMap = {
|
|
91
|
+
0: tokenCounter(humanMessage),
|
|
92
|
+
};
|
|
93
|
+
|
|
65
94
|
const runConfig: t.RunConfig = {
|
|
66
95
|
runId: 'message-num-1',
|
|
67
96
|
graphConfig: {
|
|
@@ -70,9 +99,12 @@ async function testCodeExecution(): Promise<void> {
|
|
|
70
99
|
tools: [new TavilySearchResults(), createCodeExecutionTool()],
|
|
71
100
|
instructions,
|
|
72
101
|
additional_instructions,
|
|
102
|
+
maxContextTokens: 8000,
|
|
73
103
|
},
|
|
74
104
|
returnContent: true,
|
|
75
105
|
customHandlers,
|
|
106
|
+
indexTokenCountMap,
|
|
107
|
+
tokenCounter,
|
|
76
108
|
};
|
|
77
109
|
const run = await Run.create<t.IState>(runConfig);
|
|
78
110
|
|
|
@@ -87,25 +119,12 @@ async function testCodeExecution(): Promise<void> {
|
|
|
87
119
|
|
|
88
120
|
console.log('Test 1: Simple Code Execution');
|
|
89
121
|
|
|
90
|
-
// const userMessage1 = `how much memory is this (its in bytes) in MB? 31192000`;
|
|
91
|
-
// const userMessage1 = `can you show me a good use case for rscript by running some code`;
|
|
92
|
-
const userMessage1 = `Run hello world in french and in english, using python. please run 2 parallel code executions.`;
|
|
93
|
-
const humanMessage = new HumanMessage(userMessage1);
|
|
94
|
-
const tokenCounter = await createTokenCounter();
|
|
95
|
-
const indexTokenCountMap = {
|
|
96
|
-
0: tokenCounter(humanMessage),
|
|
97
|
-
};
|
|
98
|
-
|
|
99
122
|
conversationHistory.push(humanMessage);
|
|
100
123
|
|
|
101
124
|
let inputs = {
|
|
102
125
|
messages: conversationHistory,
|
|
103
126
|
};
|
|
104
|
-
const finalContentParts1 = await run.processStream(inputs, config
|
|
105
|
-
maxContextTokens: 8000,
|
|
106
|
-
indexTokenCountMap,
|
|
107
|
-
tokenCounter,
|
|
108
|
-
});
|
|
127
|
+
const finalContentParts1 = await run.processStream(inputs, config);
|
|
109
128
|
const finalMessages1 = run.getRunMessages();
|
|
110
129
|
if (finalMessages1) {
|
|
111
130
|
conversationHistory.push(...finalMessages1);
|
|
@@ -126,4 +145,4 @@ testCodeExecution().catch((err) => {
|
|
|
126
145
|
console.log('Conversation history:');
|
|
127
146
|
console.dir(conversationHistory, { depth: null });
|
|
128
147
|
process.exit(1);
|
|
129
|
-
});
|
|
148
|
+
});
|