File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
pydantic_ai_slim/pydantic_ai/models Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -610,13 +610,12 @@ def _prepare_betas_and_headers(
610610 extra_headers = model_settings .get ('extra_headers' , {})
611611 extra_headers .setdefault ('User-Agent' , get_user_agent ())
612612
613- if 'anthropic-beta' in extra_headers :
614- beta_value = extra_headers ['anthropic-beta' ]
615- for beta in beta_value .split (',' ):
616- beta_stripped = beta .strip ()
617- if beta_stripped : # pragma: no branch
618- betas .add (beta_stripped )
619- del extra_headers ['anthropic-beta' ]
613+ if beta_header := extra_headers .pop ('anthropic-beta' , None ):
614+ betas .update ({
615+ stripped_beta
616+ for beta in beta_header .split (',' )
617+ if (stripped_beta := beta .strip ())
618+ })
620619
621620 return sorted (betas ), extra_headers
622621
You can’t perform that action at this time.
0 commit comments