Improve tracing output, update for newer runnables features,

This commit is contained in:
Nuno Campos
2023-08-24 17:21:53 +02:00
parent d1a518fdfa
commit 67ee1d87c7
5 changed files with 120 additions and 123 deletions
+28 -6
View File
@@ -69,7 +69,7 @@
{
"data": {
"text/plain": [
"\"Arr, me matey, ye be askin' a question that be as vast as the seven seas. Art be a treasure, a form o' expression that be capturin' the heart and soul. It be the brushstrokes on a canvas, the melodies in a shanty, the words on a page. Art be a glimpse into the mind o' the artist, a window into their world. It be a means o' communicatin', stirrin' emotions, and provokin' thoughts. It be subjective, me hearties, for what be art to one may not be art to another. But in the end, art be a gift that be enrichin' our lives and feedin' our souls.\""
"\"Arrr, me hearties! What be art, ye ask? Art be a fine treasure crafted by the hands of a creative soul. It be a form o' expression, a way to share the beauty and wonders o' the world. It be a splash o' colors on a canvas, a melody playin' in yer ear, or a tale spun with words. Art be a look into the depths o' the human spirit, a glimpse into the mysteries o' life. So, me mateys, let yer hearts be filled with art, for it be the treasure that brings joy and meaning to our pirate lives!\""
]
},
"execution_count": 3,
@@ -138,7 +138,7 @@
{
"data": {
"text/plain": [
"AIMessage(content='', additional_kwargs={'function_call': {'name': 'revise', 'arguments': '{\\n \"notes\": \"The draft is too short and lacks context. Please provide more information or details about the topic you are writing about.\"\\n}'}}, example=False)"
"AIMessage(content='', additional_kwargs={'function_call': {'name': 'revise', 'arguments': '{\\n \"notes\": \"The current draft is too short and lacks any context or detailed information. Please provide a more comprehensive and detailed draft for review.\"\\n}'}}, example=False)"
]
},
"execution_count": 5,
@@ -299,7 +299,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 13,
"id": "83087e85-b526-4730-b51e-9654dd0b8f69",
"metadata": {},
"outputs": [],
@@ -311,17 +311,17 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 14,
"id": "0371a5ac-7194-4cf9-9dd2-56cb3d1f46d6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
"[{'draft': 'Turtles have specific dietary preferences that vary depending on their species. Sea turtles, for example, primarily consume seaweed, jellyfish, and occasionally fish. On the other hand, land turtles, such as tortoises, mainly graze on grass, flowers, and leafy greens. Some turtles even enjoy fruits like berries and melons in addition to their plant-based diet. Insects also make for a crunchy treat that some turtles may indulge in. Therefore, whether they inhabit land or sea, turtles have a diverse range of food options to keep their bodies nourished and satisfied.'}]"
]
},
"execution_count": 16,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
@@ -329,6 +329,28 @@
"source": [
"web_researcher.invoke({\"question\": \"What food do turtles eat?\"})"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "6bc365e5-06d9-49d9-8278-c3b1138ea73c",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[{'draft': 'Turtles are fascinating creatures with a diverse appetite. Depending on their species and habitat, turtles consume a variety of foods. Some turtles primarily eat plants such as seaweed, grass, and algae. For instance, the green sea turtle is known to graze on seagrass beds and algae. Other turtles, like the snapping turtle, have a more carnivorous diet, feasting on insects, fish, and small crustaceans. Additionally, there are land-dwelling turtles that enjoy fruits and vegetables in their diet. For example, the box turtle has been observed eating berries and leafy greens. With such a varied diet, turtles keep their bellies full and maintain their overall health.'}],\n",
" [{'draft': 'Revised draft:\\n\\nHello, readers! You may be wondering where bears live. Well, bears are known to inhabit a wide range of lands, from the icy regions of the Arctic to the lush forests of the jungles. They can be found in North America, Europe, Asia, and even some parts of South America. Bears are highly adaptable creatures, capable of surviving in various habitats, including mountains, tundra, and even deserts. They create dens for hibernation and seek shelter in caves, trees, or dense vegetation. So, be observant, friends, as bears may be encountered in unexpected places!'}]]"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"[*web_researcher.batch([{\"question\": \"What food do turtles eat?\"}, {\"question\": \"Where do bears live?\"}])]"
]
}
],
"metadata": {