Skip to content

Commit 8dbf721

Browse files
committed
snapshot
1 parent a2f1c8c commit 8dbf721

1 file changed

Lines changed: 49 additions & 55 deletions

File tree

tests/otel_integrations/test_anthropic_bedrock.py

Lines changed: 49 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ def test_sync_messages(mock_client: AnthropicBedrock, exporter: TestExporter):
8282
'code.filepath': 'test_anthropic_bedrock.py',
8383
'code.function': 'test_sync_messages',
8484
'code.lineno': 123,
85-
'request_data': (
86-
{
87-
'max_tokens': 1000,
88-
'system': 'You are a helpful assistant.',
89-
'messages': [{'role': 'user', 'content': 'What is four plus five?'}],
90-
'model': model_id,
91-
}
92-
),
85+
'request_data': {
86+
'max_tokens': 1000,
87+
'system': 'You are a helpful assistant.',
88+
'messages': [{'role': 'user', 'content': 'What is four plus five?'}],
89+
'model': model_id,
90+
},
91+
'gen_ai.system': 'anthropic',
9392
'gen_ai.provider.name': 'anthropic',
9493
'gen_ai.operation.name': 'chat',
9594
'gen_ai.request.model': model_id,
@@ -103,27 +102,23 @@ def test_sync_messages(mock_client: AnthropicBedrock, exporter: TestExporter):
103102
'logfire.msg': f"Message with '{model_id}'",
104103
'logfire.span_type': 'span',
105104
'logfire.tags': ('LLM',),
106-
'response_data': (
107-
snapshot(
105+
'response_data': {
106+
'message': {
107+
'content': 'Nine',
108+
'role': 'assistant',
109+
},
110+
'usage': IsPartialDict(
108111
{
109-
'message': {
110-
'content': 'Nine',
111-
'role': 'assistant',
112-
},
113-
'usage': IsPartialDict(
114-
{
115-
'cache_creation': None,
116-
'input_tokens': 2,
117-
'output_tokens': 3,
118-
'cache_creation_input_tokens': None,
119-
'cache_read_input_tokens': None,
120-
'server_tool_use': None,
121-
'service_tier': None,
122-
}
123-
),
112+
'cache_creation': None,
113+
'input_tokens': 2,
114+
'output_tokens': 3,
115+
'cache_creation_input_tokens': None,
116+
'cache_read_input_tokens': None,
117+
'server_tool_use': None,
118+
'service_tier': None,
124119
}
125-
)
126-
),
120+
),
121+
},
127122
'gen_ai.output.messages': [
128123
{
129124
'role': 'assistant',
@@ -136,37 +131,36 @@ def test_sync_messages(mock_client: AnthropicBedrock, exporter: TestExporter):
136131
'gen_ai.usage.input_tokens': 2,
137132
'gen_ai.usage.output_tokens': 3,
138133
'gen_ai.response.finish_reasons': ['end_turn'],
139-
'logfire.json_schema': (
140-
{
141-
'type': 'object',
142-
'properties': {
143-
'request_data': {'type': 'object'},
144-
'gen_ai.provider.name': {},
145-
'gen_ai.operation.name': {},
146-
'gen_ai.request.model': {},
147-
'gen_ai.request.max_tokens': {},
148-
'gen_ai.input.messages': {'type': 'array'},
149-
'gen_ai.system_instructions': {'type': 'array'},
150-
'async': {},
151-
'response_data': {
152-
'type': 'object',
153-
'properties': {
154-
'usage': {
155-
'type': 'object',
156-
'title': 'Usage',
157-
'x-python-datatype': 'PydanticModel',
158-
},
134+
'logfire.json_schema': {
135+
'type': 'object',
136+
'properties': {
137+
'request_data': {'type': 'object'},
138+
'gen_ai.system': {},
139+
'gen_ai.provider.name': {},
140+
'gen_ai.operation.name': {},
141+
'gen_ai.request.model': {},
142+
'gen_ai.request.max_tokens': {},
143+
'gen_ai.input.messages': {'type': 'array'},
144+
'gen_ai.system_instructions': {'type': 'array'},
145+
'async': {},
146+
'response_data': {
147+
'type': 'object',
148+
'properties': {
149+
'usage': {
150+
'type': 'object',
151+
'title': 'Usage',
152+
'x-python-datatype': 'PydanticModel',
159153
},
160154
},
161-
'gen_ai.output.messages': {'type': 'array'},
162-
'gen_ai.response.model': {},
163-
'gen_ai.response.id': {},
164-
'gen_ai.usage.input_tokens': {},
165-
'gen_ai.usage.output_tokens': {},
166-
'gen_ai.response.finish_reasons': {'type': 'array'},
167155
},
168-
}
169-
),
156+
'gen_ai.output.messages': {'type': 'array'},
157+
'gen_ai.response.model': {},
158+
'gen_ai.response.id': {},
159+
'gen_ai.usage.input_tokens': {},
160+
'gen_ai.usage.output_tokens': {},
161+
'gen_ai.response.finish_reasons': {'type': 'array'},
162+
},
163+
},
170164
},
171165
}
172166
]

0 commit comments

Comments
 (0)