|
2 | 2 |
|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
| 5 | +from . import ( |
| 6 | + agents, |
| 7 | + models, |
| 8 | + api_agent, |
| 9 | + api_workspace, |
| 10 | + agent_create_response, |
| 11 | + agent_delete_response, |
| 12 | + agent_update_response, |
| 13 | + agent_retrieve_response, |
| 14 | + agent_update_status_response, |
| 15 | +) |
| 16 | +from .. import _compat |
5 | 17 | from .shared import ( |
6 | 18 | Size as Size, |
7 | 19 | Image as Image, |
|
80 | 92 | from .gpu_droplet_list_firewalls_response import GPUDropletListFirewallsResponse as GPUDropletListFirewallsResponse |
81 | 93 | from .gpu_droplet_list_neighbors_response import GPUDropletListNeighborsResponse as GPUDropletListNeighborsResponse |
82 | 94 | from .gpu_droplet_list_snapshots_response import GPUDropletListSnapshotsResponse as GPUDropletListSnapshotsResponse |
| 95 | + |
| 96 | +# Rebuild cyclical models only after all modules are imported. |
| 97 | +# This ensures that, when building the deferred (due to cyclical references) model schema, |
| 98 | +# Pydantic can resolve the necessary references. |
| 99 | +# See: https://github.com/pydantic/pydantic/issues/11250 for more context. |
| 100 | +if _compat.PYDANTIC_V2: |
| 101 | + api_agent.APIAgent.model_rebuild(_parent_namespace_depth=0) |
| 102 | + api_workspace.APIWorkspace.model_rebuild(_parent_namespace_depth=0) |
| 103 | + agent_create_response.AgentCreateResponse.model_rebuild(_parent_namespace_depth=0) |
| 104 | + agent_retrieve_response.AgentRetrieveResponse.model_rebuild(_parent_namespace_depth=0) |
| 105 | + agent_update_response.AgentUpdateResponse.model_rebuild(_parent_namespace_depth=0) |
| 106 | + agent_delete_response.AgentDeleteResponse.model_rebuild(_parent_namespace_depth=0) |
| 107 | + agent_update_status_response.AgentUpdateStatusResponse.model_rebuild(_parent_namespace_depth=0) |
| 108 | + agents.evaluation_metrics.workspace_create_response.WorkspaceCreateResponse.model_rebuild(_parent_namespace_depth=0) |
| 109 | + agents.evaluation_metrics.workspace_retrieve_response.WorkspaceRetrieveResponse.model_rebuild( |
| 110 | + _parent_namespace_depth=0 |
| 111 | + ) |
| 112 | + agents.evaluation_metrics.workspace_update_response.WorkspaceUpdateResponse.model_rebuild(_parent_namespace_depth=0) |
| 113 | + agents.evaluation_metrics.workspace_list_response.WorkspaceListResponse.model_rebuild(_parent_namespace_depth=0) |
| 114 | + agents.evaluation_metrics.workspaces.agent_list_response.AgentListResponse.model_rebuild(_parent_namespace_depth=0) |
| 115 | + agents.evaluation_metrics.workspaces.agent_move_response.AgentMoveResponse.model_rebuild(_parent_namespace_depth=0) |
| 116 | + agents.function_create_response.FunctionCreateResponse.model_rebuild(_parent_namespace_depth=0) |
| 117 | + agents.function_update_response.FunctionUpdateResponse.model_rebuild(_parent_namespace_depth=0) |
| 118 | + agents.function_delete_response.FunctionDeleteResponse.model_rebuild(_parent_namespace_depth=0) |
| 119 | + agents.api_link_knowledge_base_output.APILinkKnowledgeBaseOutput.model_rebuild(_parent_namespace_depth=0) |
| 120 | + agents.knowledge_base_detach_response.KnowledgeBaseDetachResponse.model_rebuild(_parent_namespace_depth=0) |
| 121 | + agents.route_view_response.RouteViewResponse.model_rebuild(_parent_namespace_depth=0) |
| 122 | + models.providers.anthropic_list_agents_response.AnthropicListAgentsResponse.model_rebuild(_parent_namespace_depth=0) |
| 123 | + models.providers.openai_retrieve_agents_response.OpenAIRetrieveAgentsResponse.model_rebuild( |
| 124 | + _parent_namespace_depth=0 |
| 125 | + ) |
| 126 | +else: |
| 127 | + api_agent.APIAgent.update_forward_refs() # type: ignore |
| 128 | + api_workspace.APIWorkspace.update_forward_refs() # type: ignore |
| 129 | + agent_create_response.AgentCreateResponse.update_forward_refs() # type: ignore |
| 130 | + agent_retrieve_response.AgentRetrieveResponse.update_forward_refs() # type: ignore |
| 131 | + agent_update_response.AgentUpdateResponse.update_forward_refs() # type: ignore |
| 132 | + agent_delete_response.AgentDeleteResponse.update_forward_refs() # type: ignore |
| 133 | + agent_update_status_response.AgentUpdateStatusResponse.update_forward_refs() # type: ignore |
| 134 | + agents.evaluation_metrics.workspace_create_response.WorkspaceCreateResponse.update_forward_refs() # type: ignore |
| 135 | + agents.evaluation_metrics.workspace_retrieve_response.WorkspaceRetrieveResponse.update_forward_refs() # type: ignore |
| 136 | + agents.evaluation_metrics.workspace_update_response.WorkspaceUpdateResponse.update_forward_refs() # type: ignore |
| 137 | + agents.evaluation_metrics.workspace_list_response.WorkspaceListResponse.update_forward_refs() # type: ignore |
| 138 | + agents.evaluation_metrics.workspaces.agent_list_response.AgentListResponse.update_forward_refs() # type: ignore |
| 139 | + agents.evaluation_metrics.workspaces.agent_move_response.AgentMoveResponse.update_forward_refs() # type: ignore |
| 140 | + agents.function_create_response.FunctionCreateResponse.update_forward_refs() # type: ignore |
| 141 | + agents.function_update_response.FunctionUpdateResponse.update_forward_refs() # type: ignore |
| 142 | + agents.function_delete_response.FunctionDeleteResponse.update_forward_refs() # type: ignore |
| 143 | + agents.api_link_knowledge_base_output.APILinkKnowledgeBaseOutput.update_forward_refs() # type: ignore |
| 144 | + agents.knowledge_base_detach_response.KnowledgeBaseDetachResponse.update_forward_refs() # type: ignore |
| 145 | + agents.route_view_response.RouteViewResponse.update_forward_refs() # type: ignore |
| 146 | + models.providers.anthropic_list_agents_response.AnthropicListAgentsResponse.update_forward_refs() # type: ignore |
| 147 | + models.providers.openai_retrieve_agents_response.OpenAIRetrieveAgentsResponse.update_forward_refs() # type: ignore |
0 commit comments