diff --git a/how-tos/logging.ipynb b/how-tos/logging.ipynb index 6088831..c79efe8 100644 --- a/how-tos/logging.ipynb +++ b/how-tos/logging.ipynb @@ -2,13 +2,13 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "String userHomeDir = System.getProperty(\"user.home\");\n", "String localRespoUrl = \"file://\" + userHomeDir + \"/.m2/repository/\";\n", - "String langchain4jVersion = \"0.33.0\"" + "String slf4jVersion = \"2.0.9\"" ] }, { @@ -28,28 +28,51 @@ "outputs": [], "source": [ "%dependency /add org.bsc.langgraph4j:langgraph4j-core-jdk8:1.0-SNAPSHOT\n", - "%dependency /add dev.langchain4j:langchain4j:\\{langchain4jVersion}\n", - "%dependency /add dev.langchain4j:langchain4j-open-ai:\\{langchain4jVersion}\n", + "%dependency /add org.slf4j:slf4j-jdk14:\\{slf4jVersion}\n", "\n", "%dependency /resolve" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Initialize Logger " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "var lm = java.util.logging.LogManager.getLogManager();\n", + "lm.checkAccess(); \n", + "try( var file = new java.io.FileInputStream(\"./logging.properties\")) {\n", + " lm.readConfiguration( file );\n", + " java.util.logging.Logger.getLogger(\"\").addHandler(new java.util.logging.ConsoleHandler());\n", + "}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test Logger" + ] + }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "import java.io.FileInputStream;\n", - "import java.io.IOException;\n", - "import java.util.logging.LogManager;\n", - "import java.util.logging.Logger;\n", "\n", - "try( FileInputStream configFile = new FileInputStream(\"./logging.properties\") ) {\n", - " var lm = LogManager.getLogManager();\n", - " lm.checkAccess();\n", - " lm.readConfiguration(configFile);\n", - "}\n" + "var log = org.slf4j.LoggerFactory.getLogger(org.bsc.langgraph4j.CompiledGraph.class);\n", + "\n", + "\n", + "log.trace( \"this is a trace message {}\", \"TRACE2\");\n", + "log.info( \"this is a info message {}\", \"INFO1\");\n" ] } ], diff --git a/how-tos/logging.properties b/how-tos/logging.properties index 69ca839..37fb187 100644 --- a/how-tos/logging.properties +++ b/how-tos/logging.properties @@ -1,11 +1,12 @@ # Set the default logging level to INFO -.level = INFO - -# Set the logging level to FINER for the package a.b.c -org.bsc.langgraph4j.level = FINE +.level = SEVERE # Specify the handlers that will handle the log messages -handlers= java.util.logging.FileHandler +handlers = java.util.logging.ConsoleHandler + +# Configure the ConsoleHandler +java.util.logging.ConsoleHandler.level = ALL +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Configure the FileHandler java.util.logging.FileHandler.pattern = log.txt @@ -19,3 +20,5 @@ java.util.logging.FileHandler.level = ALL # Configure the SimpleFormatter to include date, source, logger name, level, and message java.util.logging.SimpleFormatter.format = %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n +# Set the logging level to FINER for the package a.b.c +org.bsc.langgraph4j.level = INFO diff --git a/how-tos/persistence.ipynb b/how-tos/persistence.ipynb index f6ecf9b..fc05a88 100644 --- a/how-tos/persistence.ipynb +++ b/how-tos/persistence.ipynb @@ -2,13 +2,13 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "String userHomeDir = System.getProperty(\"user.home\");\n", "String localRespoUrl = \"file://\" + userHomeDir + \"/.m2/repository/\";\n", - "String langchain4jVersion = \"0.33.0\"" + "String langchain4jVersion = \"0.34.0\"" ] }, { @@ -34,6 +34,26 @@ "%dependency /resolve" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Initialize Logger" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "var lm = java.util.logging.LogManager.getLogManager();\n", + "lm.checkAccess(); \n", + "try( var file = new java.io.FileInputStream(\"./logging.properties\")) {\n", + " lm.readConfiguration( file );\n", + "}" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -90,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -141,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -222,7 +242,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -267,7 +287,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -300,7 +320,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -316,7 +336,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_R0yDPSkxhjiBoqNLyyXOICLU\", name = \"execQuery\", arguments = \"{\"query\":\"London weather forecast for tomorrow\"}\" }] }\n" + "AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_zjycvQgyY3wAzI9nJXo2aHrQ\", name = \"execQuery\", arguments = \"{\"query\":\"London weather forecast for tomorrow\"}\" }] }\n" ] } ], @@ -350,7 +370,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -423,7 +443,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -453,7 +473,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -462,7 +482,7 @@ "text": [ "__START__\n", "agent\n", - "{messages=[AiMessage { text = \"Remember my name?\" toolExecutionRequests = null }, AiMessage { text = \"I'm sorry, but I don't have the ability to remember personal details or previous interactions. How can I assist you today?\" toolExecutionRequests = null }]}\n", + "{messages=[AiMessage { text = \"Remember my name?\" toolExecutionRequests = null }, AiMessage { text = \"I don't have the ability to remember personal information or previous interactions. Each session is independent, and I don't retain any data from one interaction to the next. How can I assist you today?\" toolExecutionRequests = null }]}\n", "__END__\n" ] } @@ -496,7 +516,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -515,7 +535,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -550,7 +570,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -559,7 +579,7 @@ "text": [ "__START__\n", "agent\n", - "AiMessage { text = \"Of course, Bartolo! How can I help you today?\" toolExecutionRequests = null }\n", + "AiMessage { text = \"Of course, Bartolo! How can I assist you today?\" toolExecutionRequests = null }\n", "__END__\n" ] } @@ -591,7 +611,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -602,7 +622,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 17, "metadata": {}, "outputs": [ { diff --git a/how-tos/time-travel.ipynb b/how-tos/time-travel.ipynb index bf67098..adad842 100644 --- a/how-tos/time-travel.ipynb +++ b/how-tos/time-travel.ipynb @@ -8,7 +8,7 @@ "source": [ "String userHomeDir = System.getProperty(\"user.home\");\n", "String localRespoUrl = \"file://\" + userHomeDir + \"/.m2/repository/\";\n", - "String langchain4jVersion = \"0.33.0\"" + "String langchain4jVersion = \"0.34.0\"" ] }, { @@ -27,6 +27,7 @@ "metadata": {}, "outputs": [], "source": [ + "%dependency /add org.slf4j:slf4j-jdk14:2.0.9\n", "%dependency /add org.bsc.langgraph4j:langgraph4j-core-jdk8:1.0-SNAPSHOT\n", "%dependency /add dev.langchain4j:langchain4j:\\{langchain4jVersion}\n", "%dependency /add dev.langchain4j:langchain4j-open-ai:\\{langchain4jVersion}\n", @@ -34,6 +35,26 @@ "%dependency /resolve" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Initialize logger" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "var lm = java.util.logging.LogManager.getLogManager();\n", + "lm.checkAccess(); \n", + "try( var file = new java.io.FileInputStream(\"./logging.properties\")) {\n", + " lm.readConfiguration( file );\n", + "}" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -315,17 +336,7 @@ "cell_type": "code", "execution_count": 8, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "SLF4J: No SLF4J providers were found.\n", - "SLF4J: Defaulting to no-operation (NOP) logger implementation\n", - "SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.\n" - ] - } - ], + "outputs": [], "source": [ "import dev.langchain4j.model.openai.OpenAiChatModel;\n", "import dev.langchain4j.agent.tool.ToolSpecification;\n", @@ -357,7 +368,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_3YrelSH5At2zVambJLLf8gYo\", name = \"execQuery\", arguments = \"{\"query\":\"London weather forecast for tomorrow\"}\" }] }\n" + "AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_P6vApV5Ge47Ky6AUhF5AGJNA\", name = \"execQuery\", arguments = \"{\"query\":\"London weather forecast for tomorrow\"}\" }] }\n" ] }, { @@ -547,7 +558,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"Hi I'm Bartolo.\" }] }, AiMessage { text = \"Hello Bartolo! How can I assist you today?\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-num-1, checkPointId=93c2b047-7927-4062-89e0-4498f63813f6, nextNode=__END__))\n" + "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"Hi I'm Bartolo.\" }] }, AiMessage { text = \"Hello Bartolo! How can I assist you today?\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-num-1, checkPointId=c377c552-ba95-4bfa-90ab-9f8a224d4ba6, nextNode=__END__))\n" ] } ], @@ -641,7 +652,7 @@ "__START__\n", "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }]}\n", "agent\n", - "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }]}\n" + "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }]}\n" ] } ], @@ -719,11 +730,11 @@ "output_type": "stream", "text": [ "tools\n", - "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}\n", + "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}\n", "agent\n", - "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n", + "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n", "__END__\n", - "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n" + "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n" ] } ], @@ -753,26 +764,22 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=5bb993e3-8703-48c9-8284-1ee801c265b7, nextNode=__END__))\n", - "--\n", - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=11fc5618-c5b2-4b15-843c-8a51267c76a1, nextNode=agent))\n", - "--\n", - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=ab776d0f-a051-424c-9a70-6017f3bfdbf8, nextNode=__END__))\n", + "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=d9a42a90-e9fc-43ce-8925-49749193fca3, nextNode=__END__))\n", "--\n", - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=d6909dae-6f94-4afe-a8b5-7b39da95cc22, nextNode=agent))\n", + "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=bf9512ad-5c37-437d-a4a1-8fb879761b08, nextNode=agent))\n", "--\n", - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=0bb4e2ce-67fe-4585-94c7-035602f51f16, nextNode=tools))\n", + "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=3b7c57ec-6ce3-4850-927f-b3bede2e6660, nextNode=tools))\n", "--\n", - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=0167fa6f-e3b1-4b9e-aeac-b8ff15f191ba, nextNode=tools))\n", + "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=6a95ba55-6492-45bd-b5da-ab967f63bf15, nextNode=tools))\n", "--\n", - "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=3a4cc3c3-e863-4799-b33c-8ca295000552, nextNode=agent))\n", + "StateSnapshot(state={messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }]}, config=RunnableConfig(threadId=conversation-2, checkPointId=bf993028-c16e-449d-9cc3-5b9989d71c09, nextNode=agent))\n", "--\n" ] } @@ -805,7 +812,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -813,9 +820,9 @@ "output_type": "stream", "text": [ "agent\n", - "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n", + "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n", "__END__\n", - "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_M60jubFO7QzVUGZsutRsvdjw\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_M60jubFO7QzVUGZsutRsvdjw\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n" + "{messages=[UserMessage { name = null contents = [TextContent { text = \"What's the weather like in SF currently?\" }] }, AiMessage { text = null toolExecutionRequests = [ToolExecutionRequest { id = \"call_sROMglBwxVnluIZnHcH5li9D\", name = \"execQuery\", arguments = \"{\"query\":\"current weather in San Francisco\"}\" }] }, ToolExecutionResultMessage { id = \"call_sROMglBwxVnluIZnHcH5li9D\" toolName = \"execQuery\" text = \"Cold, with a low of 13 degrees\" }, AiMessage { text = \"The current weather in San Francisco is cold, with a low of 13 degrees Celsius.\" toolExecutionRequests = null }]}\n" ] } ],