diff --git a/00_core.ipynb b/00_core.ipynb
index 61e4f71..679f0e3 100644
--- a/00_core.ipynb
+++ b/00_core.ipynb
@@ -200,23 +200,23 @@
{
"data": {
"text/markdown": [
- "Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\n",
+ "Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\n",
"\n",
"\n",
"\n",
- "- id: `msg_015cDEynYD2gAqWZtP67AW8F`\n",
- "- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\", 'type': 'text'}]`\n",
+ "- id: `msg_01UoJB5piJGSTpAc5XHLYwsi`\n",
+ "- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 10, 'output_tokens': 36}`\n",
+ "- usage: `{'input_tokens': 10, 'output_tokens': 32}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_015cDEynYD2gAqWZtP67AW8F', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 36; Total: 46)"
+ "Message(id='msg_01UoJB5piJGSTpAc5XHLYwsi', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 32; Cache create: 0; Cache read: 0; Total: 42)"
]
},
"execution_count": null,
@@ -298,7 +298,7 @@
{
"data": {
"text/plain": [
- "TextBlock(text=\"Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\", type='text')"
+ "TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", type='text')"
]
},
"execution_count": null,
@@ -322,7 +322,7 @@
" \"Helper to get the contents from Claude response `r`.\"\n",
" blk = find_block(r)\n",
" if not blk and r.content: blk = r.content[0]\n",
- " return blk.text.strip() if hasattr(blk,'text') else blk"
+ " return blk.text.strip() if hasattr(blk,'text') else str(blk)"
]
},
{
@@ -342,7 +342,7 @@
{
"data": {
"text/plain": [
- "\"Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\""
+ "\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\""
]
},
"execution_count": null,
@@ -392,23 +392,23 @@
{
"data": {
"text/markdown": [
- "Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\n",
+ "Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\n",
"\n",
"\n",
"\n",
- "- id: `msg_015cDEynYD2gAqWZtP67AW8F`\n",
- "- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\", 'type': 'text'}]`\n",
+ "- id: `msg_01UoJB5piJGSTpAc5XHLYwsi`\n",
+ "- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 10, 'output_tokens': 36}`\n",
+ "- usage: `{'input_tokens': 10, 'output_tokens': 32}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_015cDEynYD2gAqWZtP67AW8F', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How are you doing today? Is there anything I can help you with or any questions you'd like to ask?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 36; Total: 46)"
+ "Message(id='msg_01UoJB5piJGSTpAc5XHLYwsi', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 32; Cache create: 0; Cache read: 0; Total: 42)"
]
},
"execution_count": null,
@@ -439,7 +439,7 @@
{
"data": {
"text/plain": [
- "In: 10; Out: 36; Total: 46"
+ "In: 10; Out: 32; Cache create: 0; Cache read: 0; Total: 42"
]
},
"execution_count": null,
@@ -485,7 +485,7 @@
{
"data": {
"text/plain": [
- "In: 5; Out: 0; Total: 5"
+ "In: 5; Out: 0; Cache create: 0; Cache read: 0; Total: 5"
]
},
"execution_count": null,
@@ -610,7 +610,7 @@
{
"data": {
"text/plain": [
- "In: 20; Out: 72; Cache create: 0; Cache read: 0; Total: 92"
+ "In: 20; Out: 64; Cache create: 0; Cache read: 0; Total: 84"
]
},
"execution_count": null,
@@ -701,23 +701,23 @@
{
"data": {
"text/markdown": [
- "Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to chat about or any questions you have?\n",
+ "Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\n",
"\n",
"\n",
"\n",
- "- id: `msg_01NZwMS6s2GPpvDhiikBJCJB`\n",
- "- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to chat about or any questions you have?\", 'type': 'text'}]`\n",
+ "- id: `msg_01Qse5PrV4nBEzzYfH4L4cNJ`\n",
+ "- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 10, 'output_tokens': 36}`\n",
+ "- usage: `{'input_tokens': 10, 'output_tokens': 32}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01NZwMS6s2GPpvDhiikBJCJB', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to chat about or any questions you have?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 36; Cache create: 0; Cache read: 0; Total: 46)"
+ "Message(id='msg_01Qse5PrV4nBEzzYfH4L4cNJ', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to know or discuss?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 32; Cache create: 0; Cache read: 0; Total: 42)"
]
},
"execution_count": null,
@@ -765,7 +765,7 @@
" \"Helper to create a `dict` appropriate for a Claude message. `kw` are added as key/value pairs to the message\"\n",
" if hasattr(content, 'content'): content,role = content.content,content.role\n",
" if isinstance(content, abc.Mapping): content=content['content']\n",
- " return dict(role=role, content=content, **kw)"
+ " return dict(role=role, content=str(content), **kw)"
]
},
{
@@ -779,7 +779,7 @@
"text/plain": [
"[{'role': 'user', 'content': \"I'm Jeremy\"},\n",
" {'role': 'assistant',\n",
- " 'content': [TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to chat about or any questions you have?\", type='text')]},\n",
+ " 'content': '[TextBlock(text=\"Hello Jeremy! It\\'s nice to meet you. How can I assist you today? Is there anything specific you\\'d like to know or discuss?\", type=\\'text\\')]'},\n",
" {'role': 'user', 'content': 'I forgot my name. Can you remind me please?'}]"
]
},
@@ -814,19 +814,19 @@
"\n",
"\n",
"\n",
- "- id: `msg_01Jq3g2cm7gTqhffS1ppfuVe`\n",
+ "- id: `msg_01EasqomVWKjXhMkN311D9Uy`\n",
"- content: `[{'text': 'Of course! You just told me that your name is Jeremy.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 60, 'output_tokens': 16}`\n",
+ "- usage: `{'input_tokens': 67, 'output_tokens': 16}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01Jq3g2cm7gTqhffS1ppfuVe', content=[TextBlock(text='Of course! You just told me that your name is Jeremy.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 60; Out: 16; Cache create: 0; Cache read: 0; Total: 76)"
+ "Message(id='msg_01EasqomVWKjXhMkN311D9Uy', content=[TextBlock(text='Of course! You just told me that your name is Jeremy.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 67; Out: 16; Cache create: 0; Cache read: 0; Total: 83)"
]
},
"execution_count": null,
@@ -932,7 +932,7 @@
{
"data": {
"text/plain": [
- "In: 10; Out: 36; Cache create: 0; Cache read: 0; Total: 46"
+ "In: 10; Out: 32; Cache create: 0; Cache read: 0; Total: 42"
]
},
"execution_count": null,
@@ -1095,7 +1095,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_0198v4VM1zT49ogAxFvNxNYZ`\n",
+ "- id: `msg_01Lp1T1WvvTEmNvVmzFqTm9w`\n",
"- content: `[{'text': 'Hello! How can I assist you today?', 'type': 'text'}]`\n",
"- model: `claude-3-haiku-20240307`\n",
"- role: `assistant`\n",
@@ -1107,7 +1107,7 @@
" "
],
"text/plain": [
- "Message(id='msg_0198v4VM1zT49ogAxFvNxNYZ', content=[TextBlock(text='Hello! How can I assist you today?', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 8; Out: 12; Cache create: 0; Cache read: 0; Total: 20)"
+ "Message(id='msg_01Lp1T1WvvTEmNvVmzFqTm9w', content=[TextBlock(text='Hello! How can I assist you today?', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 8; Out: 12; Cache create: 0; Cache read: 0; Total: 20)"
]
},
"execution_count": null,
@@ -1172,7 +1172,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01XAzHiAzG5naht9yGFTbp8U`\n",
+ "- id: `msg_01MwpB8QjwpGfj2qxbUwrDUD`\n",
"- content: `[{'text': 'According to Douglas Adams, \"The answer to the ultimate question of life, the universe, and everything is 42.\"', 'type': 'text'}]`\n",
"- model: `claude-3-haiku-20240307`\n",
"- role: `assistant`\n",
@@ -1184,7 +1184,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01XAzHiAzG5naht9yGFTbp8U', content=[TextBlock(text='According to Douglas Adams, \"The answer to the ultimate question of life, the universe, and everything is 42.\"', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 24; Out: 23; Cache create: 0; Cache read: 0; Total: 47)"
+ "Message(id='msg_01MwpB8QjwpGfj2qxbUwrDUD', content=[TextBlock(text='According to Douglas Adams, \"The answer to the ultimate question of life, the universe, and everything is 42.\"', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 24; Out: 23; Cache create: 0; Cache read: 0; Total: 47)"
]
},
"execution_count": null,
@@ -1303,7 +1303,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01Fbgky7PuQwhPJBakNeknif`\n",
+ "- id: `msg_01Mdh4nn1HBguTP9ud5iib3F`\n",
"- content: `[{'text': '1, 2, 3, 4, ', 'type': 'text'}]`\n",
"- model: `claude-3-haiku-20240307`\n",
"- role: `assistant`\n",
@@ -1315,7 +1315,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01Fbgky7PuQwhPJBakNeknif', content=[TextBlock(text='1, 2, 3, 4, ', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='stop_sequence', stop_sequence='5', type='message', usage=In: 15; Out: 14; Cache create: 0; Cache read: 0; Total: 29)"
+ "Message(id='msg_01Mdh4nn1HBguTP9ud5iib3F', content=[TextBlock(text='1, 2, 3, 4, ', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='stop_sequence', stop_sequence='5', type='message', usage=In: 15; Out: 14; Cache create: 0; Cache read: 0; Total: 29)"
]
},
"execution_count": null,
@@ -1350,8 +1350,7 @@
}
],
"source": [
- "for o in c(\"Count from 1 to 10\", stop=[\"2\", \"yellow\"], stream=True):\n",
- " print(o, end='')\n",
+ "for o in c(\"Count from 1 to 10\", stop=[\"2\", \"yellow\"], stream=True): print(o, end='')\n",
"print(c.stop_reason, c.stop_sequence)"
]
},
@@ -1383,7 +1382,7 @@
" 'temp': None,\n",
" 'stream': None,\n",
" 'stop': None,\n",
- " 'result': Message(id='msg_01VYuz8Du9iv9zPRciNw6EsQ', content=[TextBlock(text='1, ', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='stop_sequence', stop_sequence='2', type='message', usage=In: 15; Out: 5; Cache create: 0; Cache read: 0; Total: 20),\n",
+ " 'result': Message(id='msg_01DkXFusG1hbFohLtHLpf7wZ', content=[TextBlock(text='1, ', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='stop_sequence', stop_sequence='2', type='message', usage=In: 15; Out: 5; Cache create: 0; Cache read: 0; Total: 20),\n",
" 'use': In: 94; Out: 89; Cache create: 0; Cache read: 0; Total: 183,\n",
" 'stop_reason': 'stop_sequence',\n",
" 'stop_sequence': '2'}"
@@ -1523,12 +1522,12 @@
{
"data": {
"text/markdown": [
- "ToolUseBlock(id='toolu_01FrFmqi3UGpD674vzBEGgoK', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')\n",
+ "ToolUseBlock(id='toolu_01DK1bo3oiqyY5g7wTSzE5vd', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')\n",
"\n",
"\n",
"\n",
- "- id: `msg_01CeW29zBrZ5B92Lf5hzVi8Z`\n",
- "- content: `[{'id': 'toolu_01FrFmqi3UGpD674vzBEGgoK', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`\n",
+ "- id: `msg_01MPDQuW1iPNb5ntKrprJFZJ`\n",
+ "- content: `[{'id': 'toolu_01DK1bo3oiqyY5g7wTSzE5vd', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`\n",
"- model: `claude-3-haiku-20240307`\n",
"- role: `assistant`\n",
"- stop_reason: `tool_use`\n",
@@ -1539,7 +1538,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01CeW29zBrZ5B92Lf5hzVi8Z', content=[ToolUseBlock(id='toolu_01FrFmqi3UGpD674vzBEGgoK', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-haiku-20240307', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 493; Out: 53; Cache create: 0; Cache read: 0; Total: 546)"
+ "Message(id='msg_01MPDQuW1iPNb5ntKrprJFZJ', content=[ToolUseBlock(id='toolu_01DK1bo3oiqyY5g7wTSzE5vd', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-haiku-20240307', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 493; Out: 53; Cache create: 0; Cache read: 0; Total: 546)"
]
},
"execution_count": null,
@@ -1620,7 +1619,7 @@
"\n",
"def mk_funcres(tuid, res):\n",
" \"Given tool use id and the tool result, create a tool_result response.\"\n",
- " return dict(type=\"tool_result\", tool_use_id=tuid, content=str(res))"
+ " return dict(type=\"tool_result\", tool_use_id=tuid, content=res)"
]
},
{
@@ -1648,8 +1647,8 @@
"data": {
"text/plain": [
"{'type': 'tool_result',\n",
- " 'tool_use_id': 'toolu_01FrFmqi3UGpD674vzBEGgoK',\n",
- " 'content': '7063474'}"
+ " 'tool_use_id': 'toolu_01DK1bo3oiqyY5g7wTSzE5vd',\n",
+ " 'content': 7063474}"
]
},
"execution_count": null,
@@ -1709,11 +1708,9 @@
"data": {
"text/plain": [
"[{'role': 'assistant',\n",
- " 'content': [ToolUseBlock(id='toolu_01FrFmqi3UGpD674vzBEGgoK', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')]},\n",
+ " 'content': \"[ToolUseBlock(id='toolu_01DK1bo3oiqyY5g7wTSzE5vd', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')]\"},\n",
" {'role': 'user',\n",
- " 'content': [{'type': 'tool_result',\n",
- " 'tool_use_id': 'toolu_01FrFmqi3UGpD674vzBEGgoK',\n",
- " 'content': '7063474'}]}]"
+ " 'content': \"[{'type': 'tool_result', 'tool_use_id': 'toolu_01DK1bo3oiqyY5g7wTSzE5vd', 'content': 7063474}]\"}]"
]
},
"execution_count": null,
@@ -1743,7 +1740,7 @@
{
"data": {
"text/plain": [
- "'The sum of 604542 and 6458932 is 7063474.'"
+ "'The sum of 604,542 and 6,458,932 is 7,063,474.'"
]
},
"execution_count": null,
@@ -1798,7 +1795,7 @@
{
"data": {
"text/plain": [
- "'The sum of 604542 and 6458932 is 7063474.'"
+ "'The sum of 604,542 and 6,458,932 is 7,063,474.'"
]
},
"execution_count": null,
@@ -1980,23 +1977,23 @@
{
"data": {
"text/markdown": [
- "Your name is Jeremy, as you mentioned in your previous message.\n",
+ "Your name is Jeremy.\n",
"\n",
"\n",
"\n",
- "- id: `msg_017DHoC68DWp6mQCeT1WPWhG`\n",
- "- content: `[{'text': 'Your name is Jeremy, as you mentioned in your previous message.', 'type': 'text'}]`\n",
+ "- id: `msg_01BpVQakyfWFepQXk4U5Y8gK`\n",
+ "- content: `[{'text': 'Your name is Jeremy.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 64, 'output_tokens': 16, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 75, 'output_tokens': 8, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_017DHoC68DWp6mQCeT1WPWhG', content=[TextBlock(text='Your name is Jeremy, as you mentioned in your previous message.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 64; Out: 16; Cache create: 0; Cache read: 0; Total: 80)"
+ "Message(id='msg_01BpVQakyfWFepQXk4U5Y8gK', content=[TextBlock(text='Your name is Jeremy.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 75; Out: 8; Cache create: 0; Cache read: 0; Total: 83)"
]
},
"execution_count": null,
@@ -2037,31 +2034,35 @@
{
"data": {
"text/markdown": [
- "According to Douglas Adams, the meaning of life is 42. More seriously, there's no universally agreed upon answer. Common philosophical perspectives include:\n",
+ "According to Douglas Adams,\n",
+ "\n",
+ "42.\n",
"\n",
- "1. Finding personal fulfillment\n",
- "2. Serving others\n",
- "3. Pursuing happiness\n",
- "4. Creating meaning through our choices\n",
- "5. Experiencing and appreciating existence\n",
+ "More seriously, there's no universally agreed upon answer. Common perspectives include:\n",
"\n",
- "Ultimately, many believe each individual must determine their own life's meaning.\n",
+ "• Finding personal meaning and fulfillment\n",
+ "• Loving and connecting with others \n",
+ "• Pursuing knowledge and growth\n",
+ "• Contributing positively to the world\n",
+ "• Experiencing joy and beauty\n",
+ "\n",
+ "Ultimately, many believe each person must define life's meaning for themselves.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01XofAu1gHfP84o1S5BoDe3H`\n",
- "- content: `[{'text': \"According to Douglas Adams, the meaning of life is 42. More seriously, there's no universally agreed upon answer. Common philosophical perspectives include:\\n\\n1. Finding personal fulfillment\\n2. Serving others\\n3. Pursuing happiness\\n4. Creating meaning through our choices\\n5. Experiencing and appreciating existence\\n\\nUltimately, many believe each individual must determine their own life's meaning.\", 'type': 'text'}]`\n",
+ "- id: `msg_015TvBHZ3yZAkwTjYDeT6gLj`\n",
+ "- content: `[{'text': \"According to Douglas Adams,\\n\\n42.\\n\\nMore seriously, there's no universally agreed upon answer. Common perspectives include:\\n\\n• Finding personal meaning and fulfillment\\n• Loving and connecting with others \\n• Pursuing knowledge and growth\\n• Contributing positively to the world\\n• Experiencing joy and beauty\\n\\nUltimately, many believe each person must define life's meaning for themselves.\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 100, 'output_tokens': 82, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 114, 'output_tokens': 78, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01XofAu1gHfP84o1S5BoDe3H', content=[TextBlock(text=\"According to Douglas Adams, the meaning of life is 42. More seriously, there's no universally agreed upon answer. Common philosophical perspectives include:\\n\\n1. Finding personal fulfillment\\n2. Serving others\\n3. Pursuing happiness\\n4. Creating meaning through our choices\\n5. Experiencing and appreciating existence\\n\\nUltimately, many believe each individual must determine their own life's meaning.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 100; Out: 82; Cache create: 0; Cache read: 0; Total: 182)"
+ "Message(id='msg_015TvBHZ3yZAkwTjYDeT6gLj', content=[TextBlock(text=\"According to Douglas Adams,\\n\\n42.\\n\\nMore seriously, there's no universally agreed upon answer. Common perspectives include:\\n\\n• Finding personal meaning and fulfillment\\n• Loving and connecting with others \\n• Pursuing knowledge and growth\\n• Contributing positively to the world\\n• Experiencing joy and beauty\\n\\nUltimately, many believe each person must define life's meaning for themselves.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 114; Out: 78; Cache create: 0; Cache read: 0; Total: 192)"
]
},
"execution_count": null,
@@ -2117,36 +2118,34 @@
{
"data": {
"text/markdown": [
- "Continuing on the topic of the meaning of life:\n",
+ "[TextBlock(text=\"Continuing on the meaning of life:\n",
"\n",
- "6. Achieving self-actualization\n",
- "7. Leaving a positive legacy\n",
- "8. Connecting with others and forming relationships\n",
- "9. Exploring and understanding the universe\n",
- "10. Evolving as a species\n",
- "11. Pursuing spiritual or religious enlightenment\n",
- "12. Maximizing pleasure and minimizing pain\n",
- "13. Fulfilling one's potential\n",
- "14. Contributing to the greater good\n",
- "15. Experiencing love and being loved\n",
+ "• Achieving self-actualization\n",
+ "• Leaving a lasting legacy\n",
+ "• Serving a higher purpose or deity\n",
+ "• Maximizing happiness and minimizing suffering\n",
+ "• Embracing the absurdity of existence\n",
+ "• Living authentically and true to oneself\n",
+ "• Constantly evolving and adapting\n",
+ "• Finding balance and harmony\n",
"\n",
- "These perspectives often overlap and can be combined in various ways. The search for meaning itself is considered by some to be an essential part of the human experience.\n",
+ "The search for meaning itself can be seen as part of life's purpose. It's a deeply personal journey that often evolves throughout one's lifetime.\", type='text')]\n",
"\n",
"\n",
"\n",
- "- id: `msg_01Kv6mb5ynviiQ557DbEEja3`\n",
- "- content: `[{'text': \"Continuing on the topic of the meaning of life:\\n\\n6. Achieving self-actualization\\n7. Leaving a positive legacy\\n8. Connecting with others and forming relationships\\n9. Exploring and understanding the universe\\n10. Evolving as a species\\n11. Pursuing spiritual or religious enlightenment\\n12. Maximizing pleasure and minimizing pain\\n13. Fulfilling one's potential\\n14. Contributing to the greater good\\n15. Experiencing love and being loved\\n\\nThese perspectives often overlap and can be combined in various ways. The search for meaning itself is considered by some to be an essential part of the human experience.\", 'type': 'text'}]`\n",
+ "- id: `msg_01Vdn1SG1WffJc9Y874GYxi1`\n",
+ "- content: `[{'text': '[TextBlock(text=\"Continuing on the meaning of life:\\n\\n• Achieving self-actualization\\n• Leaving a lasting legacy\\n• Serving a higher purpose or deity\\n• Maximizing happiness and minimizing suffering\\n• Embracing the absurdity of existence\\n• Living authentically and true to oneself\\n• Constantly evolving and adapting\\n• Finding balance and harmony\\n\\nThe search for meaning itself can be seen as part of life\\'s purpose. It\\'s a deeply personal journey that often evolves throughout one\\'s lifetime.\", type=\\'text\\')]', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 188, 'output_tokens': 138, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 224, 'output_tokens': 121, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01Kv6mb5ynviiQ557DbEEja3', content=[TextBlock(text=\"Continuing on the topic of the meaning of life:\\n\\n6. Achieving self-actualization\\n7. Leaving a positive legacy\\n8. Connecting with others and forming relationships\\n9. Exploring and understanding the universe\\n10. Evolving as a species\\n11. Pursuing spiritual or religious enlightenment\\n12. Maximizing pleasure and minimizing pain\\n13. Fulfilling one's potential\\n14. Contributing to the greater good\\n15. Experiencing love and being loved\\n\\nThese perspectives often overlap and can be combined in various ways. The search for meaning itself is considered by some to be an essential part of the human experience.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 188; Out: 138; Cache create: 0; Cache read: 0; Total: 326)"
+ "Message(id='msg_01Vdn1SG1WffJc9Y874GYxi1', content=[TextBlock(text='[TextBlock(text=\"Continuing on the meaning of life:\\n\\n• Achieving self-actualization\\n• Leaving a lasting legacy\\n• Serving a higher purpose or deity\\n• Maximizing happiness and minimizing suffering\\n• Embracing the absurdity of existence\\n• Living authentically and true to oneself\\n• Constantly evolving and adapting\\n• Finding balance and harmony\\n\\nThe search for meaning itself can be seen as part of life\\'s purpose. It\\'s a deeply personal journey that often evolves throughout one\\'s lifetime.\", type=\\'text\\')]', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 224; Out: 121; Cache create: 0; Cache read: 0; Total: 345)"
]
},
"execution_count": null,
@@ -2196,18 +2195,15 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "According to Douglas Adams, the meaning of life is 42. More seriously, there's no universally agreed upon answer. Common perspectives include:\n",
+ "According to Douglas Adams, the meaning of life is 42. More seriously, there's no universally agreed upon answer, but common perspectives include:\n",
"\n",
- "1. Finding personal fulfillment\n",
- "2. Serving others\n",
- "3. Pursuing knowledge\n",
+ "1. Finding personal fulfillment and happiness\n",
+ "2. Making a positive impact on others\n",
+ "3. Pursuing knowledge and understanding\n",
"4. Experiencing love and relationships\n",
- "5. Creating or appreciating art\n",
- "6. Achieving goals\n",
- "7. Living according to one's values\n",
- "8. Spiritual or religious devotion\n",
+ "5. Achieving goals and self-actualization\n",
"\n",
- "Ultimately, many believe each individual must define their own meaning."
+ "Ultimately, many believe the meaning of life is what you choose to make of it."
]
}
],
@@ -2273,8 +2269,8 @@
"\n",
"\n",
"\n",
- "- id: `msg_01KGmXJpd24WfK1UJsFDrpFh`\n",
- "- content: `[{'text': 'To answer this question, I can use the \"sums\" function to add these two numbers together. Let me do that for you.', 'type': 'text'}, {'id': 'toolu_01NqWp6dHanPmad68TqcgKNB', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`\n",
+ "- id: `msg_01EgcVkiW1WSteWKfKSfqNpr`\n",
+ "- content: `[{'text': 'To answer this question, I can use the \"sums\" function to add these two numbers together. Let me do that for you.', 'type': 'text'}, {'id': 'toolu_017xJaX2JJnJDVinq2ksvBew', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `tool_use`\n",
@@ -2285,7 +2281,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01KGmXJpd24WfK1UJsFDrpFh', content=[TextBlock(text='To answer this question, I can use the \"sums\" function to add these two numbers together. Let me do that for you.', type='text'), ToolUseBlock(id='toolu_01NqWp6dHanPmad68TqcgKNB', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 428; Out: 101; Cache create: 0; Cache read: 0; Total: 529)"
+ "Message(id='msg_01EgcVkiW1WSteWKfKSfqNpr', content=[TextBlock(text='To answer this question, I can use the \"sums\" function to add these two numbers together. Let me do that for you.', type='text'), ToolUseBlock(id='toolu_017xJaX2JJnJDVinq2ksvBew', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 428; Out: 101; Cache create: 0; Cache read: 0; Total: 529)"
]
},
"execution_count": null,
@@ -2308,23 +2304,28 @@
{
"data": {
"text/markdown": [
- "The sum of 604542 and 6458932 is 7063474.\n",
+ "The sum of 604,542 and 6,458,932 is 7,063,474.\n",
+ "\n",
+ "To break it down:\n",
+ "604,542 + 6,458,932 = 7,063,474\n",
+ "\n",
+ "This result was calculated using the \"sums\" function, which accurately added the two numbers together. The function took the first number (604,542) as parameter 'a' and the second number (6,458,932) as parameter 'b', and returned their sum.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01AMvUHJHisUpf4DNWek8wFS`\n",
- "- content: `[{'text': 'The sum of 604542 and 6458932 is 7063474.', 'type': 'text'}]`\n",
+ "- id: `msg_01CgpYE8eVwofEqxtj9S164b`\n",
+ "- content: `[{'text': 'The sum of 604,542 and 6,458,932 is 7,063,474.\\n\\nTo break it down:\\n604,542 + 6,458,932 = 7,063,474\\n\\nThis result was calculated using the \"sums\" function, which accurately added the two numbers together. The function took the first number (604,542) as parameter \\'a\\' and the second number (6,458,932) as parameter \\'b\\', and returned their sum.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 543, 'output_tokens': 23, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 585, 'output_tokens': 113, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01AMvUHJHisUpf4DNWek8wFS', content=[TextBlock(text='The sum of 604542 and 6458932 is 7063474.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 543; Out: 23; Cache create: 0; Cache read: 0; Total: 566)"
+ "Message(id='msg_01CgpYE8eVwofEqxtj9S164b', content=[TextBlock(text='The sum of 604,542 and 6,458,932 is 7,063,474.\\n\\nTo break it down:\\n604,542 + 6,458,932 = 7,063,474\\n\\nThis result was calculated using the \"sums\" function, which accurately added the two numbers together. The function took the first number (604,542) as parameter \\'a\\' and the second number (6,458,932) as parameter \\'b\\', and returned their sum.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 585; Out: 113; Cache create: 0; Cache read: 0; Total: 698)"
]
},
"execution_count": null,
@@ -2506,23 +2507,23 @@
{
"data": {
"text/markdown": [
- "The image contains purple or lavender-colored flowers, which appear to be daisies or a similar type of flower.\n",
+ "The image does not contain any flowers. It appears to be a photograph of a person.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01QAqW2xRhxxS2kodvcE67t2`\n",
- "- content: `[{'text': 'The image contains purple or lavender-colored flowers, which appear to be daisies or a similar type of flower.', 'type': 'text'}]`\n",
+ "- id: `msg_01VmMz4TKqYU4dmV5iAM8zat`\n",
+ "- content: `[{'text': 'The image does not contain any flowers. It appears to be a photograph of a person.', 'type': 'text'}]`\n",
"- model: `claude-3-haiku-20240307`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 110, 'output_tokens': 28, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 27574, 'output_tokens': 21, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01QAqW2xRhxxS2kodvcE67t2', content=[TextBlock(text='The image contains purple or lavender-colored flowers, which appear to be daisies or a similar type of flower.', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 110; Out: 28; Cache create: 0; Cache read: 0; Total: 138)"
+ "Message(id='msg_01VmMz4TKqYU4dmV5iAM8zat', content=[TextBlock(text='The image does not contain any flowers. It appears to be a photograph of a person.', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 27574; Out: 21; Cache create: 0; Cache read: 0; Total: 27595)"
]
},
"execution_count": null,
@@ -2537,7 +2538,20 @@
{
"cell_type": "code",
"execution_count": null,
- "id": "8764c605",
+ "id": "3bef894b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "#| exports\n",
+ "def _str_if_needed(o):\n",
+ " if isinstance(o, (list,tuple,abc.Mapping)) or hasattr(o, '__pydantic_serializer__'): return o\n",
+ " return str(o)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "197593b3",
"metadata": {},
"outputs": [],
"source": [
@@ -2546,7 +2560,8 @@
" \"Create appropriate content data structure based on type of content\"\n",
" if isinstance(src,str): return text_msg(src, cache=cache)\n",
" if isinstance(src,bytes): return img_msg(src, cache=cache)\n",
- " return src"
+ " if isinstance(src, abc.Mapping): return {k:_str_if_needed(v) for k,v in src.items()}\n",
+ " return _str_if_needed(src)"
]
},
{
@@ -2642,7 +2657,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01D3cCRg681NTpoT1VKgTnAg`\n",
+ "- id: `msg_01GnuADus2g1XBFZqGpLMtMC`\n",
"- content: `[{'text': 'The image contains purple or lavender-colored flowers, which appear to be daisies or a similar type of flower.', 'type': 'text'}]`\n",
"- model: `claude-3-haiku-20240307`\n",
"- role: `assistant`\n",
@@ -2654,7 +2669,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01D3cCRg681NTpoT1VKgTnAg', content=[TextBlock(text='The image contains purple or lavender-colored flowers, which appear to be daisies or a similar type of flower.', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 110; Out: 28; Cache create: 0; Cache read: 0; Total: 138)"
+ "Message(id='msg_01GnuADus2g1XBFZqGpLMtMC', content=[TextBlock(text='The image contains purple or lavender-colored flowers, which appear to be daisies or a similar type of flower.', type='text')], model='claude-3-haiku-20240307', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 110; Out: 28; Cache create: 0; Cache read: 0; Total: 138)"
]
},
"execution_count": null,
diff --git a/claudette/_modidx.py b/claudette/_modidx.py
index 479c0be..81ded22 100644
--- a/claudette/_modidx.py
+++ b/claudette/_modidx.py
@@ -35,6 +35,7 @@
'claudette.core._add_cache': ('core.html#_add_cache', 'claudette/core.py'),
'claudette.core._mk_content': ('core.html#_mk_content', 'claudette/core.py'),
'claudette.core._mk_ns': ('core.html#_mk_ns', 'claudette/core.py'),
+ 'claudette.core._str_if_needed': ('core.html#_str_if_needed', 'claudette/core.py'),
'claudette.core.call_func': ('core.html#call_func', 'claudette/core.py'),
'claudette.core.contents': ('core.html#contents', 'claudette/core.py'),
'claudette.core.find_block': ('core.html#find_block', 'claudette/core.py'),
diff --git a/claudette/core.py b/claudette/core.py
index 921923c..879d853 100644
--- a/claudette/core.py
+++ b/claudette/core.py
@@ -39,7 +39,7 @@ def contents(r):
"Helper to get the contents from Claude response `r`."
blk = find_block(r)
if not blk and r.content: blk = r.content[0]
- return blk.text.strip() if hasattr(blk,'text') else blk
+ return blk.text.strip() if hasattr(blk,'text') else str(blk)
# %% ../00_core.ipynb
@patch
@@ -178,7 +178,7 @@ def call_func(fc:ToolUseBlock, # Tool use block from Claude's message
def mk_funcres(tuid, res):
"Given tool use id and the tool result, create a tool_result response."
- return dict(type="tool_result", tool_use_id=tuid, content=str(res))
+ return dict(type="tool_result", tool_use_id=tuid, content=res)
# %% ../00_core.ipynb
def mk_toolres(
@@ -271,12 +271,18 @@ def text_msg(s:str, cache=False)->dict:
"Convert `s` to a text message"
return _add_cache({"type": "text", "text": s}, cache)
+# %% ../00_core.ipynb
+def _str_if_needed(o):
+ if isinstance(o, (list,tuple,abc.Mapping)) or hasattr(o, '__pydantic_serializer__'): return o
+ return str(o)
+
# %% ../00_core.ipynb
def _mk_content(src, cache=False):
"Create appropriate content data structure based on type of content"
if isinstance(src,str): return text_msg(src, cache=cache)
if isinstance(src,bytes): return img_msg(src, cache=cache)
- return src
+ if isinstance(src, abc.Mapping): return {k:_str_if_needed(v) for k,v in src.items()}
+ return _str_if_needed(src)
# %% ../00_core.ipynb
def mk_msg(content, # A string, list, or dict containing the contents of the message
diff --git a/index.ipynb b/index.ipynb
index 58835a9..262f293 100644
--- a/index.ipynb
+++ b/index.ipynb
@@ -196,7 +196,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01WcnX63YJVK9CT1u33ocp7i`\n",
+ "- id: `msg_01XCDYdAigXPV3tr4Gk1jgHa`\n",
"- content: `[{'text': \"Hello Jeremy, it's nice to meet you. How can I assist you today?\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
@@ -208,7 +208,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01WcnX63YJVK9CT1u33ocp7i', content=[TextBlock(text=\"Hello Jeremy, it's nice to meet you. How can I assist you today?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 19; Out: 20; Cache create: 0; Cache read: 0; Total: 39)"
+ "Message(id='msg_01XCDYdAigXPV3tr4Gk1jgHa', content=[TextBlock(text=\"Hello Jeremy, it's nice to meet you. How can I assist you today?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 19; Out: 20; Cache create: 0; Cache read: 0; Total: 39)"
]
},
"execution_count": null,
@@ -234,7 +234,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_0114Bo5RYzyk2zYU1qmMxkS7`\n",
+ "- id: `msg_011MfA5LVyBsZLLChaTTJDBk`\n",
"- content: `[{'text': 'Your name is Jeremy, as you just told me.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
@@ -246,7 +246,45 @@
" "
],
"text/plain": [
- "Message(id='msg_0114Bo5RYzyk2zYU1qmMxkS7', content=[TextBlock(text='Your name is Jeremy, as you just told me.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 47; Out: 14; Cache create: 0; Cache read: 0; Total: 61)"
+ "Message(id='msg_011MfA5LVyBsZLLChaTTJDBk', content=[TextBlock(text='Your name is Jeremy, as you just told me.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 47; Out: 14; Cache create: 0; Cache read: 0; Total: 61)"
+ ]
+ },
+ "execution_count": null,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "r = chat(\"What's my name?\")\n",
+ "r"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "8e603357",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/markdown": [
+ "Your name is Jeremy.\n",
+ "\n",
+ "\n",
+ "\n",
+ "- id: `msg_01Qosij9Tbc9u82bTFmdoXpU`\n",
+ "- content: `[{'text': 'Your name is Jeremy.', 'type': 'text'}]`\n",
+ "- model: `claude-3-5-sonnet-20240620`\n",
+ "- role: `assistant`\n",
+ "- stop_reason: `end_turn`\n",
+ "- stop_sequence: `None`\n",
+ "- type: `message`\n",
+ "- usage: `{'input_tokens': 69, 'output_tokens': 8, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "\n",
+ " "
+ ],
+ "text/plain": [
+ "Message(id='msg_01Qosij9Tbc9u82bTFmdoXpU', content=[TextBlock(text='Your name is Jeremy.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 69; Out: 8; Cache create: 0; Cache read: 0; Total: 77)"
]
},
"execution_count": null,
@@ -277,7 +315,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "Message(id='msg_0114Bo5RYzyk2zYU1qmMxkS7', content=[TextBlock(text='Your name is Jeremy, as you just told me.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 47; Out: 14; Cache create: 0; Cache read: 0; Total: 61)\n"
+ "Message(id='msg_01Qosij9Tbc9u82bTFmdoXpU', content=[TextBlock(text='Your name is Jeremy.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 69; Out: 8; Cache create: 0; Cache read: 0; Total: 77)\n"
]
}
],
@@ -302,23 +340,23 @@
{
"data": {
"text/markdown": [
- "According to Douglas Adams, \"42.\" More seriously, it's often considered to be finding personal fulfillment, happiness, and purpose.\n",
+ "According to Douglas Adams, the meaning of life is 42. Philosophically, it's often considered to be finding purpose, happiness, and fulfillment in one's existence.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01KwdNaaWi1kufRpqQh35SQi`\n",
- "- content: `[{'text': 'According to Douglas Adams, \"42.\" More seriously, it\\'s often considered to be finding personal fulfillment, happiness, and purpose.', 'type': 'text'}]`\n",
+ "- id: `msg_01MvA934wD5Ssyr3jhWTmV1G`\n",
+ "- content: `[{'text': \"According to Douglas Adams, the meaning of life is 42. Philosophically, it's often considered to be finding purpose, happiness, and fulfillment in one's existence.\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 81, 'output_tokens': 27, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 97, 'output_tokens': 36, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01KwdNaaWi1kufRpqQh35SQi', content=[TextBlock(text='According to Douglas Adams, \"42.\" More seriously, it\\'s often considered to be finding personal fulfillment, happiness, and purpose.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 81; Out: 27; Cache create: 0; Cache read: 0; Total: 108)"
+ "Message(id='msg_01MvA934wD5Ssyr3jhWTmV1G', content=[TextBlock(text=\"According to Douglas Adams, the meaning of life is 42. Philosophically, it's often considered to be finding purpose, happiness, and fulfillment in one's existence.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 97; Out: 36; Cache create: 0; Cache read: 0; Total: 133)"
]
},
"execution_count": null,
@@ -387,7 +425,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01AC6bcP6JEqq3eRuuzkCHe2`\n",
+ "- id: `msg_018i1EFCqB2vHmNBvspg9eUZ`\n",
"- content: `[{'text': \"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
@@ -399,7 +437,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01AC6bcP6JEqq3eRuuzkCHe2', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 36; Cache create: 0; Cache read: 0; Total: 46)"
+ "Message(id='msg_018i1EFCqB2vHmNBvspg9eUZ', content=[TextBlock(text=\"Hello Jeremy! It's nice to meet you. How can I assist you today? Is there anything specific you'd like to talk about or any questions you have?\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 10; Out: 36; Cache create: 0; Cache read: 0; Total: 46)"
]
},
"execution_count": null,
@@ -430,15 +468,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "According to Douglas Adams, the meaning of life is 42. More seriously, there's no universally agreed upon answer. Common perspectives include:\n",
+ "According to Douglas Adams, the meaning of life is 42. More seriously, philosophers have debated this for millennia. Common answers include:\n",
"\n",
- "1. Finding personal happiness and fulfillment\n",
- "2. Serving others or a higher purpose\n",
- "3. Creating meaning through our choices and actions\n",
- "4. Experiencing and appreciating existence\n",
- "5. Evolving and growing as individuals and as a species\n",
+ "1. Finding personal happiness\n",
+ "2. Serving others\n",
+ "3. Pursuing knowledge\n",
+ "4. Creating meaning through our choices\n",
+ "5. Fulfilling our potential\n",
+ "6. Connecting with others\n",
+ "7. Experiencing love and beauty\n",
"\n",
- "Ultimately, many believe each person must define their own meaning of life."
+ "Ultimately, many believe we must each find our own meaning."
]
}
],
@@ -483,37 +523,37 @@
{
"data": {
"text/markdown": [
- "Based on the readme, the main purpose of this project called \"claudette\" is to provide a high-level wrapper around Anthropic's Python SDK for interacting with Claude AI models. Key features and goals include:\n",
+ "Based on the readme, the main purpose of the Claudette project is to provide a high-level wrapper around Anthropic's Python SDK for interacting with Claude AI models. Key features and goals include:\n",
"\n",
"1. Automating and simplifying interactions with Claude, reducing boilerplate code.\n",
"\n",
"2. Providing a stateful dialog interface through the `Chat` class.\n",
"\n",
- "3. Supporting features like prefill, image handling, and tool use in a convenient way.\n",
+ "3. Supporting features like prefill (specifying the start of Claude's response) and image handling.\n",
"\n",
- "4. Offering compatibility with different Claude model providers like Amazon Bedrock and Google Vertex.\n",
+ "4. Offering convenient support for Claude's Tool Use API.\n",
"\n",
- "5. Serving as an example of \"literate programming\", with the source code designed to be readable and educational, explaining not just what the code does but how and why it's written that way.\n",
+ "5. Serving as an example of \"literate programming\", with the source code designed to be readable and educational, including explanations of how and why the code is written.\n",
"\n",
- "6. Making it easier for developers to use Claude's capabilities without having to deal with low-level implementation details.\n",
+ "6. Supporting multiple model providers, including direct Anthropic API access as well as Claude models available through Amazon Bedrock and Google Vertex AI.\n",
"\n",
- "The project aims to streamline the process of working with Claude AI models while providing full control and transparency to developers.\n",
+ "The project aims to make working with Claude models more convenient and accessible for developers while also serving as an educational resource on how to effectively use and interact with these AI models.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01D3xykrTLbhkxKSTpUseDm4`\n",
- "- content: `[{'text': 'Based on the readme, the main purpose of this project called \"claudette\" is to provide a high-level wrapper around Anthropic\\'s Python SDK for interacting with Claude AI models. Key features and goals include:\\n\\n1. Automating and simplifying interactions with Claude, reducing boilerplate code.\\n\\n2. Providing a stateful dialog interface through the `Chat` class.\\n\\n3. Supporting features like prefill, image handling, and tool use in a convenient way.\\n\\n4. Offering compatibility with different Claude model providers like Amazon Bedrock and Google Vertex.\\n\\n5. Serving as an example of \"literate programming\", with the source code designed to be readable and educational, explaining not just what the code does but how and why it\\'s written that way.\\n\\n6. Making it easier for developers to use Claude\\'s capabilities without having to deal with low-level implementation details.\\n\\nThe project aims to streamline the process of working with Claude AI models while providing full control and transparency to developers.', 'type': 'text'}]`\n",
+ "- id: `msg_015khP4yqW57tH4qK6tGTkQr`\n",
+ "- content: `[{'text': 'Based on the readme, the main purpose of the Claudette project is to provide a high-level wrapper around Anthropic\\'s Python SDK for interacting with Claude AI models. Key features and goals include:\\n\\n1. Automating and simplifying interactions with Claude, reducing boilerplate code.\\n\\n2. Providing a stateful dialog interface through the `Chat` class.\\n\\n3. Supporting features like prefill (specifying the start of Claude\\'s response) and image handling.\\n\\n4. Offering convenient support for Claude\\'s Tool Use API.\\n\\n5. Serving as an example of \"literate programming\", with the source code designed to be readable and educational, including explanations of how and why the code is written.\\n\\n6. Supporting multiple model providers, including direct Anthropic API access as well as Claude models available through Amazon Bedrock and Google Vertex AI.\\n\\nThe project aims to make working with Claude models more convenient and accessible for developers while also serving as an educational resource on how to effectively use and interact with these AI models.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 4, 'output_tokens': 215, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 7171}`\n",
+ "- usage: `{'input_tokens': 4, 'output_tokens': 220, 'cache_creation_input_tokens': 7171, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01D3xykrTLbhkxKSTpUseDm4', content=[TextBlock(text='Based on the readme, the main purpose of this project called \"claudette\" is to provide a high-level wrapper around Anthropic\\'s Python SDK for interacting with Claude AI models. Key features and goals include:\\n\\n1. Automating and simplifying interactions with Claude, reducing boilerplate code.\\n\\n2. Providing a stateful dialog interface through the `Chat` class.\\n\\n3. Supporting features like prefill, image handling, and tool use in a convenient way.\\n\\n4. Offering compatibility with different Claude model providers like Amazon Bedrock and Google Vertex.\\n\\n5. Serving as an example of \"literate programming\", with the source code designed to be readable and educational, explaining not just what the code does but how and why it\\'s written that way.\\n\\n6. Making it easier for developers to use Claude\\'s capabilities without having to deal with low-level implementation details.\\n\\nThe project aims to streamline the process of working with Claude AI models while providing full control and transparency to developers.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 4; Out: 215; Cache create: 0; Cache read: 7171; Total: 7390)"
+ "Message(id='msg_015khP4yqW57tH4qK6tGTkQr', content=[TextBlock(text='Based on the readme, the main purpose of the Claudette project is to provide a high-level wrapper around Anthropic\\'s Python SDK for interacting with Claude AI models. Key features and goals include:\\n\\n1. Automating and simplifying interactions with Claude, reducing boilerplate code.\\n\\n2. Providing a stateful dialog interface through the `Chat` class.\\n\\n3. Supporting features like prefill (specifying the start of Claude\\'s response) and image handling.\\n\\n4. Offering convenient support for Claude\\'s Tool Use API.\\n\\n5. Serving as an example of \"literate programming\", with the source code designed to be readable and educational, including explanations of how and why the code is written.\\n\\n6. Supporting multiple model providers, including direct Anthropic API access as well as Claude models available through Amazon Bedrock and Google Vertex AI.\\n\\nThe project aims to make working with Claude models more convenient and accessible for developers while also serving as an educational resource on how to effectively use and interact with these AI models.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 4; Out: 220; Cache create: 7171; Cache read: 0; Total: 7395)"
]
},
"execution_count": null,
@@ -549,7 +589,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "Usage(input_tokens=4, output_tokens=215, cache_creation_input_tokens=0, cache_read_input_tokens=7171)\n"
+ "Usage(input_tokens=4, output_tokens=220, cache_creation_input_tokens=7171, cache_read_input_tokens=0)\n"
]
}
],
@@ -576,37 +616,37 @@
"text/markdown": [
"Claudette makes tool use more ergonomic in several ways:\n",
"\n",
- "1. Simplified tool definition: It uses docments (a feature from fastcore) to make defining Python functions as tools more straightforward. Each parameter and return value should have a type and a description, making it easier to create well-documented tools.\n",
+ "1. Simplified function definition: It uses docments to make defining Python functions for tools as simple as possible. Each parameter and the return value should have a type and a description.\n",
"\n",
- "2. Automatic handling: When using tools, Claudette handles the back-and-forth between Claude and the tool automatically. You don't need to manually process Claude's tool use requests and feed the results back.\n",
+ "2. Automatic handling: The `Chat` class can be initialized with a list of tools, and Claudette handles the back-and-forth between Claude and the tools automatically.\n",
"\n",
- "3. Single-step execution: The `Chat.toolloop` method allows you to execute a series of tool calls in a single step. This can handle multiple tool calls as needed to solve a problem, without requiring manual intervention for each step.\n",
+ "3. Single-step execution: The `Chat.toolloop` method allows for executing a series of tool calls in a single step, even if multiple tools are needed to solve a problem.\n",
"\n",
- "4. Trace functionality: You can pass a `trace_func` to see each response from Claude during the tool use process, which is helpful for debugging and understanding the AI's reasoning.\n",
+ "4. Forced tool use: You can set `tool_choice` to force Claude to always answer using a specific tool.\n",
"\n",
- "5. Easy tool registration: Tools are simply passed as a list to the `Chat` constructor, making it easy to add or change available tools.\n",
+ "5. Tracing: The `toolloop` method supports a `trace_func` parameter, allowing you to see each response from Claude during the process.\n",
"\n",
- "6. Forced tool use: You can set `tool_choice` to force Claude to always use a specific tool, which can be useful in certain scenarios.\n",
+ "6. Automatic parameter passing: When Claude decides to use a tool, Claudette automatically calls the tool with the provided parameters.\n",
"\n",
- "7. Automatic token handling: Claudette keeps track of token usage, including the additional tokens used for tool-related system prompts.\n",
+ "7. System prompt integration: It allows setting a system prompt to guide Claude's behavior when using tools, such as instructing it not to mention the tools it's using.\n",
"\n",
- "These features significantly reduce the amount of code and manual steps needed to implement tool use with Claude, making the process more streamlined and developer-friendly.\n",
+ "These features significantly reduce the amount of code and manual handling required to use Claude's tool use capabilities, making the process more streamlined and developer-friendly.\n",
"\n",
"\n",
"\n",
- "- id: `msg_013EXbQe1Pcbg1duhRKPb2y8`\n",
- "- content: `[{'text': \"Claudette makes tool use more ergonomic in several ways:\\n\\n1. Simplified tool definition: It uses docments (a feature from fastcore) to make defining Python functions as tools more straightforward. Each parameter and return value should have a type and a description, making it easier to create well-documented tools.\\n\\n2. Automatic handling: When using tools, Claudette handles the back-and-forth between Claude and the tool automatically. You don't need to manually process Claude's tool use requests and feed the results back.\\n\\n3. Single-step execution: The `Chat.toolloop` method allows you to execute a series of tool calls in a single step. This can handle multiple tool calls as needed to solve a problem, without requiring manual intervention for each step.\\n\\n4. Trace functionality: You can pass a `trace_func` to see each response from Claude during the tool use process, which is helpful for debugging and understanding the AI's reasoning.\\n\\n5. Easy tool registration: Tools are simply passed as a list to the `Chat` constructor, making it easy to add or change available tools.\\n\\n6. Forced tool use: You can set `tool_choice` to force Claude to always use a specific tool, which can be useful in certain scenarios.\\n\\n7. Automatic token handling: Claudette keeps track of token usage, including the additional tokens used for tool-related system prompts.\\n\\nThese features significantly reduce the amount of code and manual steps needed to implement tool use with Claude, making the process more streamlined and developer-friendly.\", 'type': 'text'}]`\n",
+ "- id: `msg_01B4KHLHzM6MUnRgiB3tZ1m5`\n",
+ "- content: `[{'text': \"Claudette makes tool use more ergonomic in several ways:\\n\\n1. Simplified function definition: It uses docments to make defining Python functions for tools as simple as possible. Each parameter and the return value should have a type and a description.\\n\\n2. Automatic handling: The `Chat` class can be initialized with a list of tools, and Claudette handles the back-and-forth between Claude and the tools automatically.\\n\\n3. Single-step execution: The `Chat.toolloop` method allows for executing a series of tool calls in a single step, even if multiple tools are needed to solve a problem.\\n\\n4. Forced tool use: You can set `tool_choice` to force Claude to always answer using a specific tool.\\n\\n5. Tracing: The `toolloop` method supports a `trace_func` parameter, allowing you to see each response from Claude during the process.\\n\\n6. Automatic parameter passing: When Claude decides to use a tool, Claudette automatically calls the tool with the provided parameters.\\n\\n7. System prompt integration: It allows setting a system prompt to guide Claude's behavior when using tools, such as instructing it not to mention the tools it's using.\\n\\nThese features significantly reduce the amount of code and manual handling required to use Claude's tool use capabilities, making the process more streamlined and developer-friendly.\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 233, 'output_tokens': 331, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 7171}`\n",
+ "- usage: `{'input_tokens': 240, 'output_tokens': 289, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 7171}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_013EXbQe1Pcbg1duhRKPb2y8', content=[TextBlock(text=\"Claudette makes tool use more ergonomic in several ways:\\n\\n1. Simplified tool definition: It uses docments (a feature from fastcore) to make defining Python functions as tools more straightforward. Each parameter and return value should have a type and a description, making it easier to create well-documented tools.\\n\\n2. Automatic handling: When using tools, Claudette handles the back-and-forth between Claude and the tool automatically. You don't need to manually process Claude's tool use requests and feed the results back.\\n\\n3. Single-step execution: The `Chat.toolloop` method allows you to execute a series of tool calls in a single step. This can handle multiple tool calls as needed to solve a problem, without requiring manual intervention for each step.\\n\\n4. Trace functionality: You can pass a `trace_func` to see each response from Claude during the tool use process, which is helpful for debugging and understanding the AI's reasoning.\\n\\n5. Easy tool registration: Tools are simply passed as a list to the `Chat` constructor, making it easy to add or change available tools.\\n\\n6. Forced tool use: You can set `tool_choice` to force Claude to always use a specific tool, which can be useful in certain scenarios.\\n\\n7. Automatic token handling: Claudette keeps track of token usage, including the additional tokens used for tool-related system prompts.\\n\\nThese features significantly reduce the amount of code and manual steps needed to implement tool use with Claude, making the process more streamlined and developer-friendly.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 233; Out: 331; Cache create: 0; Cache read: 7171; Total: 7735)"
+ "Message(id='msg_01B4KHLHzM6MUnRgiB3tZ1m5', content=[TextBlock(text=\"Claudette makes tool use more ergonomic in several ways:\\n\\n1. Simplified function definition: It uses docments to make defining Python functions for tools as simple as possible. Each parameter and the return value should have a type and a description.\\n\\n2. Automatic handling: The `Chat` class can be initialized with a list of tools, and Claudette handles the back-and-forth between Claude and the tools automatically.\\n\\n3. Single-step execution: The `Chat.toolloop` method allows for executing a series of tool calls in a single step, even if multiple tools are needed to solve a problem.\\n\\n4. Forced tool use: You can set `tool_choice` to force Claude to always answer using a specific tool.\\n\\n5. Tracing: The `toolloop` method supports a `trace_func` parameter, allowing you to see each response from Claude during the process.\\n\\n6. Automatic parameter passing: When Claude decides to use a tool, Claudette automatically calls the tool with the provided parameters.\\n\\n7. System prompt integration: It allows setting a system prompt to guide Claude's behavior when using tools, such as instructing it not to mention the tools it's using.\\n\\nThese features significantly reduce the amount of code and manual handling required to use Claude's tool use capabilities, making the process more streamlined and developer-friendly.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 240; Out: 289; Cache create: 0; Cache read: 7171; Total: 7700)"
]
},
"execution_count": null,
@@ -637,7 +677,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "Usage(input_tokens=233, output_tokens=331, cache_creation_input_tokens=0, cache_read_input_tokens=7171)\n"
+ "Usage(input_tokens=240, output_tokens=289, cache_creation_input_tokens=0, cache_read_input_tokens=7171)\n"
]
}
],
@@ -654,7 +694,7 @@
{
"data": {
"text/plain": [
- "In: 237; Out: 546; Cache create: 0; Cache read: 14342; Total: 15125"
+ "In: 244; Out: 509; Cache create: 7171; Cache read: 7171; Total: 15095"
]
},
"execution_count": null,
@@ -791,12 +831,12 @@
{
"data": {
"text/markdown": [
- "ToolUseBlock(id='toolu_01C6G2iuLtBBftESiujKzXfx', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')\n",
+ "ToolUseBlock(id='toolu_01SCB8X3NpcucTBQcHCtRxuZ', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')\n",
"\n",
"\n",
"\n",
- "- id: `msg_01HPZwX3mQ7sMbjWUHEwgUsT`\n",
- "- content: `[{'id': 'toolu_01C6G2iuLtBBftESiujKzXfx', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`\n",
+ "- id: `msg_01J1fmKt3wwMVrbBxoZANA9X`\n",
+ "- content: `[{'id': 'toolu_01SCB8X3NpcucTBQcHCtRxuZ', 'input': {'a': 604542, 'b': 6458932}, 'name': 'sums', 'type': 'tool_use'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `tool_use`\n",
@@ -807,7 +847,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01HPZwX3mQ7sMbjWUHEwgUsT', content=[ToolUseBlock(id='toolu_01C6G2iuLtBBftESiujKzXfx', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 414; Out: 53; Total: 467)"
+ "Message(id='msg_01J1fmKt3wwMVrbBxoZANA9X', content=[ToolUseBlock(id='toolu_01SCB8X3NpcucTBQcHCtRxuZ', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 414; Out: 53; Cache create: 0; Cache read: 0; Total: 467)"
]
},
"execution_count": null,
@@ -841,7 +881,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01RNHxf1jXfS76h2UpF8RnZ2`\n",
+ "- id: `msg_01R4SGHWELZeSYkGyrK2A2Cn`\n",
"- content: `[{'text': 'The sum of 604542 and 6458932 is 7063474.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
@@ -853,7 +893,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01RNHxf1jXfS76h2UpF8RnZ2', content=[TextBlock(text='The sum of 604542 and 6458932 is 7063474.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 515; Out: 23; Total: 538)"
+ "Message(id='msg_01R4SGHWELZeSYkGyrK2A2Cn', content=[TextBlock(text='The sum of 604542 and 6458932 is 7063474.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 515; Out: 23; Cache create: 0; Cache read: 0; Total: 538)"
]
},
"execution_count": null,
@@ -882,7 +922,7 @@
{
"data": {
"text/plain": [
- "In: 929; Out: 76; Total: 1005"
+ "In: 929; Out: 76; Cache create: 0; Cache read: 0; Total: 1005"
]
},
"execution_count": null,
@@ -960,10 +1000,10 @@
"output_type": "stream",
"text": [
"Finding the sum of 604542 and 6458932\n",
- "Message(id='msg_01DgZ9Fcs6h8HB7qEaFkg3Ah', content=[TextBlock(text='Certainly! To calculate (604542+6458932)*2, we\\'ll need to use the available tools to perform the addition and multiplication operations. Let\\'s break it down step by step:\\n\\n1. First, we\\'ll add 604542 and 6458932 using the \"sums\" function.\\n2. Then, we\\'ll multiply the result by 2 using the \"mults\" function.\\n\\nLet\\'s start with the addition:', type='text'), ToolUseBlock(id='toolu_01XTMLyKo9Q6TX4SpCVmmUsP', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 538; Out: 168; Total: 706)\n",
+ "Message(id='msg_01BidPp2g3FuMLzFJd7jHDeb', content=[TextBlock(text='Certainly! To calculate (604542+6458932)*2, we\\'ll need to use the available tools to perform the addition and multiplication operations. Let\\'s break it down step by step:\\n\\n1. First, we\\'ll add 604542 and 6458932 using the \"sums\" function.\\n2. Then, we\\'ll multiply the result by 2 using the \"mults\" function.\\n\\nLet\\'s start with the addition:', type='text'), ToolUseBlock(id='toolu_017v8XraNE8sEaErP3SqwWw2', input={'a': 604542, 'b': 6458932}, name='sums', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 538; Out: 168; Cache create: 0; Cache read: 0; Total: 706)\n",
"Finding the product of 7063474 and 2\n",
- "Message(id='msg_011P8jdxwLoKNf8nTDua7VM8', content=[TextBlock(text=\"Great! The sum of 604542 and 6458932 is 7063474.\\n\\nNow, let's multiply this result by 2:\", type='text'), ToolUseBlock(id='toolu_01FETWkj4a9HyX25c8ETULYh', input={'a': 7063474, 'b': 2}, name='mults', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 721; Out: 106; Total: 827)\n",
- "Message(id='msg_01UXwy69vUWSy9bK24skQ3yE', content=[TextBlock(text='Now we have our final result. \\n\\nThe calculation (604542+6458932)*2 equals 14126948.\\n\\nTo break it down:\\n1. 604542 + 6458932 = 7063474\\n2. 7063474 * 2 = 14126948\\n\\nSo, the final answer to (604542+6458932)*2 is 14126948.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 841; Out: 95; Total: 936)\n"
+ "Message(id='msg_01XpkGk396hzw5zS8qfC6zb5', content=[TextBlock(text=\"Great! The sum of 604542 and 6458932 is 7063474.\\n\\nNow, let's multiply this result by 2:\", type='text'), ToolUseBlock(id='toolu_012R3kQMdwT75GtbzWjfXL3k', input={'a': 7063474, 'b': 2}, name='mults', type='tool_use')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='tool_use', stop_sequence=None, type='message', usage=In: 721; Out: 106; Cache create: 0; Cache read: 0; Total: 827)\n",
+ "Message(id='msg_018bqP3PhfdcP5N7KKyTSLzF', content=[TextBlock(text='Now we have our final result. \\n\\nThe calculation (604542+6458932)*2 equals 14126948.\\n\\nTo break it down:\\n1. 604542 + 6458932 = 7063474\\n2. 7063474 * 2 = 14126948\\n\\nSo, the final answer to (604542+6458932)*2 is 14126948.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 841; Out: 95; Cache create: 0; Cache read: 0; Total: 936)\n"
]
},
{
@@ -981,7 +1021,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01UXwy69vUWSy9bK24skQ3yE`\n",
+ "- id: `msg_018bqP3PhfdcP5N7KKyTSLzF`\n",
"- content: `[{'text': 'Now we have our final result. \\n\\nThe calculation (604542+6458932)*2 equals 14126948.\\n\\nTo break it down:\\n1. 604542 + 6458932 = 7063474\\n2. 7063474 * 2 = 14126948\\n\\nSo, the final answer to (604542+6458932)*2 is 14126948.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
@@ -993,7 +1033,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01UXwy69vUWSy9bK24skQ3yE', content=[TextBlock(text='Now we have our final result. \\n\\nThe calculation (604542+6458932)*2 equals 14126948.\\n\\nTo break it down:\\n1. 604542 + 6458932 = 7063474\\n2. 7063474 * 2 = 14126948\\n\\nSo, the final answer to (604542+6458932)*2 is 14126948.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 841; Out: 95; Total: 936)"
+ "Message(id='msg_018bqP3PhfdcP5N7KKyTSLzF', content=[TextBlock(text='Now we have our final result. \\n\\nThe calculation (604542+6458932)*2 equals 14126948.\\n\\nTo break it down:\\n1. 604542 + 6458932 = 7063474\\n2. 7063474 * 2 = 14126948\\n\\nSo, the final answer to (604542+6458932)*2 is 14126948.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 841; Out: 95; Cache create: 0; Cache read: 0; Total: 936)"
]
},
"execution_count": null,
@@ -1105,7 +1145,7 @@
"\n",
"\n",
"\n",
- "- id: `msg_01XtkdWMWHVppHqtiv7gdmtA`\n",
+ "- id: `msg_01Wq2UqWLrQhWmmcuS7Dd8aL`\n",
"- content: `[{'text': 'The flowers in this image are purple. They appear to be small, daisy-like flowers, possibly asters or some type of purple daisy, blooming in the background behind the adorable puppy in the foreground.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
@@ -1117,7 +1157,7 @@
" "
],
"text/plain": [
- "Message(id='msg_01XtkdWMWHVppHqtiv7gdmtA', content=[TextBlock(text='The flowers in this image are purple. They appear to be small, daisy-like flowers, possibly asters or some type of purple daisy, blooming in the background behind the adorable puppy in the foreground.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 110; Out: 50; Total: 160)"
+ "Message(id='msg_01Wq2UqWLrQhWmmcuS7Dd8aL', content=[TextBlock(text='The flowers in this image are purple. They appear to be small, daisy-like flowers, possibly asters or some type of purple daisy, blooming in the background behind the adorable puppy in the foreground.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 110; Out: 50; Cache create: 0; Cache read: 0; Total: 160)"
]
},
"execution_count": null,
@@ -1146,7 +1186,7 @@
{
"data": {
"text/plain": [
- "In: 110; Out: 50; Total: 160"
+ "In: 110; Out: 50; Cache create: 0; Cache read: 0; Total: 160"
]
},
"execution_count": null,
@@ -1175,27 +1215,29 @@
{
"data": {
"text/markdown": [
- "This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive eyes and a small black nose.\n",
+ "This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive dark eyes and a small black nose.\n",
+ "\n",
+ "The puppy is resting on a grassy surface, and behind it, you can see some purple flowers, which look like asters or michaelmas daisies. These flowers add a lovely splash of color to the background. There's also what seems to be a wooden structure or fence visible behind the puppy, giving the scene a rustic, garden-like feel.\n",
"\n",
- "The puppy is resting on a grassy surface, and behind it, you can see some purple flowers, likely asters or michaelmas daisies. These flowers provide a lovely contrast to the puppy's fur colors. In the background, there seems to be a wooden structure, possibly a fence or the side of a building, giving the scene a rustic, outdoor feel.\n",
+ "The composition of the image is quite charming, with the puppy as the main focus in the foreground and the natural elements providing a beautiful, colorful backdrop. The lighting appears soft, highlighting the puppy's fur and giving the whole image a warm, inviting atmosphere.\n",
"\n",
- "The composition of the image is quite charming, with the puppy as the main focus in the foreground and the flowers adding a soft, colorful backdrop. The lighting appears natural, highlighting the puppy's soft fur and the delicate petals of the flowers. Overall, it's a heartwarming scene that captures the innocence and cuteness of a young dog in a picturesque outdoor setting.\n",
+ "This kind of image would be perfect for a greeting card, calendar, or as a heartwarming pet portrait. It captures the innocence and cuteness of a young dog in a picturesque outdoor setting.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01Simo36wFes3M21SXZFGBT2`\n",
- "- content: `[{'text': \"This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive eyes and a small black nose.\\n\\nThe puppy is resting on a grassy surface, and behind it, you can see some purple flowers, likely asters or michaelmas daisies. These flowers provide a lovely contrast to the puppy's fur colors. In the background, there seems to be a wooden structure, possibly a fence or the side of a building, giving the scene a rustic, outdoor feel.\\n\\nThe composition of the image is quite charming, with the puppy as the main focus in the foreground and the flowers adding a soft, colorful backdrop. The lighting appears natural, highlighting the puppy's soft fur and the delicate petals of the flowers. Overall, it's a heartwarming scene that captures the innocence and cuteness of a young dog in a picturesque outdoor setting.\", 'type': 'text'}]`\n",
+ "- id: `msg_015NoQzCLM5ofbZTCxDPmWAT`\n",
+ "- content: `[{'text': \"This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive dark eyes and a small black nose.\\n\\nThe puppy is resting on a grassy surface, and behind it, you can see some purple flowers, which look like asters or michaelmas daisies. These flowers add a lovely splash of color to the background. There's also what seems to be a wooden structure or fence visible behind the puppy, giving the scene a rustic, garden-like feel.\\n\\nThe composition of the image is quite charming, with the puppy as the main focus in the foreground and the natural elements providing a beautiful, colorful backdrop. The lighting appears soft, highlighting the puppy's fur and giving the whole image a warm, inviting atmosphere.\\n\\nThis kind of image would be perfect for a greeting card, calendar, or as a heartwarming pet portrait. It captures the innocence and cuteness of a young dog in a picturesque outdoor setting.\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 98, 'output_tokens': 232, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 98, 'output_tokens': 248, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01Simo36wFes3M21SXZFGBT2', content=[TextBlock(text=\"This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive eyes and a small black nose.\\n\\nThe puppy is resting on a grassy surface, and behind it, you can see some purple flowers, likely asters or michaelmas daisies. These flowers provide a lovely contrast to the puppy's fur colors. In the background, there seems to be a wooden structure, possibly a fence or the side of a building, giving the scene a rustic, outdoor feel.\\n\\nThe composition of the image is quite charming, with the puppy as the main focus in the foreground and the flowers adding a soft, colorful backdrop. The lighting appears natural, highlighting the puppy's soft fur and the delicate petals of the flowers. Overall, it's a heartwarming scene that captures the innocence and cuteness of a young dog in a picturesque outdoor setting.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 98; Out: 232; Total: 330)"
+ "Message(id='msg_015NoQzCLM5ofbZTCxDPmWAT', content=[TextBlock(text=\"This image shows an adorable puppy lying in the grass. The puppy appears to be a Cavalier King Charles Spaniel or a similar breed, with distinctive white and reddish-brown fur coloring. Its face is predominantly white with large, expressive dark eyes and a small black nose.\\n\\nThe puppy is resting on a grassy surface, and behind it, you can see some purple flowers, which look like asters or michaelmas daisies. These flowers add a lovely splash of color to the background. There's also what seems to be a wooden structure or fence visible behind the puppy, giving the scene a rustic, garden-like feel.\\n\\nThe composition of the image is quite charming, with the puppy as the main focus in the foreground and the natural elements providing a beautiful, colorful backdrop. The lighting appears soft, highlighting the puppy's fur and giving the whole image a warm, inviting atmosphere.\\n\\nThis kind of image would be perfect for a greeting card, calendar, or as a heartwarming pet portrait. It captures the innocence and cuteness of a young dog in a picturesque outdoor setting.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 98; Out: 248; Cache create: 0; Cache read: 0; Total: 346)"
]
},
"execution_count": null,
@@ -1217,23 +1259,23 @@
{
"data": {
"text/markdown": [
- "The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, its nose, and part of its mouth. The puppy's body is angled diagonally, with its front paws visible and resting on the grass. This positioning gives the viewer a good look at the puppy's adorable facial features and the distinctive coloring of its fur, while also creating an engaging composition within the photograph.\n",
+ "The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, which are looking directly at the camera. The puppy's body is angled diagonally, with its front paws and chest visible as it rests on the grass. This positioning gives a good view of the puppy's facial features and part of its body, creating an engaging and endearing portrait of the young dog.\n",
"\n",
"\n",
"\n",
- "- id: `msg_019YhPzDxXXjrcpjaS6G8fmF`\n",
- "- content: `[{'text': \"The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, its nose, and part of its mouth. The puppy's body is angled diagonally, with its front paws visible and resting on the grass. This positioning gives the viewer a good look at the puppy's adorable facial features and the distinctive coloring of its fur, while also creating an engaging composition within the photograph.\", 'type': 'text'}]`\n",
+ "- id: `msg_018bjcun7oQyBLtn3eMi1nHU`\n",
+ "- content: `[{'text': \"The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, which are looking directly at the camera. The puppy's body is angled diagonally, with its front paws and chest visible as it rests on the grass. This positioning gives a good view of the puppy's facial features and part of its body, creating an engaging and endearing portrait of the young dog.\", 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 341, 'output_tokens': 108, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 357, 'output_tokens': 105, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_019YhPzDxXXjrcpjaS6G8fmF', content=[TextBlock(text=\"The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, its nose, and part of its mouth. The puppy's body is angled diagonally, with its front paws visible and resting on the grass. This positioning gives the viewer a good look at the puppy's adorable facial features and the distinctive coloring of its fur, while also creating an engaging composition within the photograph.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 341; Out: 108; Total: 449)"
+ "Message(id='msg_018bjcun7oQyBLtn3eMi1nHU', content=[TextBlock(text=\"The puppy in the image is facing towards the left side of the frame. Its head is turned slightly, allowing us to see most of its face, including both eyes, which are looking directly at the camera. The puppy's body is angled diagonally, with its front paws and chest visible as it rests on the grass. This positioning gives a good view of the puppy's facial features and part of its body, creating an engaging and endearing portrait of the young dog.\", type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 357; Out: 105; Cache create: 0; Cache read: 0; Total: 462)"
]
},
"execution_count": null,
@@ -1258,25 +1300,25 @@
"\n",
"1. White: The majority of its face, including the area around its eyes, muzzle, and part of its chest, is white.\n",
"\n",
- "2. Reddish-brown: This color, often referred to as \"chestnut\" or \"ruby\" in Cavalier King Charles Spaniels, covers the puppy's ears and extends to patches on its body.\n",
+ "2. Reddish-brown (often called \"ruby\" or \"chestnut\" in dog breed descriptions): This color appears on its ears and patches on its body.\n",
"\n",
- "The contrast between these two colors is quite striking and typical of the Cavalier King Charles Spaniel breed. The white fur appears bright and clean, while the reddish-brown areas have a rich, warm tone. This color combination, along with the puppy's expressive eyes and small black nose, contributes to its incredibly cute and appealing appearance.\n",
+ "This color combination is typical of Cavalier King Charles Spaniels, particularly the Blenheim variety, though without being able to see the full body, it's hard to confirm the exact breed. The contrast between the white and reddish-brown fur creates a striking and adorable appearance for the puppy.\n",
"\n",
"\n",
"\n",
- "- id: `msg_01WVxHA2sAff5q1En3q9km8F`\n",
- "- content: `[{'text': 'The puppy in the image has a combination of two main colors:\\n\\n1. White: The majority of its face, including the area around its eyes, muzzle, and part of its chest, is white.\\n\\n2. Reddish-brown: This color, often referred to as \"chestnut\" or \"ruby\" in Cavalier King Charles Spaniels, covers the puppy\\'s ears and extends to patches on its body.\\n\\nThe contrast between these two colors is quite striking and typical of the Cavalier King Charles Spaniel breed. The white fur appears bright and clean, while the reddish-brown areas have a rich, warm tone. This color combination, along with the puppy\\'s expressive eyes and small black nose, contributes to its incredibly cute and appealing appearance.', 'type': 'text'}]`\n",
+ "- id: `msg_01T4JvKPNT9a9iWXachmszAU`\n",
+ "- content: `[{'text': 'The puppy in the image has a combination of two main colors:\\n\\n1. White: The majority of its face, including the area around its eyes, muzzle, and part of its chest, is white.\\n\\n2. Reddish-brown (often called \"ruby\" or \"chestnut\" in dog breed descriptions): This color appears on its ears and patches on its body.\\n\\nThis color combination is typical of Cavalier King Charles Spaniels, particularly the Blenheim variety, though without being able to see the full body, it\\'s hard to confirm the exact breed. The contrast between the white and reddish-brown fur creates a striking and adorable appearance for the puppy.', 'type': 'text'}]`\n",
"- model: `claude-3-5-sonnet-20240620`\n",
"- role: `assistant`\n",
"- stop_reason: `end_turn`\n",
"- stop_sequence: `None`\n",
"- type: `message`\n",
- "- usage: `{'input_tokens': 457, 'output_tokens': 175, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
+ "- usage: `{'input_tokens': 470, 'output_tokens': 154, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 0}`\n",
"\n",
" "
],
"text/plain": [
- "Message(id='msg_01WVxHA2sAff5q1En3q9km8F', content=[TextBlock(text='The puppy in the image has a combination of two main colors:\\n\\n1. White: The majority of its face, including the area around its eyes, muzzle, and part of its chest, is white.\\n\\n2. Reddish-brown: This color, often referred to as \"chestnut\" or \"ruby\" in Cavalier King Charles Spaniels, covers the puppy\\'s ears and extends to patches on its body.\\n\\nThe contrast between these two colors is quite striking and typical of the Cavalier King Charles Spaniel breed. The white fur appears bright and clean, while the reddish-brown areas have a rich, warm tone. This color combination, along with the puppy\\'s expressive eyes and small black nose, contributes to its incredibly cute and appealing appearance.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 457; Out: 175; Total: 632)"
+ "Message(id='msg_01T4JvKPNT9a9iWXachmszAU', content=[TextBlock(text='The puppy in the image has a combination of two main colors:\\n\\n1. White: The majority of its face, including the area around its eyes, muzzle, and part of its chest, is white.\\n\\n2. Reddish-brown (often called \"ruby\" or \"chestnut\" in dog breed descriptions): This color appears on its ears and patches on its body.\\n\\nThis color combination is typical of Cavalier King Charles Spaniels, particularly the Blenheim variety, though without being able to see the full body, it\\'s hard to confirm the exact breed. The contrast between the white and reddish-brown fur creates a striking and adorable appearance for the puppy.', type='text')], model='claude-3-5-sonnet-20240620', role='assistant', stop_reason='end_turn', stop_sequence=None, type='message', usage=In: 470; Out: 154; Cache create: 0; Cache read: 0; Total: 624)"
]
},
"execution_count": null,
@@ -1305,7 +1347,7 @@
{
"data": {
"text/plain": [
- "In: 896; Out: 515; Total: 1411"
+ "In: 925; Out: 507; Cache create: 0; Cache read: 0; Total: 1432"
]
},
"execution_count": null,