On Mon, 01 Jun 2026 16:21:25 +0200
Thomas Monjalon <[email protected]> wrote:
> 01/06/2026 15:24, David Marchand:
> > + if args.auth == "auto":
> > + auth_method = detect_auth_method(args.provider)
> > + else:
> > + auth_method = args.auth
> > +
> > + if auth_method == "vertex":
> > + if not VERTEX_AI_AVAILABLE:
> > + error("Vertex AI support requires 'google-auth' library.
> > Install with: pip install google-auth")
> > + auth = "vertex"
> > + else:
> > + api_key = os.environ.get(config["env_var"])
> > + if not api_key:
> > + error(f"{config['env_var']} environment variable not set")
> > + auth = f"direct:{api_key}"
>
> Could we have such code in the common file?
Yes please add to devtools/ai/_common.py used by both review-doc and
review-patch