Skip to content

Commit ed8c61e

Browse files
authored
Merge pull request #16 from braintrustdata/ark/add-cache-buster-uuid-to-anthropic-prompt-cache-tests
add cache buster to anthropic test for consistent results
2 parents 913ea40 + 23f397f commit ed8c61e

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

test/llm_span/anthropic/prompt_caching_1h.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: prompt_caching_1h
22
type: llm_span_test
3+
variables:
4+
# injected into sys prompt to guarantee cache misses
5+
# NOTE: this will not bust record+replay modes because vcr cassettes match by request body
6+
client: !gen test_runner_client
7+
vcr-nonce: !gen vcr_nonce
38
provider: anthropic
49
endpoint: /v1/messages
510
# The 1h TTL breakpoint currently requires this beta header. SDKs under test
@@ -17,6 +22,7 @@ requests:
1722
system:
1823
- type: text
1924
text: |
25+
[cache buster: {{client}} {{vcr-nonce}}]
2026
Reference material (stable, cached with a 1 hour TTL):
2127
2228
The following is a condensed atlas of capital cities. It does

test/llm_span/anthropic/prompt_caching_5m.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: prompt_caching_5m
22
type: llm_span_test
3+
variables:
4+
# injected into sys prompt to guarantee cache misses
5+
# NOTE: this will not bust record+replay modes because vcr cassettes match by request body
6+
client: !gen test_runner_client
7+
vcr-nonce: !gen vcr_nonce
38
provider: anthropic
49
endpoint: /v1/messages
510
# The default 5m TTL does not require any beta header. See
@@ -14,6 +19,7 @@ requests:
1419
system:
1520
- type: text
1621
text: |
22+
[cache buster: {{client}} {{vcr-nonce}}]
1723
You are a helpful assistant answering questions about world
1824
geography. Follow the operating guidelines below on every
1925
response. These guidelines are refreshed frequently, so they

0 commit comments

Comments
 (0)