@@ -226,9 +226,7 @@ def default_headers(self) -> dict[str, str | Omit]:
226226
227227 @override
228228 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
229- if (self .api_key or self .agent_key or self .inference_key ) and headers .get (
230- "Authorization"
231- ):
229+ if (self .api_key or self .agent_key or self .inference_key ) and headers .get ("Authorization" ):
232230 return
233231 if isinstance (custom_headers .get ("Authorization" ), Omit ):
234232 return
@@ -258,14 +256,10 @@ def copy(
258256 Create a new client instance re-using the same options given to the current client with optional overriding.
259257 """
260258 if default_headers is not None and set_default_headers is not None :
261- raise ValueError (
262- "The `default_headers` and `set_default_headers` arguments are mutually exclusive"
263- )
259+ raise ValueError ("The `default_headers` and `set_default_headers` arguments are mutually exclusive" )
264260
265261 if default_query is not None and set_default_query is not None :
266- raise ValueError (
267- "The `default_query` and `set_default_query` arguments are mutually exclusive"
268- )
262+ raise ValueError ("The `default_query` and `set_default_query` arguments are mutually exclusive" )
269263
270264 headers = self ._custom_headers
271265 if default_headers is not None :
@@ -312,14 +306,10 @@ def _make_status_error(
312306 return _exceptions .BadRequestError (err_msg , response = response , body = body )
313307
314308 if response .status_code == 401 :
315- return _exceptions .AuthenticationError (
316- err_msg , response = response , body = body
317- )
309+ return _exceptions .AuthenticationError (err_msg , response = response , body = body )
318310
319311 if response .status_code == 403 :
320- return _exceptions .PermissionDeniedError (
321- err_msg , response = response , body = body
322- )
312+ return _exceptions .PermissionDeniedError (err_msg , response = response , body = body )
323313
324314 if response .status_code == 404 :
325315 return _exceptions .NotFoundError (err_msg , response = response , body = body )
@@ -328,17 +318,13 @@ def _make_status_error(
328318 return _exceptions .ConflictError (err_msg , response = response , body = body )
329319
330320 if response .status_code == 422 :
331- return _exceptions .UnprocessableEntityError (
332- err_msg , response = response , body = body
333- )
321+ return _exceptions .UnprocessableEntityError (err_msg , response = response , body = body )
334322
335323 if response .status_code == 429 :
336324 return _exceptions .RateLimitError (err_msg , response = response , body = body )
337325
338326 if response .status_code >= 500 :
339- return _exceptions .InternalServerError (
340- err_msg , response = response , body = body
341- )
327+ return _exceptions .InternalServerError (err_msg , response = response , body = body )
342328 return APIStatusError (err_msg , response = response , body = body )
343329
344330
@@ -508,9 +494,7 @@ def default_headers(self) -> dict[str, str | Omit]:
508494
509495 @override
510496 def _validate_headers (self , headers : Headers , custom_headers : Headers ) -> None :
511- if (self .api_key or self .agent_key or self .inference_key ) and headers .get (
512- "Authorization"
513- ):
497+ if (self .api_key or self .agent_key or self .inference_key ) and headers .get ("Authorization" ):
514498 return
515499 if isinstance (custom_headers .get ("Authorization" ), Omit ):
516500 return
@@ -540,14 +524,10 @@ def copy(
540524 Create a new client instance re-using the same options given to the current client with optional overriding.
541525 """
542526 if default_headers is not None and set_default_headers is not None :
543- raise ValueError (
544- "The `default_headers` and `set_default_headers` arguments are mutually exclusive"
545- )
527+ raise ValueError ("The `default_headers` and `set_default_headers` arguments are mutually exclusive" )
546528
547529 if default_query is not None and set_default_query is not None :
548- raise ValueError (
549- "The `default_query` and `set_default_query` arguments are mutually exclusive"
550- )
530+ raise ValueError ("The `default_query` and `set_default_query` arguments are mutually exclusive" )
551531
552532 headers = self ._custom_headers
553533 if default_headers is not None :
@@ -594,14 +574,10 @@ def _make_status_error(
594574 return _exceptions .BadRequestError (err_msg , response = response , body = body )
595575
596576 if response .status_code == 401 :
597- return _exceptions .AuthenticationError (
598- err_msg , response = response , body = body
599- )
577+ return _exceptions .AuthenticationError (err_msg , response = response , body = body )
600578
601579 if response .status_code == 403 :
602- return _exceptions .PermissionDeniedError (
603- err_msg , response = response , body = body
604- )
580+ return _exceptions .PermissionDeniedError (err_msg , response = response , body = body )
605581
606582 if response .status_code == 404 :
607583 return _exceptions .NotFoundError (err_msg , response = response , body = body )
@@ -610,17 +586,13 @@ def _make_status_error(
610586 return _exceptions .ConflictError (err_msg , response = response , body = body )
611587
612588 if response .status_code == 422 :
613- return _exceptions .UnprocessableEntityError (
614- err_msg , response = response , body = body
615- )
589+ return _exceptions .UnprocessableEntityError (err_msg , response = response , body = body )
616590
617591 if response .status_code == 429 :
618592 return _exceptions .RateLimitError (err_msg , response = response , body = body )
619593
620594 if response .status_code >= 500 :
621- return _exceptions .InternalServerError (
622- err_msg , response = response , body = body
623- )
595+ return _exceptions .InternalServerError (err_msg , response = response , body = body )
624596 return APIStatusError (err_msg , response = response , body = body )
625597
626598
@@ -839,9 +811,7 @@ def knowledge_bases(
839811 AsyncKnowledgeBasesResourceWithStreamingResponse ,
840812 )
841813
842- return AsyncKnowledgeBasesResourceWithStreamingResponse (
843- self ._client .knowledge_bases
844- )
814+ return AsyncKnowledgeBasesResourceWithStreamingResponse (self ._client .knowledge_bases )
845815
846816 @cached_property
847817 def models (self ) -> models .AsyncModelsResourceWithStreamingResponse :
0 commit comments