@@ -142,10 +142,7 @@ def __init__(
142142 self ._agent_endpoint = agent_endpoint
143143
144144 if inference_endpoint is None :
145- inference_endpoint = (
146- os .environ .get ("GRADIENT_INFERENCE_ENDPOINT" )
147- or "https://inference.do-ai.run"
148- )
145+ inference_endpoint = os .environ .get ("GRADIENT_INFERENCE_ENDPOINT" ) or "https://inference.do-ai.run"
149146 self .inference_endpoint = inference_endpoint
150147
151148 if kbass_endpoint is None :
@@ -302,9 +299,7 @@ def default_headers(self) -> dict[str, str | Omit]:
302299
303300 @override
304301 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
305- if (
306- self .access_token or self .agent_access_key or self .model_access_key
307- ) and headers .get ("Authorization" ):
302+ if (self .access_token or self .agent_access_key or self .model_access_key ) and headers .get ("Authorization" ):
308303 return
309304 if isinstance (custom_headers .get ("Authorization" ), Omit ):
310305 return
@@ -513,10 +508,7 @@ def __init__(
513508 self ._agent_endpoint = agent_endpoint
514509
515510 if inference_endpoint is None :
516- inference_endpoint = (
517- os .environ .get ("GRADIENT_INFERENCE_ENDPOINT" )
518- or "https://inference.do-ai.run"
519- )
511+ inference_endpoint = os .environ .get ("GRADIENT_INFERENCE_ENDPOINT" ) or "https://inference.do-ai.run"
520512 self .inference_endpoint = inference_endpoint
521513
522514 if kbass_endpoint is None :
@@ -673,9 +665,7 @@ def default_headers(self) -> dict[str, str | Omit]:
673665
674666 @override
675667 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
676- if (
677- self .access_token or self .agent_access_key or self .model_access_key
678- ) and headers .get ("Authorization" ):
668+ if (self .access_token or self .agent_access_key or self .model_access_key ) and headers .get ("Authorization" ):
679669 return
680670 if isinstance (custom_headers .get ("Authorization" ), Omit ):
681671 return
0 commit comments