|
9 | 9 | },
|
10 | 10 | {
|
11 | 11 | "cell_type": "code",
|
12 |
| - "execution_count": 1, |
| 12 | + "execution_count": 4, |
13 | 13 | "metadata": {},
|
14 | 14 | "outputs": [],
|
15 | 15 | "source": [
|
16 | 16 | "String userHomeDir = System.getProperty(\"user.home\");\n",
|
17 | 17 | "String localRespoUrl = \"file://\" + userHomeDir + \"/.m2/repository/\";\n",
|
18 | 18 | "String langchain4jVersion = \"0.36.2\";\n",
|
19 |
| - "String langgraph4jVersion = \"1.2-SNAPSHOT\";" |
| 19 | + "String langgraph4jVersion = \"1.3-SNAPSHOT\";" |
20 | 20 | ]
|
21 | 21 | },
|
22 | 22 | {
|
23 | 23 | "cell_type": "code",
|
24 |
| - "execution_count": 2, |
| 24 | + "execution_count": null, |
25 | 25 | "metadata": {},
|
26 |
| - "outputs": [ |
27 |
| - { |
28 |
| - "name": "stdout", |
29 |
| - "output_type": "stream", |
30 |
| - "text": [ |
31 |
| - "\u001b[0mRepository \u001b[1m\u001b[32mlocal\u001b[0m url: \u001b[1m\u001b[32mfile:///Users/bsorrentino/.m2/repository/\u001b[0m added.\n", |
32 |
| - "\u001b[0mRepositories count: 4\n", |
33 |
| - "\u001b[0mname: \u001b[1m\u001b[32mcentral \u001b[0murl: \u001b[1m\u001b[32mhttps://repo.maven.apache.org/maven2/ \u001b[0mrelease:\u001b[32mtrue \u001b[0mupdate:\u001b[32mnever \u001b[0msnapshot:\u001b[32mfalse \u001b[0mupdate:\u001b[32mnever \n", |
34 |
| - "\u001b[0m\u001b[0mname: \u001b[1m\u001b[32mjboss \u001b[0murl: \u001b[1m\u001b[32mhttps://repository.jboss.org/nexus/content/repositories/releases/ \u001b[0mrelease:\u001b[32mtrue \u001b[0mupdate:\u001b[32mnever \u001b[0msnapshot:\u001b[32mfalse \u001b[0mupdate:\u001b[32mnever \n", |
35 |
| - "\u001b[0m\u001b[0mname: \u001b[1m\u001b[32matlassian \u001b[0murl: \u001b[1m\u001b[32mhttps://packages.atlassian.com/maven/public \u001b[0mrelease:\u001b[32mtrue \u001b[0mupdate:\u001b[32mnever \u001b[0msnapshot:\u001b[32mfalse \u001b[0mupdate:\u001b[32mnever \n", |
36 |
| - "\u001b[0m\u001b[0mname: \u001b[1m\u001b[32mlocal \u001b[0murl: \u001b[1m\u001b[32mfile:///Users/bsorrentino/.m2/repository/ \u001b[0mrelease:\u001b[32mtrue \u001b[0mupdate:\u001b[32mnever \u001b[0msnapshot:\u001b[32mtrue \u001b[0mupdate:\u001b[32malways \n", |
37 |
| - "\u001b[0m" |
38 |
| - ] |
39 |
| - } |
40 |
| - ], |
| 26 | + "outputs": [], |
41 | 27 | "source": [
|
42 | 28 | "%dependency /add-repo local \\{localRespoUrl} release|never snapshot|always\n",
|
43 | 29 | "%dependency /list-repos"
|
|
52 | 38 | },
|
53 | 39 | {
|
54 | 40 | "cell_type": "code",
|
55 |
| - "execution_count": 3, |
| 41 | + "execution_count": 5, |
56 | 42 | "metadata": {},
|
57 | 43 | "outputs": [],
|
58 | 44 | "source": [
|
|
62 | 48 | },
|
63 | 49 | {
|
64 | 50 | "cell_type": "code",
|
65 |
| - "execution_count": 4, |
| 51 | + "execution_count": null, |
66 | 52 | "metadata": {},
|
67 |
| - "outputs": [ |
68 |
| - { |
69 |
| - "name": "stdout", |
70 |
| - "output_type": "stream", |
71 |
| - "text": [ |
72 |
| - "Adding dependency \u001b[0m\u001b[1m\u001b[32morg.slf4j:slf4j-jdk14:2.0.9\n", |
73 |
| - "\u001b[0mAdding dependency \u001b[0m\u001b[1m\u001b[32morg.bsc.langgraph4j:langgraph4j-core:1.2-SNAPSHOT\n", |
74 |
| - "\u001b[0mAdding dependency \u001b[0m\u001b[1m\u001b[32morg.bsc.langgraph4j:langgraph4j-langchain4j:1.2-SNAPSHOT\n", |
75 |
| - "\u001b[0mAdding dependency \u001b[0m\u001b[1m\u001b[32mdev.langchain4j:langchain4j:0.36.2\n", |
76 |
| - "\u001b[0mAdding dependency \u001b[0m\u001b[1m\u001b[32mdev.langchain4j:langchain4j-open-ai:0.36.2\n", |
77 |
| - "\u001b[0mSolving dependencies\n", |
78 |
| - "Resolved artifacts count: 26\n", |
79 |
| - "Add to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/slf4j/slf4j-jdk14/2.0.9/slf4j-jdk14-2.0.9.jar\u001b[0m\n", |
80 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar\u001b[0m\n", |
81 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/bsc/langgraph4j/langgraph4j-core/1.2-SNAPSHOT/langgraph4j-core-1.2-SNAPSHOT.jar\u001b[0m\n", |
82 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/bsc/async/async-generator/3.0-SNAPSHOT/async-generator-3.0-SNAPSHOT.jar\u001b[0m\n", |
83 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/bsc/langgraph4j/langgraph4j-langchain4j/1.2-SNAPSHOT/langgraph4j-langchain4j-1.2-SNAPSHOT.jar\u001b[0m\n", |
84 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/dev/langchain4j/langchain4j/0.36.2/langchain4j-0.36.2.jar\u001b[0m\n", |
85 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/dev/langchain4j/langchain4j-core/0.36.2/langchain4j-core-0.36.2.jar\u001b[0m\n", |
86 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar\u001b[0m\n", |
87 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/apache/opennlp/opennlp-tools/1.9.4/opennlp-tools-1.9.4.jar\u001b[0m\n", |
88 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/dev/langchain4j/langchain4j-open-ai/0.36.2/langchain4j-open-ai-0.36.2.jar\u001b[0m\n", |
89 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/dev/ai4j/openai4j/0.23.0/openai4j-0.23.0.jar\u001b[0m\n", |
90 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/squareup/retrofit2/retrofit/2.9.0/retrofit-2.9.0.jar\u001b[0m\n", |
91 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/squareup/retrofit2/converter-jackson/2.9.0/converter-jackson-2.9.0.jar\u001b[0m\n", |
92 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/fasterxml/jackson/core/jackson-databind/2.17.2/jackson-databind-2.17.2.jar\u001b[0m\n", |
93 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/fasterxml/jackson/core/jackson-annotations/2.17.2/jackson-annotations-2.17.2.jar\u001b[0m\n", |
94 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/fasterxml/jackson/core/jackson-core/2.17.2/jackson-core-2.17.2.jar\u001b[0m\n", |
95 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/squareup/okhttp3/okhttp/4.12.0/okhttp-4.12.0.jar\u001b[0m\n", |
96 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/squareup/okio/okio/3.6.0/okio-3.6.0.jar\u001b[0m\n", |
97 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/squareup/okio/okio-jvm/3.6.0/okio-jvm-3.6.0.jar\u001b[0m\n", |
98 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar\u001b[0m\n", |
99 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/squareup/okhttp3/okhttp-sse/4.12.0/okhttp-sse-4.12.0.jar\u001b[0m\n", |
100 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.9.25/kotlin-stdlib-jdk8-1.9.25.jar\u001b[0m\n", |
101 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/jetbrains/kotlin/kotlin-stdlib/1.9.25/kotlin-stdlib-1.9.25.jar\u001b[0m\n", |
102 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/jetbrains/annotations/13.0/annotations-13.0.jar\u001b[0m\n", |
103 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.9.25/kotlin-stdlib-jdk7-1.9.25.jar\u001b[0m\n", |
104 |
| - "\u001b[0mAdd to classpath: \u001b[0m\u001b[32m/Users/bsorrentino/Library/Jupyter/kernels/rapaio-jupyter-kernel/mima_cache/com/knuddels/jtokkit/1.1.0/jtokkit-1.1.0.jar\u001b[0m\n", |
105 |
| - "\u001b[0m" |
106 |
| - ] |
107 |
| - } |
108 |
| - ], |
| 53 | + "outputs": [], |
109 | 54 | "source": [
|
110 | 55 | "%dependency /add org.slf4j:slf4j-jdk14:2.0.9\n",
|
111 | 56 | "%dependency /add org.bsc.langgraph4j:langgraph4j-core:\\{langgraph4jVersion}\n",
|
|
125 | 70 | },
|
126 | 71 | {
|
127 | 72 | "cell_type": "code",
|
128 |
| - "execution_count": 5, |
| 73 | + "execution_count": 12, |
129 | 74 | "metadata": {},
|
130 | 75 | "outputs": [],
|
131 | 76 | "source": [
|
|
147 | 92 | },
|
148 | 93 | {
|
149 | 94 | "cell_type": "code",
|
150 |
| - "execution_count": 6, |
| 95 | + "execution_count": 13, |
151 | 96 | "metadata": {},
|
152 | 97 | "outputs": [
|
153 | 98 | {
|
|
220 | 165 | "## Use LLMStreamGenerator in Agent"
|
221 | 166 | ]
|
222 | 167 | },
|
223 |
| - { |
224 |
| - "cell_type": "markdown", |
225 |
| - "metadata": {}, |
226 |
| - "source": [ |
227 |
| - "### Define State" |
228 |
| - ] |
229 |
| - }, |
230 |
| - { |
231 |
| - "cell_type": "code", |
232 |
| - "execution_count": 7, |
233 |
| - "metadata": {}, |
234 |
| - "outputs": [], |
235 |
| - "source": [ |
236 |
| - "import org.bsc.langgraph4j.state.AgentState;\n", |
237 |
| - "import org.bsc.langgraph4j.state.Channel;\n", |
238 |
| - "import org.bsc.langgraph4j.state.AppenderChannel;\n", |
239 |
| - "import dev.langchain4j.data.message.ChatMessage;\n", |
240 |
| - "import dev.langchain4j.data.message.UserMessage;\n", |
241 |
| - "\n", |
242 |
| - "public class MessageState extends AgentState {\n", |
243 |
| - "\n", |
244 |
| - " static Map<String, Channel<?>> SCHEMA = Map.of(\n", |
245 |
| - " \"messages\", AppenderChannel.<ChatMessage>of(ArrayList::new)\n", |
246 |
| - " );\n", |
247 |
| - "\n", |
248 |
| - " public MessageState(Map<String, Object> initData) {\n", |
249 |
| - " super( initData );\n", |
250 |
| - " }\n", |
251 |
| - "\n", |
252 |
| - " List<ChatMessage> messages() {\n", |
253 |
| - " return this.<List<ChatMessage>>value( \"messages\" )\n", |
254 |
| - " .orElseThrow( () -> new RuntimeException( \"messages not found\" ) );\n", |
255 |
| - " }\n", |
256 |
| - "\n", |
257 |
| - " // utility method to quick access to last message\n", |
258 |
| - " Optional<ChatMessage> lastMessage() {\n", |
259 |
| - " List<ChatMessage> messages = messages();\n", |
260 |
| - " return ( messages.isEmpty() ) ? \n", |
261 |
| - " Optional.empty() :\n", |
262 |
| - " Optional.of(messages.get( messages.size() - 1 ));\n", |
263 |
| - " }\n", |
264 |
| - "}" |
265 |
| - ] |
266 |
| - }, |
267 | 168 | {
|
268 | 169 | "cell_type": "markdown",
|
269 | 170 | "metadata": {},
|
|
273 | 174 | },
|
274 | 175 | {
|
275 | 176 | "cell_type": "code",
|
276 |
| - "execution_count": 8, |
| 177 | + "execution_count": 14, |
277 | 178 | "metadata": {},
|
278 | 179 | "outputs": [
|
279 | 180 | {
|
|
286 | 187 | "dev.langchain4j.data.message.ChatMessage"
|
287 | 188 | ]
|
288 | 189 | },
|
289 |
| - "execution_count": 8, |
| 190 | + "execution_count": 14, |
290 | 191 | "metadata": {},
|
291 | 192 | "output_type": "execute_result"
|
292 | 193 | }
|
293 | 194 | ],
|
294 | 195 | "source": [
|
| 196 | + "import dev.langchain4j.data.message.ChatMessage;\n", |
295 | 197 | "import dev.langchain4j.data.message.AiMessage;\n",
|
296 | 198 | "import dev.langchain4j.data.message.SystemMessage;\n",
|
297 | 199 | "import dev.langchain4j.data.message.UserMessage;\n",
|
|
301 | 203 | "import org.bsc.langgraph4j.langchain4j.serializer.std.ChatMesssageSerializer;\n",
|
302 | 204 | "import org.bsc.langgraph4j.langchain4j.serializer.std.ToolExecutionRequestSerializer;\n",
|
303 | 205 | "import org.bsc.langgraph4j.state.AgentStateFactory;\n",
|
| 206 | + "import org.bsc.langgraph4j.prebuilt.MessagesState;\n", |
304 | 207 | "\n",
|
305 |
| - "var stateSerializer = new ObjectStreamStateSerializer<MessageState>( MessageState::new );\n", |
| 208 | + "var stateSerializer = new ObjectStreamStateSerializer<MessagesState<ChatMessage>>( MessagesState::new );\n", |
306 | 209 | "stateSerializer.mapper()\n",
|
307 | 210 | " // Setup custom serializer for Langchain4j ToolExecutionRequest\n",
|
308 | 211 | " .register(ToolExecutionRequest.class, new ToolExecutionRequestSerializer() )\n",
|
|
328 | 231 | },
|
329 | 232 | {
|
330 | 233 | "cell_type": "code",
|
331 |
| - "execution_count": 9, |
| 234 | + "execution_count": 15, |
332 | 235 | "metadata": {},
|
333 | 236 | "outputs": [],
|
334 | 237 | "source": [
|
|
352 | 255 | },
|
353 | 256 | {
|
354 | 257 | "cell_type": "code",
|
355 |
| - "execution_count": 10, |
| 258 | + "execution_count": 17, |
356 | 259 | "metadata": {},
|
357 | 260 | "outputs": [],
|
358 | 261 | "source": [
|
359 | 262 | "import static org.bsc.langgraph4j.StateGraph.START;\n",
|
360 | 263 | "import static org.bsc.langgraph4j.StateGraph.END;\n",
|
361 |
| - "import org.bsc.langgraph4j.StateGraph;\n", |
| 264 | + "import org.bsc.langgraph4j.prebuilt.MessagesStateGraph;\n", |
362 | 265 | "import org.bsc.langgraph4j.action.EdgeAction;\n",
|
363 | 266 | "import static org.bsc.langgraph4j.action.AsyncEdgeAction.edge_async;\n",
|
364 | 267 | "import org.bsc.langgraph4j.action.NodeAction;\n",
|
|
383 | 286 | " .specification( new SearchTool() ) \n",
|
384 | 287 | " .build(); \n",
|
385 | 288 | "\n",
|
386 |
| - "NodeAction<MessageState> callModel = state -> {\n", |
| 289 | + "NodeAction<MessagesState<ChatMessage>> callModel = state -> {\n", |
387 | 290 | " log.info(\"CallModel:\\n{}\", state.messages());\n",
|
388 | 291 | "\n",
|
389 |
| - " var generator = LLMStreamingGenerator.<AiMessage, MessageState>builder()\n", |
| 292 | + " var generator = LLMStreamingGenerator.<AiMessage, MessagesState<ChatMessage>>builder()\n", |
390 | 293 | " .mapResult(response -> {\n",
|
391 | 294 | " log.info(\"MapResult: {}\", response);\n",
|
392 | 295 | " return Map.of(\"messages\", response.content());\n",
|
|
404 | 307 | "};\n",
|
405 | 308 | " \n",
|
406 | 309 | "// Route Message\n",
|
407 |
| - "EdgeAction<MessageState> routeMessage = state -> {\n", |
| 310 | + "EdgeAction<MessagesState<ChatMessage>> routeMessage = state -> {\n", |
408 | 311 | " log.info(\"routeMessage:\\n{}\", state.messages());\n",
|
409 | 312 | "\n",
|
410 | 313 | " var lastMessage = state.lastMessage()\n",
|
|
420 | 323 | "};\n",
|
421 | 324 | " \n",
|
422 | 325 | "// Invoke Tool\n",
|
423 |
| - "NodeAction<MessageState> invokeTool = state -> {\n", |
| 326 | + "NodeAction<MessagesState<ChatMessage>> invokeTool = state -> {\n", |
424 | 327 | " log.info(\"invokeTool:\\n{}\", state.messages());\n",
|
425 | 328 | "\n",
|
426 | 329 | " var lastMessage = state.lastMessage()\n",
|
|
440 | 343 | "};\n",
|
441 | 344 | " \n",
|
442 | 345 | "// Define Graph\n",
|
443 |
| - "var workflow = new StateGraph<MessageState>(MessageState.SCHEMA, stateSerializer)\n", |
| 346 | + "var workflow = new MessagesStateGraph<ChatMessage>(stateSerializer)\n", |
444 | 347 | " .addNode(\"agent\", node_async(callModel))\n",
|
445 | 348 | " .addNode(\"tools\", node_async(invokeTool))\n",
|
446 | 349 | " .addEdge(START, \"agent\")\n",
|
|
453 | 356 | },
|
454 | 357 | {
|
455 | 358 | "cell_type": "code",
|
456 |
| - "execution_count": 11, |
| 359 | + "execution_count": 18, |
457 | 360 | "metadata": {},
|
458 | 361 | "outputs": [
|
459 | 362 | {
|
|
463 | 366 | "START \n",
|
464 | 367 | "CallModel:\n",
|
465 | 368 | "[UserMessage { name = null contents = [TextContent { text = \"what is the whether today?\" }] }] \n",
|
466 |
| - "MapResult: Response { content = AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_YszBAtYhA4nlonJG9BFogPkC\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }, tokenUsage = TokenUsage { inputTokenCount = 71, outputTokenCount = 15, totalTokenCount = 86 }, finishReason = TOOL_EXECUTION, metadata = {} } \n", |
| 369 | + "MapResult: Response { content = AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }, tokenUsage = TokenUsage { inputTokenCount = 71, outputTokenCount = 16, totalTokenCount = 87 }, finishReason = TOOL_EXECUTION, metadata = {} } \n", |
467 | 370 | "routeMessage:\n",
|
468 |
| - "[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_YszBAtYhA4nlonJG9BFogPkC\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }] \n", |
| 371 | + "[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }] \n", |
469 | 372 | "NodeOutput{node=__START__, state={messages=[UserMessage { name = null contents = [TextContent { text = \"what is the whether today?\" }] }]}} \n",
|
470 | 373 | "invokeTool:\n",
|
471 |
| - "[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_YszBAtYhA4nlonJG9BFogPkC\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }] \n", |
| 374 | + "[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }] \n", |
472 | 375 | "execute: execQuery \n",
|
473 |
| - "NodeOutput{node=agent, state={messages=[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_YszBAtYhA4nlonJG9BFogPkC\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }]}} \n", |
| 376 | + "NodeOutput{node=agent, state={messages=[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }]}} \n", |
474 | 377 | "CallModel:\n",
|
475 |
| - "[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_YszBAtYhA4nlonJG9BFogPkC\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }, ToolExecutionResultMessage { id = \"call_YszBAtYhA4nlonJG9BFogPkC\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }] \n", |
476 |
| - "NodeOutput{node=tools, state={messages=[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_YszBAtYhA4nlonJG9BFogPkC\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }, ToolExecutionResultMessage { id = \"call_YszBAtYhA4nlonJG9BFogPkC\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}} \n", |
| 378 | + "[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }, ToolExecutionResultMessage { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }] \n", |
| 379 | + "NodeOutput{node=tools, state={messages=[AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\", name = \"execQuery\", arguments = \"{\"query\":\"current weather\"}\" }] }, ToolExecutionResultMessage { id = \"call_fN0FFpNYHHJ8gSrr6IaVMRDu\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}} \n", |
477 | 380 | "StreamingOutput{node=agent, chunk= } \n",
|
478 | 381 | "StreamingOutput{node=agent, chunk=The } \n",
|
479 | 382 | "StreamingOutput{node=agent, chunk= current } \n",
|
|
505 | 408 | "StreamingOutput{node=agent, chunk= feel } \n",
|
506 | 409 | "StreamingOutput{node=agent, chunk= free } \n",
|
507 | 410 | "StreamingOutput{node=agent, chunk= to } \n",
|
508 |
| - "MapResult: Response { content = AiMessage { text = \"The current weather is cold, with a low of 13 degrees. If you need more specific information or details about a particular location, feel free to ask!\" toolExecutionRequests = null }, tokenUsage = TokenUsage { inputTokenCount = 93, outputTokenCount = 33, totalTokenCount = 126 }, finishReason = STOP, metadata = {} } \n", |
509 | 411 | "StreamingOutput{node=agent, chunk= ask } \n",
|
| 412 | + "MapResult: Response { content = AiMessage { text = \"The current weather is cold, with a low of 13 degrees. If you need more specific information or details about a particular location, feel free to ask!\" toolExecutionRequests = null }, tokenUsage = TokenUsage { inputTokenCount = 93, outputTokenCount = 34, totalTokenCount = 127 }, finishReason = STOP, metadata = {} } \n", |
510 | 413 | "routeMessage:\n",
|
511 | 414 | "[AiMessage { text = \"The current weather is cold, with a low of 13 degrees. If you need more specific information or details about a particular location, feel free to ask!\" toolExecutionRequests = null }] \n",
|
512 | 415 | "StreamingOutput{node=agent, chunk=! } \n",
|
|
0 commit comments