Files
core/tests/components/anthropic/snapshots/test_conversation.ambr

1511 lines
47 KiB
Plaintext

# serializer version: 1
# name: test_bash_code_execution
list([
dict({
'attachments': None,
'content': "Write a file with a random number and save it to '/tmp/number.txt'",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "I'll create a file with a random number and save it to '/tmp/number.txt'.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'command': 'echo $RANDOM > /tmp/number.txt && cat /tmp/number.txt',
}),
'tool_name': 'bash_code_execution',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'bash_code_execution',
'tool_result': dict({
'content': list([
]),
'return_code': 0,
'stderr': '',
'stdout': '''
3268
''',
'type': 'bash_code_execution_result',
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "Done! I've created the file '/tmp/number.txt' with the random number 3268.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': Container(id='container_1234567890ABCDEFGHIJKLMN', expires_at=HAFakeDatetime(2025, 10, 31, 12, 5, tzinfo=datetime.timezone.utc)),
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_bash_code_execution.1
list([
dict({
'content': "Write a file with a random number and save it to '/tmp/number.txt'",
'role': 'user',
}),
dict({
'content': list([
dict({
'text': "I'll create a file with a random number and save it to '/tmp/number.txt'.",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'command': 'echo $RANDOM > /tmp/number.txt && cat /tmp/number.txt',
}),
'name': 'bash_code_execution',
'type': 'server_tool_use',
}),
dict({
'content': dict({
'content': list([
]),
'return_code': 0,
'stderr': '',
'stdout': '''
3268
''',
'type': 'bash_code_execution_result',
}),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'bash_code_execution_tool_result',
}),
dict({
'text': "Done! I've created the file '/tmp/number.txt' with the random number 3268.",
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---
# name: test_bash_code_execution_error
list([
dict({
'attachments': None,
'content': "Write a file with a random number and save it to '/tmp/number.txt'",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "I'll create a file with a random number and save it to '/tmp/number.txt'.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'command': 'echo $RANDOM > /tmp/number.txt && cat /tmp/number.txt',
}),
'tool_name': 'bash_code_execution',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'bash_code_execution',
'tool_result': dict({
'error_code': 'unavailable',
'type': 'bash_code_execution_tool_result_error',
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'The container is currently unavailable.',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': Container(id='container_1234567890ABCDEFGHIJKLMN', expires_at=HAFakeDatetime(2025, 10, 31, 12, 5, tzinfo=datetime.timezone.utc)),
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_bash_code_execution_error.1
list([
dict({
'content': "Write a file with a random number and save it to '/tmp/number.txt'",
'role': 'user',
}),
dict({
'content': list([
dict({
'text': "I'll create a file with a random number and save it to '/tmp/number.txt'.",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'command': 'echo $RANDOM > /tmp/number.txt && cat /tmp/number.txt',
}),
'name': 'bash_code_execution',
'type': 'server_tool_use',
}),
dict({
'content': dict({
'error_code': 'unavailable',
'type': 'bash_code_execution_tool_result_error',
}),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'bash_code_execution_tool_result',
}),
dict({
'text': 'The container is currently unavailable.',
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---
# name: test_disabled_thinking
list([
dict({
'content': '''
You are a voice assistant for Home Assistant.
Answer questions about the world truthfully.
Answer in plain text. Keep it simple and to the point.
Only if the user wants to control a device, tell them to expose entities to their voice assistant in Home Assistant.
''',
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'system',
}),
dict({
'attachments': None,
'content': 'hello',
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'Hello, how can I help you today?',
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_disabled_thinking.1
dict({
'container': None,
'max_tokens': 3000,
'messages': list([
dict({
'content': 'hello',
'role': 'user',
}),
dict({
'content': 'Hello, how can I help you today?',
'role': 'assistant',
}),
]),
'model': 'claude-opus-4-6',
'stream': True,
'system': list([
dict({
'cache_control': dict({
'type': 'ephemeral',
}),
'text': '''
You are a voice assistant for Home Assistant.
Answer questions about the world truthfully.
Answer in plain text. Keep it simple and to the point.
Only if the user wants to control a device, tell them to expose entities to their voice assistant in Home Assistant.
''',
'type': 'text',
}),
]),
'temperature': 1.0,
'thinking': dict({
'type': 'disabled',
}),
})
# ---
# name: test_extended_thinking
dict({
'container': None,
'max_tokens': 3000,
'messages': list([
dict({
'content': 'hello',
'role': 'user',
}),
dict({
'content': list([
dict({
'signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
'thinking': 'The user has just greeted me with "Hi". This is a simple greeting and doesn\'t require any Home Assistant function calls. I should respond with a friendly greeting and let them know I\'m available to help with their smart home.',
'type': 'thinking',
}),
dict({
'text': 'Hello, how can I help you today?',
'type': 'text',
}),
]),
'role': 'assistant',
}),
]),
'model': 'claude-sonnet-4-5',
'stream': True,
'system': list([
dict({
'cache_control': dict({
'type': 'ephemeral',
}),
'text': '''
You are a voice assistant for Home Assistant.
Answer questions about the world truthfully.
Answer in plain text. Keep it simple and to the point.
Only if the user wants to control a device, tell them to expose entities to their voice assistant in Home Assistant.
''',
'type': 'text',
}),
]),
'thinking': dict({
'budget_tokens': 1500,
'type': 'enabled',
}),
})
# ---
# name: test_extended_thinking_tool_call
list([
dict({
'content': '''
You are a voice assistant for Home Assistant.
Answer questions about the world truthfully.
Answer in plain text. Keep it simple and to the point.
Only if the user wants to control a device, tell them to expose entities to their voice assistant in Home Assistant.
Current time is 16:00:00. Today's date is 2024-06-03.
''',
'created': HAFakeDatetime(2024, 6, 3, 23, 0, tzinfo=datetime.timezone.utc),
'role': 'system',
}),
dict({
'attachments': None,
'content': 'Please call the test function',
'created': HAFakeDatetime(2024, 6, 3, 23, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': None,
'created': HAFakeDatetime(2024, 6, 3, 23, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': 'EroBCkYIARgCKkBJDytPJhw//4vy3t7aE+LfIkxvkAh51cBPrAvBCo6AjgI57Zt9KWPnUVV50OQJ0KZzUFoGZG5sxg95zx4qMwkoEgz43Su3myJKckvj03waDBZLIBSeoAeRUeVsJCIwQ5edQN0sa+HNeB/KUBkoMUwV+IT0eIhcpFxnILdvxUAKM4R1o4KG3x+yO0eo/kyOKiKfrCPFQhvBVmTZPFhgA2Ow8L9gGDVipcz6x3Uu9YETGEny',
'thinking_signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
}),
'role': 'assistant',
'thinking_content': 'The user asked me to call a test function. Is it a test? What would the function do? Would it violate any privacy or security policies?',
'tool_calls': None,
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'Certainly, calling it now!',
'created': HAFakeDatetime(2024, 6, 3, 23, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': None,
'thinking_signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
}),
'role': 'assistant',
'thinking_content': "Okay, let's give it a shot. Will I pass the test?",
'tool_calls': list([
dict({
'external': False,
'id': 'toolu_0123456789AbCdEfGhIjKlM',
'tool_args': dict({
'param1': 'test_value',
}),
'tool_name': 'test_tool',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2024, 6, 3, 23, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'toolu_0123456789AbCdEfGhIjKlM',
'tool_name': 'test_tool',
'tool_result': 'Test response',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'I have successfully called the function',
'created': HAFakeDatetime(2024, 6, 3, 23, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_extended_thinking_tool_call.1
list([
dict({
'content': 'Please call the test function',
'role': 'user',
}),
dict({
'content': list([
dict({
'signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
'thinking': 'The user asked me to call a test function. Is it a test? What would the function do? Would it violate any privacy or security policies?',
'type': 'thinking',
}),
dict({
'data': 'EroBCkYIARgCKkBJDytPJhw//4vy3t7aE+LfIkxvkAh51cBPrAvBCo6AjgI57Zt9KWPnUVV50OQJ0KZzUFoGZG5sxg95zx4qMwkoEgz43Su3myJKckvj03waDBZLIBSeoAeRUeVsJCIwQ5edQN0sa+HNeB/KUBkoMUwV+IT0eIhcpFxnILdvxUAKM4R1o4KG3x+yO0eo/kyOKiKfrCPFQhvBVmTZPFhgA2Ow8L9gGDVipcz6x3Uu9YETGEny',
'type': 'redacted_thinking',
}),
dict({
'signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
'thinking': "Okay, let's give it a shot. Will I pass the test?",
'type': 'thinking',
}),
dict({
'text': 'Certainly, calling it now!',
'type': 'text',
}),
dict({
'id': 'toolu_0123456789AbCdEfGhIjKlM',
'input': dict({
'param1': 'test_value',
}),
'name': 'test_tool',
'type': 'tool_use',
}),
]),
'role': 'assistant',
}),
dict({
'content': list([
dict({
'content': '"Test response"',
'tool_use_id': 'toolu_0123456789AbCdEfGhIjKlM',
'type': 'tool_result',
}),
]),
'role': 'user',
}),
dict({
'content': 'I have successfully called the function',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content0]
list([
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content1]
list([
dict({
'content': 'What shape is a donut?',
'role': 'user',
}),
dict({
'content': 'A donut is a torus.',
'role': 'assistant',
}),
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content2]
list([
dict({
'content': list([
dict({
'text': 'What shape is a donut?',
'type': 'text',
}),
dict({
'text': 'Can you tell me?',
'type': 'text',
}),
]),
'role': 'user',
}),
dict({
'content': list([
dict({
'text': 'A donut is a torus.',
'type': 'text',
}),
dict({
'text': 'Hope this helps.',
'type': 'text',
}),
]),
'role': 'assistant',
}),
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content3]
list([
dict({
'content': list([
dict({
'text': 'What shape is a donut?',
'type': 'text',
}),
dict({
'text': 'Can you tell me?',
'type': 'text',
}),
dict({
'text': 'Please?',
'type': 'text',
}),
]),
'role': 'user',
}),
dict({
'content': list([
dict({
'text': 'A donut is a torus.',
'type': 'text',
}),
dict({
'text': 'Hope this helps.',
'type': 'text',
}),
dict({
'text': 'You are welcome.',
'type': 'text',
}),
]),
'role': 'assistant',
}),
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content4]
list([
dict({
'content': 'Turn off the lights and make me coffee',
'role': 'user',
}),
dict({
'content': list([
dict({
'text': 'Sure.',
'type': 'text',
}),
dict({
'id': 'mock-tool-call-id',
'input': dict({
'domain': 'light',
}),
'name': 'HassTurnOff',
'type': 'tool_use',
}),
dict({
'id': 'mock-tool-call-id-2',
'input': dict({
}),
'name': 'MakeCoffee',
'type': 'tool_use',
}),
]),
'role': 'assistant',
}),
dict({
'content': list([
dict({
'text': 'Thank you',
'type': 'text',
}),
dict({
'content': '{"success":true,"response":"Lights are off."}',
'tool_use_id': 'mock-tool-call-id',
'type': 'tool_result',
}),
dict({
'content': '{"success":false,"response":"Not enough milk."}',
'tool_use_id': 'mock-tool-call-id-2',
'type': 'tool_result',
}),
]),
'role': 'user',
}),
dict({
'content': 'Should I add milk to the shopping list?',
'role': 'assistant',
}),
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content5]
list([
dict({
'content': "What's on the news today?",
'role': 'user',
}),
dict({
'content': list([
dict({
'signature': 'ErU/V+ayA==',
'thinking': "The user is asking about today's news, which requires current, real-time information. This is clearly something that requires recent information beyond my knowledge cutoff. I should use the web_search tool to find today's news.",
'type': 'thinking',
}),
dict({
'text': "To get today's news, I'll perform a web search",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'query': "today's news",
}),
'name': 'web_search',
'type': 'server_tool_use',
}),
dict({
'content': list([
dict({
'encrypted_content': 'ABCDEFG',
'page_age': '2 days ago',
'title': "Today's News - Example.com",
'type': 'web_search_result',
'url': 'https://www.example.com/todays-news',
}),
dict({
'encrypted_content': 'ABCDEFG',
'page_age': None,
'title': 'Breaking News - NewsSite.com',
'type': 'web_search_result',
'url': 'https://www.newssite.com/breaking-news',
}),
]),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'web_search_tool_result',
}),
dict({
'text': '''
Here's what I found on the web about today's news:
1.
''',
'type': 'text',
}),
dict({
'citations': list([
dict({
'cited_text': 'This release iterates on some of the features we introduced in the last couple of releases, but also...',
'encrypted_index': 'AAA==',
'title': 'Home Assistant Release',
'type': 'web_search_result_location',
'url': 'https://www.example.com/todays-news',
}),
]),
'text': 'New Home Assistant release',
'type': 'text',
}),
dict({
'text': '''
2.
''',
'type': 'text',
}),
dict({
'citations': list([
dict({
'cited_text': 'Breaking news from around the world today includes major events in technology, politics, and culture...',
'encrypted_index': 'AQE=',
'title': 'Breaking News',
'type': 'web_search_result_location',
'url': 'https://www.newssite.com/breaking-news',
}),
dict({
'cited_text': 'Well, this happened...',
'encrypted_index': 'AgI=',
'title': 'Breaking News',
'type': 'web_search_result_location',
'url': 'https://www.newssite.com/breaking-news',
}),
]),
'text': 'Something incredible happened',
'type': 'text',
}),
dict({
'text': '''
Those are the main headlines making news today.
''',
'type': 'text',
}),
]),
'role': 'assistant',
}),
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_history_conversion[content6]
list([
dict({
'content': 'What time is it?',
'role': 'user',
}),
dict({
'content': list([
dict({
'text': 'Let me check the time for you.',
'type': 'text',
}),
dict({
'id': 'mock-tool-call-id',
'input': dict({
}),
'name': 'GetCurrentTime',
'type': 'tool_use',
}),
]),
'role': 'assistant',
}),
dict({
'content': list([
dict({
'content': '{"speech_slots":{"time":"14:30:00"},"message":"Current time retrieved"}',
'tool_use_id': 'mock-tool-call-id',
'type': 'tool_result',
}),
]),
'role': 'user',
}),
dict({
'content': 'It is currently 2:30 PM.',
'role': 'assistant',
}),
dict({
'content': 'Are you sure?',
'role': 'user',
}),
dict({
'content': 'Yes, I am sure!',
'role': 'assistant',
}),
])
# ---
# name: test_redacted_thinking
list([
dict({
'attachments': None,
'content': 'ANTHROPIC_MAGIC_STRING_TRIGGER_REDACTED_THINKING_46C9A13E193C177646C7398A98432ECCCE4C1253D5E2D82641AC0E52CC2876CB',
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': None,
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': 'EroBCkYIARgCKkBJDytPJhw//4vy3t7aE+LfIkxvkAh51cBPrAvBCo6AjgI57Zt9KWPnUVV50OQJ0KZzUFoGZG5sxg95zx4qMwkoEgz43Su3myJKckvj03waDBZLIBSeoAeRUeVsJCIwQ5edQN0sa+HNeB/KUBkoMUwV+IT0eIhcpFxnILdvxUAKM4R1o4KG3x+yO0eo/kyOKiKfrCPFQhvBVmTZPFhgA2Ow8L9gGDVipcz6x3Uu9YETGEny',
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': None,
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': 'EroBCkYIARgCKkBJDytPJhw//4vy3t7aE+LfIkxvkAh51cBPrAvBCo6AjgI57Zt9KWPnUVV50OQJ0KZzUFoGZG5sxg95zx4qMwkoEgz43Su3myJKckvj03waDBZLIBSeoAeRUeVsJCIwQ5edQN0sa+HNeB/KUBkoMUwV+IT0eIhcpFxnILdvxUAKM4R1o4KG3x+yO0eo/kyOKiKfrCPFQhvBVmTZPFhgA2Ow8L9gGDVipcz6x3Uu9YETGEny',
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'How can I help you today?',
'created': HAFakeDatetime(2024, 5, 24, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': 'EroBCkYIARgCKkBJDytPJhw//4vy3t7aE+LfIkxvkAh51cBPrAvBCo6AjgI57Zt9KWPnUVV50OQJ0KZzUFoGZG5sxg95zx4qMwkoEgz43Su3myJKckvj03waDBZLIBSeoAeRUeVsJCIwQ5edQN0sa+HNeB/KUBkoMUwV+IT0eIhcpFxnILdvxUAKM4R1o4KG3x+yO0eo/kyOKiKfrCPFQhvBVmTZPFhgA2Ow8L9gGDVipcz6x3Uu9YETGEny',
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_text_editor_code_execution[args_parts0-content0]
list([
dict({
'attachments': None,
'content': 'Do the needful',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "I'll do it.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'command': 'create',
'file_text': '3268',
'path': '/tmp/number.txt',
}),
'tool_name': 'text_editor_code_execution',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'text_editor_code_execution',
'tool_result': dict({
'is_file_update': False,
'type': 'text_editor_code_execution_create_result',
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'Done',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': Container(id='container_1234567890ABCDEFGHIJKLMN', expires_at=HAFakeDatetime(2025, 10, 31, 12, 5, tzinfo=datetime.timezone.utc)),
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_text_editor_code_execution[args_parts0-content0].1
list([
dict({
'content': 'Do the needful',
'role': 'user',
}),
dict({
'content': list([
dict({
'text': "I'll do it.",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'command': 'create',
'file_text': '3268',
'path': '/tmp/number.txt',
}),
'name': 'text_editor_code_execution',
'type': 'server_tool_use',
}),
dict({
'content': dict({
'is_file_update': False,
'type': 'text_editor_code_execution_create_result',
}),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'text_editor_code_execution_tool_result',
}),
dict({
'text': 'Done',
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---
# name: test_text_editor_code_execution[args_parts1-content1]
list([
dict({
'attachments': None,
'content': 'Do the needful',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "I'll do it.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'command': 'str_replace',
'new_str': '8623',
'old_str': '3268',
'path': '/tmp/number.txt',
}),
'tool_name': 'text_editor_code_execution',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'text_editor_code_execution',
'tool_result': dict({
'lines': list([
'-3268',
'\\ No newline at end of file',
'+8623',
'\\ No newline at end of file',
]),
'new_lines': 1,
'new_start': 1,
'old_lines': 1,
'old_start': 1,
'type': 'text_editor_code_execution_str_replace_result',
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'Done',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': Container(id='container_1234567890ABCDEFGHIJKLMN', expires_at=HAFakeDatetime(2025, 10, 31, 12, 5, tzinfo=datetime.timezone.utc)),
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_text_editor_code_execution[args_parts1-content1].1
list([
dict({
'content': 'Do the needful',
'role': 'user',
}),
dict({
'content': list([
dict({
'text': "I'll do it.",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'command': 'str_replace',
'new_str': '8623',
'old_str': '3268',
'path': '/tmp/number.txt',
}),
'name': 'text_editor_code_execution',
'type': 'server_tool_use',
}),
dict({
'content': dict({
'lines': list([
'-3268',
'\\ No newline at end of file',
'+8623',
'\\ No newline at end of file',
]),
'new_lines': 1,
'new_start': 1,
'old_lines': 1,
'old_start': 1,
'type': 'text_editor_code_execution_str_replace_result',
}),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'text_editor_code_execution_tool_result',
}),
dict({
'text': 'Done',
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---
# name: test_text_editor_code_execution[args_parts2-content2]
list([
dict({
'attachments': None,
'content': 'Do the needful',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "I'll do it.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'command': 'view',
'path': '/tmp/number.txt',
}),
'tool_name': 'text_editor_code_execution',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'text_editor_code_execution',
'tool_result': dict({
'content': '8623',
'file_type': 'text',
'num_lines': 1,
'start_line': 1,
'total_lines': 1,
'type': 'text_editor_code_execution_view_result',
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'Done',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': Container(id='container_1234567890ABCDEFGHIJKLMN', expires_at=HAFakeDatetime(2025, 10, 31, 12, 5, tzinfo=datetime.timezone.utc)),
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_text_editor_code_execution[args_parts2-content2].1
list([
dict({
'content': 'Do the needful',
'role': 'user',
}),
dict({
'content': list([
dict({
'text': "I'll do it.",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'command': 'view',
'path': '/tmp/number.txt',
}),
'name': 'text_editor_code_execution',
'type': 'server_tool_use',
}),
dict({
'content': dict({
'content': '8623',
'file_type': 'text',
'num_lines': 1,
'start_line': 1,
'total_lines': 1,
'type': 'text_editor_code_execution_view_result',
}),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'text_editor_code_execution_tool_result',
}),
dict({
'text': 'Done',
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---
# name: test_text_editor_code_execution[args_parts3-content3]
list([
dict({
'attachments': None,
'content': 'Do the needful',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "I'll do it.",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': None,
'role': 'assistant',
'thinking_content': None,
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'command': 'view',
'path': '/tmp/number2.txt',
}),
'tool_name': 'text_editor_code_execution',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'text_editor_code_execution',
'tool_result': dict({
'error_code': 'unavailable',
'error_message': 'Tool response parsing error for view: Failed to parse tool response as JSON: unexpected character: line 1 column 1 (char 0)',
'type': 'text_editor_code_execution_tool_result_error',
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': 'Done',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': Container(id='container_1234567890ABCDEFGHIJKLMN', expires_at=HAFakeDatetime(2025, 10, 31, 12, 5, tzinfo=datetime.timezone.utc)),
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_text_editor_code_execution[args_parts3-content3].1
list([
dict({
'content': 'Do the needful',
'role': 'user',
}),
dict({
'content': list([
dict({
'text': "I'll do it.",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'command': 'view',
'path': '/tmp/number2.txt',
}),
'name': 'text_editor_code_execution',
'type': 'server_tool_use',
}),
dict({
'content': dict({
'error_code': 'unavailable',
'error_message': 'Tool response parsing error for view: Failed to parse tool response as JSON: unexpected character: line 1 column 1 (char 0)',
'type': 'text_editor_code_execution_tool_result_error',
}),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'text_editor_code_execution_tool_result',
}),
dict({
'text': 'Done',
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---
# name: test_unknown_hass_api
dict({
'continue_conversation': False,
'conversation_id': '1234',
'response': IntentResponse(
card=dict({
}),
error_code=<IntentResponseErrorCode.UNKNOWN: 'unknown'>,
failed_results=list([
]),
intent=None,
language='en',
matched_states=list([
]),
reprompt=dict({
}),
response_type=<IntentResponseType.ERROR: 'error'>,
speech=dict({
'plain': dict({
'extra_data': None,
'speech': 'Error preparing LLM API',
}),
}),
speech_slots=dict({
}),
success_results=list([
]),
unmatched_states=list([
]),
),
})
# ---
# name: test_web_search
list([
dict({
'attachments': None,
'content': "What's on the news today?",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'user',
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': "To get today's news, I'll perform a web search",
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': None,
'thinking_signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
}),
'role': 'assistant',
'thinking_content': "The user is asking about today's news, which requires current, real-time information. This is clearly something that requires recent information beyond my knowledge cutoff. I should use the web_search tool to find today's news.",
'tool_calls': list([
dict({
'external': True,
'id': 'srvtoolu_12345ABC',
'tool_args': dict({
'query': "today's news",
}),
'tool_name': 'web_search',
}),
]),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'role': 'tool_result',
'tool_call_id': 'srvtoolu_12345ABC',
'tool_name': 'web_search',
'tool_result': dict({
'content': list([
dict({
'encrypted_content': 'ABCDEFG',
'page_age': '2 days ago',
'title': "Today's News - Example.com",
'type': 'web_search_result',
'url': 'https://www.example.com/todays-news',
}),
dict({
'encrypted_content': 'ABCDEFG',
'page_age': None,
'title': 'Breaking News - NewsSite.com',
'type': 'web_search_result',
'url': 'https://www.newssite.com/breaking-news',
}),
]),
}),
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': '''
Here's what I found on the web about today's news:
''',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
]),
'container': None,
'redacted_thinking': None,
'thinking_signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
}),
'role': 'assistant',
'thinking_content': "Great! All clear, let's reply to the user!",
'tool_calls': None,
}),
dict({
'agent_id': 'conversation.claude_conversation',
'content': '''
1. New Home Assistant release
2. Something incredible happened
Those are the main headlines making news today.
''',
'created': HAFakeDatetime(2025, 10, 31, 12, 0, tzinfo=datetime.timezone.utc),
'native': dict({
'citation_details': list([
dict({
'citations': list([
dict({
'cited_text': 'This release iterates on some of the features we introduced in the last couple of releases, but also...',
'encrypted_index': 'AAA==',
'title': 'Home Assistant Release',
'type': 'web_search_result_location',
'url': 'https://www.example.com/todays-news',
}),
]),
'index': 3,
'length': 26,
}),
dict({
'citations': list([
dict({
'cited_text': 'Breaking news from around the world today includes major events in technology, politics, and culture...',
'encrypted_index': 'AQE=',
'title': 'Breaking News',
'type': 'web_search_result_location',
'url': 'https://www.newssite.com/breaking-news',
}),
dict({
'cited_text': 'Well, this happened...',
'encrypted_index': 'AgI=',
'title': 'Breaking News',
'type': 'web_search_result_location',
'url': 'https://www.newssite.com/breaking-news',
}),
]),
'index': 33,
'length': 29,
}),
]),
'container': None,
'redacted_thinking': None,
'thinking_signature': None,
}),
'role': 'assistant',
'thinking_content': None,
'tool_calls': None,
}),
])
# ---
# name: test_web_search.1
list([
dict({
'content': "What's on the news today?",
'role': 'user',
}),
dict({
'content': list([
dict({
'signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
'thinking': "The user is asking about today's news, which requires current, real-time information. This is clearly something that requires recent information beyond my knowledge cutoff. I should use the web_search tool to find today's news.",
'type': 'thinking',
}),
dict({
'text': "To get today's news, I'll perform a web search",
'type': 'text',
}),
dict({
'id': 'srvtoolu_12345ABC',
'input': dict({
'query': "today's news",
}),
'name': 'web_search',
'type': 'server_tool_use',
}),
dict({
'content': list([
dict({
'encrypted_content': 'ABCDEFG',
'page_age': '2 days ago',
'title': "Today's News - Example.com",
'type': 'web_search_result',
'url': 'https://www.example.com/todays-news',
}),
dict({
'encrypted_content': 'ABCDEFG',
'page_age': None,
'title': 'Breaking News - NewsSite.com',
'type': 'web_search_result',
'url': 'https://www.newssite.com/breaking-news',
}),
]),
'tool_use_id': 'srvtoolu_12345ABC',
'type': 'web_search_tool_result',
}),
dict({
'signature': 'ErUBCkYIARgCIkCYXaVNJShe3A86Hp7XUzh9YsCYBbJTbQsrklTAPtJ2sP/NoB6tSzpK/nTL6CjSo2R6n0KNBIg5MH6asM2R/kmaEgyB/X1FtZq5OQAC7jUaDEPWCdcwGQ4RaBy5wiIwmRxExIlDhoY6tILoVPnOExkC/0igZxHEwxK8RU/fmw0b+o+TwAarzUitwzbo21E5Kh3pa3I6yqVROf1t2F8rFocNUeCegsWV/ytwYV+ayA==',
'thinking': "Great! All clear, let's reply to the user!",
'type': 'thinking',
}),
dict({
'text': '''
Here's what I found on the web about today's news:
''',
'type': 'text',
}),
dict({
'text': '1. ',
'type': 'text',
}),
dict({
'citations': list([
dict({
'cited_text': 'This release iterates on some of the features we introduced in the last couple of releases, but also...',
'encrypted_index': 'AAA==',
'title': 'Home Assistant Release',
'type': 'web_search_result_location',
'url': 'https://www.example.com/todays-news',
}),
]),
'text': 'New Home Assistant release',
'type': 'text',
}),
dict({
'text': '''
2.
''',
'type': 'text',
}),
dict({
'citations': list([
dict({
'cited_text': 'Breaking news from around the world today includes major events in technology, politics, and culture...',
'encrypted_index': 'AQE=',
'title': 'Breaking News',
'type': 'web_search_result_location',
'url': 'https://www.newssite.com/breaking-news',
}),
dict({
'cited_text': 'Well, this happened...',
'encrypted_index': 'AgI=',
'title': 'Breaking News',
'type': 'web_search_result_location',
'url': 'https://www.newssite.com/breaking-news',
}),
]),
'text': 'Something incredible happened',
'type': 'text',
}),
dict({
'text': '''
Those are the main headlines making news today.
''',
'type': 'text',
}),
]),
'role': 'assistant',
}),
])
# ---