-
Notifications
You must be signed in to change notification settings - Fork 15
[python] update anthropic llmobs tests for new cache ttl metrics #6480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
5c5ca69
dd9afe6
a33f54b
f557ccf
0bb83ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,8 @@ def test_create(self, test_agent: TestAgentAPI, test_client: FrameworkTestClient | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -124,6 +126,8 @@ def test_create_stream_method(self, test_agent: TestAgentAPI, test_client: Frame | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -181,6 +185,8 @@ def test_create_content_block(self, test_agent: TestAgentAPI, test_client: Frame | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -318,6 +324,8 @@ def test_create_multiple_system_prompts( | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -384,6 +392,8 @@ def test_create_with_tools(self, test_agent: TestAgentAPI, test_client: Framewor | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -501,6 +511,8 @@ def test_create_tool_result(self, test_agent: TestAgentAPI, test_client: Framewo | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -574,6 +586,8 @@ def test_create_redact_image_input( | |
| "total_tokens": mock.ANY, | ||
| "cache_read_input_tokens": mock.ANY, | ||
| "cache_write_input_tokens": mock.ANY, | ||
| "ephemeral_1h_input_tokens": mock.ANY, | ||
| "ephemeral_5m_input_tokens": mock.ANY, | ||
| }, | ||
| ) | ||
|
|
||
|
|
@@ -630,4 +644,5 @@ def test_create_prompt_caching( | |
| write_span_event, read_span_event = span_events | ||
|
|
||
| assert write_span_event["metrics"]["cache_write_input_tokens"] == 6163 | ||
| assert write_span_event["metrics"]["ephemeral_5m_input_tokens"] == 6163 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| assert read_span_event["metrics"]["cache_read_input_tokens"] == 6163 | ||
Uh oh!
There was an error while loading. Please reload this page.