DocUA commited on
Commit
71dc9f7
·
1 Parent(s): 86d1da5

test: Add script to verify Anthropic adaptive thinking and output effort parameters.

Browse files
Files changed (1) hide show
  1. test_adaptive.py +16 -0
test_adaptive.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import anthropic
3
+ client = anthropic.Anthropic()
4
+ for effort in ["low", "none", "high", "xhigh"]:
5
+ try:
6
+ client.messages.create(
7
+ model="claude-sonnet-4-6",
8
+ max_tokens=2000,
9
+ temperature=1,
10
+ messages=[{"role": "user", "content": "hi"}],
11
+ thinking={"type": "adaptive"},
12
+ output_config={"effort": effort}
13
+ )
14
+ print(f"SUCCESS effort: {effort}")
15
+ except Exception as e:
16
+ print(f"Error effort {effort}: {str(e)}")