Skip to content

Commit 358dfa8

Browse files
authored
Merge pull request #34 from stainless-sdks/bbatha/formatting-cleanup
chore: whitespace cleanup
2 parents c0e30a3 + dd13d32 commit 358dfa8

File tree

2 files changed

+29
-87
lines changed

2 files changed

+29
-87
lines changed

src/do_gradientai/_client.py

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,7 @@ def default_headers(self) -> dict[str, str | Omit]:
307307

308308
@override
309309
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
310-
if (self.api_key or self.agent_key or self.inference_key) and headers.get(
311-
"Authorization"
312-
):
310+
if (self.api_key or self.agent_key or self.inference_key) and headers.get("Authorization"):
313311
return
314312
if isinstance(custom_headers.get("Authorization"), Omit):
315313
return
@@ -339,14 +337,10 @@ def copy(
339337
Create a new client instance re-using the same options given to the current client with optional overriding.
340338
"""
341339
if default_headers is not None and set_default_headers is not None:
342-
raise ValueError(
343-
"The `default_headers` and `set_default_headers` arguments are mutually exclusive"
344-
)
340+
raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive")
345341

346342
if default_query is not None and set_default_query is not None:
347-
raise ValueError(
348-
"The `default_query` and `set_default_query` arguments are mutually exclusive"
349-
)
343+
raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive")
350344

351345
headers = self._custom_headers
352346
if default_headers is not None:
@@ -393,14 +387,10 @@ def _make_status_error(
393387
return _exceptions.BadRequestError(err_msg, response=response, body=body)
394388

395389
if response.status_code == 401:
396-
return _exceptions.AuthenticationError(
397-
err_msg, response=response, body=body
398-
)
390+
return _exceptions.AuthenticationError(err_msg, response=response, body=body)
399391

400392
if response.status_code == 403:
401-
return _exceptions.PermissionDeniedError(
402-
err_msg, response=response, body=body
403-
)
393+
return _exceptions.PermissionDeniedError(err_msg, response=response, body=body)
404394

405395
if response.status_code == 404:
406396
return _exceptions.NotFoundError(err_msg, response=response, body=body)
@@ -409,17 +399,13 @@ def _make_status_error(
409399
return _exceptions.ConflictError(err_msg, response=response, body=body)
410400

411401
if response.status_code == 422:
412-
return _exceptions.UnprocessableEntityError(
413-
err_msg, response=response, body=body
414-
)
402+
return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body)
415403

416404
if response.status_code == 429:
417405
return _exceptions.RateLimitError(err_msg, response=response, body=body)
418406

419407
if response.status_code >= 500:
420-
return _exceptions.InternalServerError(
421-
err_msg, response=response, body=body
422-
)
408+
return _exceptions.InternalServerError(err_msg, response=response, body=body)
423409
return APIStatusError(err_msg, response=response, body=body)
424410

425411

@@ -589,9 +575,7 @@ def default_headers(self) -> dict[str, str | Omit]:
589575

590576
@override
591577
def _validate_headers(self, headers: Headers, custom_headers: Headers) -> None:
592-
if (self.api_key or self.agent_key or self.inference_key) and headers.get(
593-
"Authorization"
594-
):
578+
if (self.api_key or self.agent_key or self.inference_key) and headers.get("Authorization"):
595579
return
596580
if isinstance(custom_headers.get("Authorization"), Omit):
597581
return
@@ -621,14 +605,10 @@ def copy(
621605
Create a new client instance re-using the same options given to the current client with optional overriding.
622606
"""
623607
if default_headers is not None and set_default_headers is not None:
624-
raise ValueError(
625-
"The `default_headers` and `set_default_headers` arguments are mutually exclusive"
626-
)
608+
raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive")
627609

628610
if default_query is not None and set_default_query is not None:
629-
raise ValueError(
630-
"The `default_query` and `set_default_query` arguments are mutually exclusive"
631-
)
611+
raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive")
632612

633613
headers = self._custom_headers
634614
if default_headers is not None:
@@ -675,14 +655,10 @@ def _make_status_error(
675655
return _exceptions.BadRequestError(err_msg, response=response, body=body)
676656

677657
if response.status_code == 401:
678-
return _exceptions.AuthenticationError(
679-
err_msg, response=response, body=body
680-
)
658+
return _exceptions.AuthenticationError(err_msg, response=response, body=body)
681659

682660
if response.status_code == 403:
683-
return _exceptions.PermissionDeniedError(
684-
err_msg, response=response, body=body
685-
)
661+
return _exceptions.PermissionDeniedError(err_msg, response=response, body=body)
686662

687663
if response.status_code == 404:
688664
return _exceptions.NotFoundError(err_msg, response=response, body=body)
@@ -691,17 +667,13 @@ def _make_status_error(
691667
return _exceptions.ConflictError(err_msg, response=response, body=body)
692668

693669
if response.status_code == 422:
694-
return _exceptions.UnprocessableEntityError(
695-
err_msg, response=response, body=body
696-
)
670+
return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body)
697671

698672
if response.status_code == 429:
699673
return _exceptions.RateLimitError(err_msg, response=response, body=body)
700674

701675
if response.status_code >= 500:
702-
return _exceptions.InternalServerError(
703-
err_msg, response=response, body=body
704-
)
676+
return _exceptions.InternalServerError(err_msg, response=response, body=body)
705677
return APIStatusError(err_msg, response=response, body=body)
706678

707679

@@ -920,9 +892,7 @@ def knowledge_bases(
920892
AsyncKnowledgeBasesResourceWithStreamingResponse,
921893
)
922894

923-
return AsyncKnowledgeBasesResourceWithStreamingResponse(
924-
self._client.knowledge_bases
925-
)
895+
return AsyncKnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases)
926896

927897
@cached_property
928898
def models(self) -> models.AsyncModelsResourceWithStreamingResponse:

src/do_gradientai/types/__init__.py

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -161,59 +161,31 @@
161161
api_agent.APIAgent.model_rebuild(_parent_namespace_depth=0)
162162
api_workspace.APIWorkspace.model_rebuild(_parent_namespace_depth=0)
163163
agent_create_response.AgentCreateResponse.model_rebuild(_parent_namespace_depth=0)
164-
agent_retrieve_response.AgentRetrieveResponse.model_rebuild(
165-
_parent_namespace_depth=0
166-
)
164+
agent_retrieve_response.AgentRetrieveResponse.model_rebuild(_parent_namespace_depth=0)
167165
agent_update_response.AgentUpdateResponse.model_rebuild(_parent_namespace_depth=0)
168166
agent_delete_response.AgentDeleteResponse.model_rebuild(_parent_namespace_depth=0)
169-
agent_update_status_response.AgentUpdateStatusResponse.model_rebuild(
170-
_parent_namespace_depth=0
171-
)
172-
agents.evaluation_metrics.workspace_create_response.WorkspaceCreateResponse.model_rebuild(
173-
_parent_namespace_depth=0
174-
)
167+
agent_update_status_response.AgentUpdateStatusResponse.model_rebuild(_parent_namespace_depth=0)
168+
agents.evaluation_metrics.workspace_create_response.WorkspaceCreateResponse.model_rebuild(_parent_namespace_depth=0)
175169
agents.evaluation_metrics.workspace_retrieve_response.WorkspaceRetrieveResponse.model_rebuild(
176170
_parent_namespace_depth=0
177171
)
178-
agents.evaluation_metrics.workspace_update_response.WorkspaceUpdateResponse.model_rebuild(
179-
_parent_namespace_depth=0
180-
)
181-
agents.evaluation_metrics.workspace_list_response.WorkspaceListResponse.model_rebuild(
182-
_parent_namespace_depth=0
183-
)
184-
agents.evaluation_metrics.workspaces.agent_list_response.AgentListResponse.model_rebuild(
185-
_parent_namespace_depth=0
186-
)
187-
agents.evaluation_metrics.workspaces.agent_move_response.AgentMoveResponse.model_rebuild(
188-
_parent_namespace_depth=0
189-
)
172+
agents.evaluation_metrics.workspace_update_response.WorkspaceUpdateResponse.model_rebuild(_parent_namespace_depth=0)
173+
agents.evaluation_metrics.workspace_list_response.WorkspaceListResponse.model_rebuild(_parent_namespace_depth=0)
174+
agents.evaluation_metrics.workspaces.agent_list_response.AgentListResponse.model_rebuild(_parent_namespace_depth=0)
175+
agents.evaluation_metrics.workspaces.agent_move_response.AgentMoveResponse.model_rebuild(_parent_namespace_depth=0)
190176
agents.evaluation_metrics.anthropic.key_list_agents_response.KeyListAgentsResponse.model_rebuild(
191177
_parent_namespace_depth=0
192178
)
193179
agents.evaluation_metrics.openai.key_list_agents_response.KeyListAgentsResponse.model_rebuild(
194180
_parent_namespace_depth=0
195181
)
196-
agents.function_create_response.FunctionCreateResponse.model_rebuild(
197-
_parent_namespace_depth=0
198-
)
199-
agents.function_update_response.FunctionUpdateResponse.model_rebuild(
200-
_parent_namespace_depth=0
201-
)
202-
agents.function_delete_response.FunctionDeleteResponse.model_rebuild(
203-
_parent_namespace_depth=0
204-
)
205-
agents.api_link_knowledge_base_output.APILinkKnowledgeBaseOutput.model_rebuild(
206-
_parent_namespace_depth=0
207-
)
208-
agents.knowledge_base_detach_response.KnowledgeBaseDetachResponse.model_rebuild(
209-
_parent_namespace_depth=0
210-
)
211-
agents.route_view_response.RouteViewResponse.model_rebuild(
212-
_parent_namespace_depth=0
213-
)
214-
models.providers.anthropic_list_agents_response.AnthropicListAgentsResponse.model_rebuild(
215-
_parent_namespace_depth=0
216-
)
182+
agents.function_create_response.FunctionCreateResponse.model_rebuild(_parent_namespace_depth=0)
183+
agents.function_update_response.FunctionUpdateResponse.model_rebuild(_parent_namespace_depth=0)
184+
agents.function_delete_response.FunctionDeleteResponse.model_rebuild(_parent_namespace_depth=0)
185+
agents.api_link_knowledge_base_output.APILinkKnowledgeBaseOutput.model_rebuild(_parent_namespace_depth=0)
186+
agents.knowledge_base_detach_response.KnowledgeBaseDetachResponse.model_rebuild(_parent_namespace_depth=0)
187+
agents.route_view_response.RouteViewResponse.model_rebuild(_parent_namespace_depth=0)
188+
models.providers.anthropic_list_agents_response.AnthropicListAgentsResponse.model_rebuild(_parent_namespace_depth=0)
217189
models.providers.openai_retrieve_agents_response.OpenAIRetrieveAgentsResponse.model_rebuild(
218190
_parent_namespace_depth=0
219191
)

0 commit comments

Comments
 (0)