File size: 1,170 Bytes
4643f62 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """Check both ceiling models answer with the keys in .env. Costs a fraction of a cent."""
import anthropic
from dotenv import load_dotenv
from openai import OpenAI
import os
load_dotenv()
QUESTION = "Reply with exactly one line: 2026-01-10T12:00:00 in Etc/UTC converted to Asia/Tokyo, as YYYY-MM-DDTHH:MM:SS+HH:MM."
sonnet = anthropic.Anthropic().messages.create(
model="claude-sonnet-5-5",
max_tokens=1024,
thinking={"type": "between_tools"}, # Sonnet 5.5's thinking-off mode
messages=[{"role": "user", "content": QUESTION}],
)
print("sonnet :", sonnet.stop_reason, "|", next(b.text for b in sonnet.content if b.type == "text").strip())
mistral = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=os.environ["OPENROUTER_API_KEY"]).chat.completions.create(
model="mistralai/mistral-large-4-0",
temperature=0,
seed=7,
max_tokens=256,
extra_body={"reasoning": {"effort": "none"}}, # Mistral Large 4 reasons by default; off for a direct reply
messages=[{"role": "user", "content": QUESTION}],
)
print("mistral:", mistral.choices[0].finish_reason, "|", mistral.choices[0].message.content.strip())
|