Webwright icon indicating copy to clipboard operation
Webwright copied to clipboard

Fails to run with only ANTHROPIC_API_KEY

Open leachuk opened this issue 6 months ago • 3 comments

Expected: From the README I'm expecting to only require either the ANTHROPIC or OPENAI api key Export credentials for the chosen backend (e.g. OPENAI_API_KEY or ANTHROPIC_API_KEY), then: to run this project.

Actual When running with only the ANTHROPIC_API_KEY I get an error in the outputs/default/demo_claude_

...
  File "~/projects/personal/webwright/Webwright/src/webwright/tools/image_qa.py", line 66, in _openai_config
    raise RuntimeError("Missing OPENAI_API_KEY.")
RuntimeError: Missing OPENAI_API_KEY.

Also, in the src/configs/base.yaml file i see the OPENAI_API_KEY is always required.

# Required env (provided by ~/cred.sh):
#   - OPENAI_API_KEY    (always — used by self_reflection and image_qa tools)
#   - ANTHROPIC_API_KEY (only when stacking model_claude.yaml)
#   - BROWSERBASE_API_KEY + BROWSERBASE_PROJECT_ID (only when browser_mode=browserbase)

Ideally I should not require a subscription to 2 AI providers. Please enable this to work with an ANTHROPIC api key only.

leachuk avatar May 26 '26 00:05 leachuk

Implemented in https://github.com/microsoft/Webwright/pull/5 — routed image_qa and self_reflection through the configured model so -c model_claude.yaml runs end-to-end with only ANTHROPIC_API_KEY set.

mvanhorn avatar May 26 '26 13:05 mvanhorn

Thanks for noting the issue! Fix was merged and refactored a bit in: #10

adamlu123 avatar May 27 '26 01:05 adamlu123

No problem. I've confirmed it's now working for me using only the ANTHROPIC_API_KEY.

Thank you.

leachuk avatar May 27 '26 02:05 leachuk