Spaces:
Running
Running
Download test_adaptive.py from Supreme-Court/LP_2-AI_Assistant: direct link, hf CLI and curl.
- Browser
- Download file 518 Bytes
-
https://huggingface.co/spaces/Supreme-Court/LP_2-AI_Assistant/resolve/main/test_adaptive.py
- Command line
-
hf download hf://spaces/Supreme-Court/LP_2-AI_Assistant/test_adaptive.py
-
curl -L -o test_adaptive.py https://huggingface.co/spaces/Supreme-Court/LP_2-AI_Assistant/resolve/main/test_adaptive.py
518 Bytes
| import os | |
| import anthropic | |
| client = anthropic.Anthropic() | |
| for effort in ["low", "none", "high", "xhigh"]: | |
| try: | |
| client.messages.create( | |
| model="claude-sonnet-4-6", | |
| max_tokens=2000, | |
| temperature=1, | |
| messages=[{"role": "user", "content": "hi"}], | |
| thinking={"type": "adaptive"}, | |
| output_config={"effort": effort} | |
| ) | |
| print(f"SUCCESS effort: {effort}") | |
| except Exception as e: | |
| print(f"Error effort {effort}: {str(e)}") | |