diff --git a/sdk/ai/azure-ai-agents/apiview-properties.json b/sdk/ai/azure-ai-agents/apiview-properties.json index 7dde4c58f227..58d555082a72 100644 --- a/sdk/ai/azure-ai-agents/apiview-properties.json +++ b/sdk/ai/azure-ai-agents/apiview-properties.json @@ -6,8 +6,8 @@ "azure.ai.agents.models.AgentsResponseFormat": "Azure.AI.Agents.AgentsResponseFormat", "azure.ai.agents.models.AgentThread": "Azure.AI.Agents.AgentThread", "azure.ai.agents.models.AgentThreadCreationOptions": "Azure.AI.Agents.AgentThreadCreationOptions", - "azure.ai.agents.servicepatterns.models.AgentV1Error": "Azure.AI.Agents.ServicePatterns.AgentV1Error", - "azure.ai.agents.servicepatterns.models.AgentV1ErrorError": "Azure.AI.Agents.ServicePatterns.AgentV1Error.error.anonymous", + "azure.ai.agents.models.AgentV1Error": "Azure.AI.Agents.AgentV1Error", + "azure.ai.agents.models.AgentV1ErrorError": "Azure.AI.Agents.AgentV1Error.error.anonymous", "azure.ai.agents.models.AISearchIndexResource": "Azure.AI.Agents.AISearchIndexResource", "azure.ai.agents.models.ToolDefinition": "Azure.AI.Agents.ToolDefinition", "azure.ai.agents.models.AzureAISearchToolDefinition": "Azure.AI.Agents.AzureAISearchToolDefinition", @@ -17,7 +17,7 @@ "azure.ai.agents.models.AzureFunctionStorageQueue": "Azure.AI.Agents.AzureFunctionStorageQueue", "azure.ai.agents.models.AzureFunctionToolDefinition": "Azure.AI.Agents.AzureFunctionToolDefinition", "azure.ai.agents.models.BingGroundingSearchConfiguration": "Azure.AI.Agents.BingGroundingSearchConfiguration", - "azure.ai.agents.models.BingGroundingSearchConfigurationList": "Azure.AI.Agents.BingGroundingSearchConfigurationList", + "azure.ai.agents.models.BingGroundingSearchToolParameters": "Azure.AI.Agents.BingGroundingSearchToolParameters", "azure.ai.agents.models.BingGroundingToolDefinition": "Azure.AI.Agents.BingGroundingToolDefinition", "azure.ai.agents.models.CodeInterpreterToolDefinition": "Azure.AI.Agents.CodeInterpreterToolDefinition", "azure.ai.agents.models.CodeInterpreterToolResource": "Azure.AI.Agents.CodeInterpreterToolResource", diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/_client.py b/sdk/ai/azure-ai-agents/azure/ai/agents/_client.py index cc39890a202f..25ca9bf0d121 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/_client.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/_client.py @@ -27,7 +27,6 @@ VectorStoreFilesOperations, VectorStoresOperations, ) -from .servicepatterns.operations import ServicePatternsOperations if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -36,8 +35,6 @@ class AgentsClient(AgentsClientOperationsMixin): # pylint: disable=too-many-instance-attributes """AgentsClient. - :ivar service_patterns: ServicePatternsOperations operations - :vartype service_patterns: azure.ai.agents.operations.ServicePatternsOperations :ivar threads: ThreadsOperations operations :vartype threads: azure.ai.agents.operations.ThreadsOperations :ivar messages: MessagesOperations operations @@ -90,9 +87,6 @@ def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.service_patterns = ServicePatternsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.threads = ThreadsOperations(self._client, self._config, self._serialize, self._deserialize) self.messages = MessagesOperations(self._client, self._config, self._serialize, self._deserialize) self.runs = RunsOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/aio/_client.py b/sdk/ai/azure-ai-agents/azure/ai/agents/aio/_client.py index 171c2115d448..d228428d68e5 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/aio/_client.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/aio/_client.py @@ -15,7 +15,6 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._utils.serialization import Deserializer, Serializer -from ..servicepatterns.aio.operations import ServicePatternsOperations from ._configuration import AgentsClientConfiguration from .operations import ( AgentsClientOperationsMixin, @@ -36,8 +35,6 @@ class AgentsClient(AgentsClientOperationsMixin): # pylint: disable=too-many-instance-attributes """AgentsClient. - :ivar service_patterns: ServicePatternsOperations operations - :vartype service_patterns: azure.ai.agents.aio.operations.ServicePatternsOperations :ivar threads: ThreadsOperations operations :vartype threads: azure.ai.agents.aio.operations.ThreadsOperations :ivar messages: MessagesOperations operations @@ -91,9 +88,6 @@ def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: self._serialize = Serializer() self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.service_patterns = ServicePatternsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.threads = ThreadsOperations(self._client, self._config, self._serialize, self._deserialize) self.messages = MessagesOperations(self._client, self._config, self._serialize, self._deserialize) self.runs = RunsOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/_operations.py b/sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/_operations.py index bdd7fae379e3..2efc0ec13bfa 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/_operations.py @@ -43,7 +43,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._utils.utils import ClientMixinABC, prepare_multipart_form_data @@ -90,7 +90,6 @@ build_vector_stores_list_request, build_vector_stores_modify_request, ) -from ...servicepatterns import models as _servicepatterns_models1 from .._configuration import AgentsClientConfiguration if TYPE_CHECKING: @@ -123,11 +122,11 @@ async def create( self, *, content_type: str = "application/json", - messages: Optional[List[_models2.ThreadMessageOptions]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + messages: Optional[List[_models.ThreadMessageOptions]] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -153,9 +152,7 @@ async def create( """ @overload - async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.AgentThread: + async def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :param body: Required. @@ -171,7 +168,7 @@ async def create( @overload async def create( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :param body: Required. @@ -189,11 +186,11 @@ async def create( self, body: Union[JSON, IO[bytes]] = _Unset, *, - messages: Optional[List[_models2.ThreadMessageOptions]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + messages: Optional[List[_models.ThreadMessageOptions]] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -228,7 +225,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.AgentThread] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentThread] = kwargs.pop("cls", None) if body is _Unset: body = {"messages": messages, "metadata": metadata, "tool_resources": tool_resources} @@ -266,13 +263,13 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.AgentThread, response.json()) + deserialized = _deserialize(_models.AgentThread, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -284,10 +281,10 @@ def list( self, *, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.AgentThread"]: + ) -> AsyncIterable["_models.AgentThread"]: """Gets a list of threads that were previously created. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and @@ -308,7 +305,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.AgentThread]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentThread]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -337,7 +334,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.AgentThread], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.AgentThread], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -353,7 +350,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -361,7 +358,7 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get(self, thread_id: str, **kwargs: Any) -> _models2.AgentThread: + async def get(self, thread_id: str, **kwargs: Any) -> _models.AgentThread: """Gets information about an existing thread. :param thread_id: Identifier of the thread. Required. @@ -381,7 +378,7 @@ async def get(self, thread_id: str, **kwargs: Any) -> _models2.AgentThread: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.AgentThread] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentThread] = kwargs.pop("cls", None) _request = build_threads_get_request( thread_id=thread_id, @@ -408,13 +405,13 @@ async def get(self, thread_id: str, **kwargs: Any) -> _models2.AgentThread: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.AgentThread, response.json()) + deserialized = _deserialize(_models.AgentThread, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -427,10 +424,10 @@ async def update( thread_id: str, *, content_type: str = "application/json", - tool_resources: Optional[_models2.ToolResources] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -457,7 +454,7 @@ async def update( @overload async def update( self, thread_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -475,7 +472,7 @@ async def update( @overload async def update( self, thread_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -496,10 +493,10 @@ async def update( thread_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, - tool_resources: Optional[_models2.ToolResources] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -533,7 +530,7 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.AgentThread] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentThread] = kwargs.pop("cls", None) if body is _Unset: body = {"metadata": metadata, "tool_resources": tool_resources} @@ -572,13 +569,13 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.AgentThread, response.json()) + deserialized = _deserialize(_models.AgentThread, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -586,7 +583,7 @@ async def update( return deserialized # type: ignore @distributed_trace_async - async def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models2._models.ThreadDeletionStatus: + async def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models._models.ThreadDeletionStatus: """Deletes an existing thread. :param thread_id: Identifier of the thread. Required. @@ -606,7 +603,7 @@ async def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models2._model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2._models.ThreadDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ThreadDeletionStatus] = kwargs.pop("cls", None) _request = build_threads_delete_thread_request( thread_id=thread_id, @@ -633,14 +630,14 @@ async def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models2._model except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models2._models.ThreadDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.ThreadDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -671,13 +668,13 @@ async def create( self, thread_id: str, *, - role: Union[str, _models2.MessageRole], + role: Union[str, _models.MessageRole], content: "_types.MessageInputContent", content_type: str = "application/json", - attachments: Optional[List[_models2.MessageAttachment]] = None, + attachments: Optional[List[_models.MessageAttachment]] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -712,7 +709,7 @@ async def create( @overload async def create( self, thread_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -730,7 +727,7 @@ async def create( @overload async def create( self, thread_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -751,12 +748,12 @@ async def create( thread_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, - role: Union[str, _models2.MessageRole] = _Unset, + role: Union[str, _models.MessageRole] = _Unset, content: "_types.MessageInputContent" = _Unset, - attachments: Optional[List[_models2.MessageAttachment]] = None, + attachments: Optional[List[_models.MessageAttachment]] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -798,7 +795,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ThreadMessage] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadMessage] = kwargs.pop("cls", None) if body is _Unset: if role is _Unset: @@ -841,13 +838,13 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadMessage, response.json()) + deserialized = _deserialize(_models.ThreadMessage, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -861,10 +858,10 @@ def list( *, run_id: Optional[str] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.ThreadMessage"]: + ) -> AsyncIterable["_models.ThreadMessage"]: """Gets a list of messages that exist on a thread. :param thread_id: Identifier of the thread. Required. @@ -889,7 +886,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.ThreadMessage]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ThreadMessage]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -920,7 +917,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.ThreadMessage], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.ThreadMessage], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -943,7 +940,7 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models2.ThreadMessage: + async def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models.ThreadMessage: """Retrieves an existing message. :param thread_id: Identifier of the thread. Required. @@ -965,7 +962,7 @@ async def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models2. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.ThreadMessage] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadMessage] = kwargs.pop("cls", None) _request = build_messages_get_request( thread_id=thread_id, @@ -993,13 +990,13 @@ async def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models2. except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadMessage, response.json()) + deserialized = _deserialize(_models.ThreadMessage, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1015,7 +1012,7 @@ async def update( content_type: str = "application/json", metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1038,7 +1035,7 @@ async def update( @overload async def update( self, thread_id: str, message_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1058,7 +1055,7 @@ async def update( @overload async def update( self, thread_id: str, message_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1084,7 +1081,7 @@ async def update( *, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1114,7 +1111,7 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ThreadMessage] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadMessage] = kwargs.pop("cls", None) if body is _Unset: body = {"metadata": metadata} @@ -1154,13 +1151,13 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadMessage, response.json()) + deserialized = _deserialize(_models.ThreadMessage, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1191,25 +1188,25 @@ async def create( thread_id: str, *, agent_id: str, - include: Optional[List[Union[str, _models2.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, content_type: str = "application/json", model: Optional[str] = None, instructions: Optional[str] = None, additional_instructions: Optional[str] = None, - additional_messages: Optional[List[_models2.ThreadMessageOptions]] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, + additional_messages: Optional[List[_models.ThreadMessageOptions]] = None, + tools: Optional[List[_models.ToolDefinition]] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models2.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -1304,10 +1301,10 @@ async def create( thread_id: str, body: JSON, *, - include: Optional[List[Union[str, _models2.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -1333,10 +1330,10 @@ async def create( thread_id: str, body: IO[bytes], *, - include: Optional[List[Union[str, _models2.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -1363,24 +1360,24 @@ async def create( body: Union[JSON, IO[bytes]] = _Unset, *, agent_id: str = _Unset, - include: Optional[List[Union[str, _models2.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, model: Optional[str] = None, instructions: Optional[str] = None, additional_instructions: Optional[str] = None, - additional_messages: Optional[List[_models2.ThreadMessageOptions]] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, + additional_messages: Optional[List[_models.ThreadMessageOptions]] = None, + tools: Optional[List[_models.ToolDefinition]] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models2.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -1479,7 +1476,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: if agent_id is _Unset: @@ -1538,13 +1535,13 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1557,10 +1554,10 @@ def list( thread_id: str, *, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.ThreadRun"]: + ) -> AsyncIterable["_models.ThreadRun"]: """Gets a list of runs for a specified thread. :param thread_id: Identifier of the thread. Required. @@ -1583,7 +1580,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.ThreadRun]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ThreadRun]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1613,7 +1610,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.ThreadRun], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.ThreadRun], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -1629,7 +1626,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -1637,7 +1634,7 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models2.ThreadRun: + async def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models.ThreadRun: """Gets an existing run from an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1659,7 +1656,7 @@ async def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models2.Thre _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) _request = build_runs_get_request( thread_id=thread_id, @@ -1687,13 +1684,13 @@ async def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models2.Thre except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1709,7 +1706,7 @@ async def update( content_type: str = "application/json", metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -1732,7 +1729,7 @@ async def update( @overload async def update( self, thread_id: str, run_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -1752,7 +1749,7 @@ async def update( @overload async def update( self, thread_id: str, run_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -1778,7 +1775,7 @@ async def update( *, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -1808,7 +1805,7 @@ async def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: body = {"metadata": metadata} @@ -1848,13 +1845,13 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1867,11 +1864,11 @@ async def submit_tool_outputs( thread_id: str, run_id: str, *, - tool_outputs: List[_models2.ToolOutput], + tool_outputs: List[_models.ToolOutput], content_type: str = "application/json", stream_parameter: Optional[bool] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -1894,7 +1891,7 @@ async def submit_tool_outputs( @overload async def submit_tool_outputs( self, thread_id: str, run_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -1914,7 +1911,7 @@ async def submit_tool_outputs( @overload async def submit_tool_outputs( self, thread_id: str, run_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -1938,10 +1935,10 @@ async def submit_tool_outputs( run_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, - tool_outputs: List[_models2.ToolOutput] = _Unset, + tool_outputs: List[_models.ToolOutput] = _Unset, stream_parameter: Optional[bool] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -1971,7 +1968,7 @@ async def submit_tool_outputs( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: if tool_outputs is _Unset: @@ -2013,13 +2010,13 @@ async def submit_tool_outputs( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2027,7 +2024,7 @@ async def submit_tool_outputs( return deserialized # type: ignore @distributed_trace_async - async def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models2.ThreadRun: + async def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models.ThreadRun: """Cancels a run of an in‐progress thread. :param thread_id: Identifier of the thread. Required. @@ -2049,7 +2046,7 @@ async def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models2.T _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) _request = build_runs_cancel_request( thread_id=thread_id, @@ -2077,13 +2074,13 @@ async def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models2.T except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2115,9 +2112,9 @@ async def get( run_id: str, step_id: str, *, - include: Optional[List[Union[str, _models2.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, **kwargs: Any - ) -> _models2.RunStep: + ) -> _models.RunStep: """Retrieves a single run step from a thread run. :param thread_id: Identifier of the thread. Required. @@ -2146,7 +2143,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.RunStep] = kwargs.pop("cls", None) + cls: ClsType[_models.RunStep] = kwargs.pop("cls", None) _request = build_run_steps_get_request( thread_id=thread_id, @@ -2176,13 +2173,13 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.RunStep, response.json()) + deserialized = _deserialize(_models.RunStep, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2195,12 +2192,12 @@ def list( thread_id: str, run_id: str, *, - include: Optional[List[Union[str, _models2.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.RunStep"]: + ) -> AsyncIterable["_models.RunStep"]: """Gets a list of run steps from a thread run. :param thread_id: Identifier of the thread. Required. @@ -2230,7 +2227,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.RunStep]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RunStep]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2262,7 +2259,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.RunStep], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.RunStep], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -2278,7 +2275,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -2305,8 +2302,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list( - self, *, purpose: Optional[Union[str, _models2.FilePurpose]] = None, **kwargs: Any - ) -> _models2.FileListResponse: + self, *, purpose: Optional[Union[str, _models.FilePurpose]] = None, **kwargs: Any + ) -> _models.FileListResponse: """Gets a list of previously uploaded files. :keyword purpose: The purpose of the file. Known values are: "fine-tune", "fine-tune-results", @@ -2328,7 +2325,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.FileListResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.FileListResponse] = kwargs.pop("cls", None) _request = build_files_list_request( purpose=purpose, @@ -2355,13 +2352,13 @@ async def list( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.FileListResponse, response.json()) + deserialized = _deserialize(_models.FileListResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2369,14 +2366,14 @@ async def list( return deserialized # type: ignore @overload - async def _upload_file(self, body: _models2._models.UploadFileRequest, **kwargs: Any) -> _models2.FileInfo: ... + async def _upload_file(self, body: _models._models.UploadFileRequest, **kwargs: Any) -> _models.FileInfo: ... @overload - async def _upload_file(self, body: JSON, **kwargs: Any) -> _models2.FileInfo: ... + async def _upload_file(self, body: JSON, **kwargs: Any) -> _models.FileInfo: ... @distributed_trace_async async def _upload_file( - self, body: Union[_models2._models.UploadFileRequest, JSON], **kwargs: Any - ) -> _models2.FileInfo: + self, body: Union[_models._models.UploadFileRequest, JSON], **kwargs: Any + ) -> _models.FileInfo: """Uploads a file for use by other operations. :param body: Multipart body. Is either a UploadFileRequest type or a JSON type. Required. @@ -2396,7 +2393,7 @@ async def _upload_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.FileInfo] = kwargs.pop("cls", None) + cls: ClsType[_models.FileInfo] = kwargs.pop("cls", None) _body = body.as_dict() if isinstance(body, _Model) else body _file_fields: List[str] = ["file"] @@ -2429,13 +2426,13 @@ async def _upload_file( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.FileInfo, response.json()) + deserialized = _deserialize(_models.FileInfo, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2443,7 +2440,7 @@ async def _upload_file( return deserialized # type: ignore @distributed_trace_async - async def _delete_file(self, file_id: str, **kwargs: Any) -> _models2._models.FileDeletionStatus: + async def _delete_file(self, file_id: str, **kwargs: Any) -> _models._models.FileDeletionStatus: """Delete a previously uploaded file. :param file_id: The ID of the file to delete. Required. @@ -2463,7 +2460,7 @@ async def _delete_file(self, file_id: str, **kwargs: Any) -> _models2._models.Fi _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2._models.FileDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.FileDeletionStatus] = kwargs.pop("cls", None) _request = build_files_delete_file_request( file_id=file_id, @@ -2490,14 +2487,14 @@ async def _delete_file(self, file_id: str, **kwargs: Any) -> _models2._models.Fi except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models2._models.FileDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.FileDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -2506,7 +2503,7 @@ async def _delete_file(self, file_id: str, **kwargs: Any) -> _models2._models.Fi return deserialized # type: ignore @distributed_trace_async - async def get(self, file_id: str, **kwargs: Any) -> _models2.FileInfo: + async def get(self, file_id: str, **kwargs: Any) -> _models.FileInfo: """Returns information about a specific file. Does not retrieve file content. :param file_id: The ID of the file to retrieve. Required. @@ -2526,7 +2523,7 @@ async def get(self, file_id: str, **kwargs: Any) -> _models2.FileInfo: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.FileInfo] = kwargs.pop("cls", None) + cls: ClsType[_models.FileInfo] = kwargs.pop("cls", None) _request = build_files_get_request( file_id=file_id, @@ -2553,13 +2550,13 @@ async def get(self, file_id: str, **kwargs: Any) -> _models2.FileInfo: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.FileInfo, response.json()) + deserialized = _deserialize(_models.FileInfo, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2614,7 +2611,7 @@ async def _get_file_content(self, file_id: str, **kwargs: Any) -> AsyncIterator[ except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) deserialized = response.iter_bytes() @@ -2647,10 +2644,10 @@ def list( self, *, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.VectorStore"]: + ) -> AsyncIterable["_models.VectorStore"]: """Returns a list of vector stores. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and @@ -2671,7 +2668,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.VectorStore]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VectorStore]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2700,7 +2697,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.VectorStore], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.VectorStore], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -2716,7 +2713,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -2730,12 +2727,12 @@ async def create( content_type: str = "application/json", file_ids: Optional[List[str]] = None, name: Optional[str] = None, - store_configuration: Optional[_models2.VectorStoreConfiguration] = None, - expires_after: Optional[_models2.VectorStoreExpirationPolicy] = None, - chunking_strategy: Optional[_models2.VectorStoreChunkingStrategyRequest] = None, + store_configuration: Optional[_models.VectorStoreConfiguration] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Creates a vector store. :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -2765,9 +2762,7 @@ async def create( """ @overload - async def create( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStore: + async def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.VectorStore: """Creates a vector store. :param body: Required. @@ -2783,7 +2778,7 @@ async def create( @overload async def create( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Creates a vector store. :param body: Required. @@ -2803,12 +2798,12 @@ async def create( *, file_ids: Optional[List[str]] = None, name: Optional[str] = None, - store_configuration: Optional[_models2.VectorStoreConfiguration] = None, - expires_after: Optional[_models2.VectorStoreExpirationPolicy] = None, - chunking_strategy: Optional[_models2.VectorStoreChunkingStrategyRequest] = None, + store_configuration: Optional[_models.VectorStoreConfiguration] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Creates a vector store. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -2847,7 +2842,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.VectorStore] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStore] = kwargs.pop("cls", None) if body is _Unset: body = { @@ -2892,13 +2887,13 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStore, response.json()) + deserialized = _deserialize(_models.VectorStore, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2906,7 +2901,7 @@ async def create( return deserialized # type: ignore @distributed_trace_async - async def get(self, vector_store_id: str, **kwargs: Any) -> _models2.VectorStore: + async def get(self, vector_store_id: str, **kwargs: Any) -> _models.VectorStore: """Returns the vector store object matching the specified ID. :param vector_store_id: Identifier of the vector store. Required. @@ -2926,7 +2921,7 @@ async def get(self, vector_store_id: str, **kwargs: Any) -> _models2.VectorStore _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.VectorStore] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStore] = kwargs.pop("cls", None) _request = build_vector_stores_get_request( vector_store_id=vector_store_id, @@ -2953,13 +2948,13 @@ async def get(self, vector_store_id: str, **kwargs: Any) -> _models2.VectorStore except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStore, response.json()) + deserialized = _deserialize(_models.VectorStore, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2973,10 +2968,10 @@ async def modify( *, content_type: str = "application/json", name: Optional[str] = None, - expires_after: Optional[_models2.VectorStoreExpirationPolicy] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3001,7 +2996,7 @@ async def modify( @overload async def modify( self, vector_store_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3019,7 +3014,7 @@ async def modify( @overload async def modify( self, vector_store_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3041,10 +3036,10 @@ async def modify( body: Union[JSON, IO[bytes]] = _Unset, *, name: Optional[str] = None, - expires_after: Optional[_models2.VectorStoreExpirationPolicy] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3076,7 +3071,7 @@ async def modify( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.VectorStore] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStore] = kwargs.pop("cls", None) if body is _Unset: body = {"expires_after": expires_after, "metadata": metadata, "name": name} @@ -3115,13 +3110,13 @@ async def modify( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStore, response.json()) + deserialized = _deserialize(_models.VectorStore, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3131,7 +3126,7 @@ async def modify( @distributed_trace_async async def _delete_vector_store( self, vector_store_id: str, **kwargs: Any - ) -> _models2._models.VectorStoreDeletionStatus: + ) -> _models._models.VectorStoreDeletionStatus: """Deletes the vector store object matching the specified ID. :param vector_store_id: Identifier of the vector store. Required. @@ -3152,7 +3147,7 @@ async def _delete_vector_store( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2._models.VectorStoreDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.VectorStoreDeletionStatus] = kwargs.pop("cls", None) _request = build_vector_stores_delete_vector_store_request( vector_store_id=vector_store_id, @@ -3179,14 +3174,14 @@ async def _delete_vector_store( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models2._models.VectorStoreDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.VectorStoreDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -3217,12 +3212,12 @@ def list( self, vector_store_id: str, *, - filter: Optional[Union[str, _models2.VectorStoreFileStatusFilter]] = None, + filter: Optional[Union[str, _models.VectorStoreFileStatusFilter]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.VectorStoreFile"]: + ) -> AsyncIterable["_models.VectorStoreFile"]: """Returns a list of vector store files. :param vector_store_id: Identifier of the vector store. Required. @@ -3248,7 +3243,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.VectorStoreFile]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VectorStoreFile]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3279,7 +3274,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.VectorStoreFile], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.VectorStoreFile], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -3295,7 +3290,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -3309,10 +3304,10 @@ async def create( *, content_type: str = "application/json", file_id: Optional[str] = None, - data_source: Optional[_models2.VectorStoreDataSource] = None, - chunking_strategy: Optional[_models2.VectorStoreChunkingStrategyRequest] = None, + data_source: Optional[_models.VectorStoreDataSource] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models2.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3335,7 +3330,7 @@ async def create( @overload async def create( self, vector_store_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3353,7 +3348,7 @@ async def create( @overload async def create( self, vector_store_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3375,10 +3370,10 @@ async def create( body: Union[JSON, IO[bytes]] = _Unset, *, file_id: Optional[str] = None, - data_source: Optional[_models2.VectorStoreDataSource] = None, - chunking_strategy: Optional[_models2.VectorStoreChunkingStrategyRequest] = None, + data_source: Optional[_models.VectorStoreDataSource] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models2.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -3408,7 +3403,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.VectorStoreFile] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFile] = kwargs.pop("cls", None) if body is _Unset: body = {"chunking_strategy": chunking_strategy, "data_source": data_source, "file_id": file_id} @@ -3447,13 +3442,13 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStoreFile, response.json()) + deserialized = _deserialize(_models.VectorStoreFile, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3461,7 +3456,7 @@ async def create( return deserialized # type: ignore @distributed_trace_async - async def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models2.VectorStoreFile: + async def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models.VectorStoreFile: """Retrieves a vector store file. :param vector_store_id: Identifier of the vector store. Required. @@ -3483,7 +3478,7 @@ async def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _model _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.VectorStoreFile] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFile] = kwargs.pop("cls", None) _request = build_vector_store_files_get_request( vector_store_id=vector_store_id, @@ -3511,13 +3506,13 @@ async def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _model except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStoreFile, response.json()) + deserialized = _deserialize(_models.VectorStoreFile, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3527,7 +3522,7 @@ async def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _model @distributed_trace_async async def _delete_vector_store_file( self, vector_store_id: str, file_id: str, **kwargs: Any - ) -> _models2._models.VectorStoreFileDeletionStatus: + ) -> _models._models.VectorStoreFileDeletionStatus: """Deletes a vector store file. This removes the file‐to‐store link (does not delete the file itself). @@ -3551,7 +3546,7 @@ async def _delete_vector_store_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2._models.VectorStoreFileDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.VectorStoreFileDeletionStatus] = kwargs.pop("cls", None) _request = build_vector_store_files_delete_vector_store_file_request( vector_store_id=vector_store_id, @@ -3579,14 +3574,14 @@ async def _delete_vector_store_file( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models2._models.VectorStoreFileDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.VectorStoreFileDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -3619,10 +3614,10 @@ async def create( *, content_type: str = "application/json", file_ids: Optional[List[str]] = None, - data_sources: Optional[List[_models2.VectorStoreDataSource]] = None, - chunking_strategy: Optional[_models2.VectorStoreChunkingStrategyRequest] = None, + data_sources: Optional[List[_models.VectorStoreDataSource]] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models2.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -3645,7 +3640,7 @@ async def create( @overload async def create( self, vector_store_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -3663,7 +3658,7 @@ async def create( @overload async def create( self, vector_store_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -3685,10 +3680,10 @@ async def create( body: Union[JSON, IO[bytes]] = _Unset, *, file_ids: Optional[List[str]] = None, - data_sources: Optional[List[_models2.VectorStoreDataSource]] = None, - chunking_strategy: Optional[_models2.VectorStoreChunkingStrategyRequest] = None, + data_sources: Optional[List[_models.VectorStoreDataSource]] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models2.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -3718,7 +3713,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.VectorStoreFileBatch] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFileBatch] = kwargs.pop("cls", None) if body is _Unset: body = {"chunking_strategy": chunking_strategy, "data_sources": data_sources, "file_ids": file_ids} @@ -3757,13 +3752,13 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStoreFileBatch, response.json()) + deserialized = _deserialize(_models.VectorStoreFileBatch, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3771,7 +3766,7 @@ async def create( return deserialized # type: ignore @distributed_trace_async - async def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models2.VectorStoreFileBatch: + async def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models.VectorStoreFileBatch: """Retrieve a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -3793,7 +3788,7 @@ async def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.VectorStoreFileBatch] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFileBatch] = kwargs.pop("cls", None) _request = build_vector_store_file_batches_get_request( vector_store_id=vector_store_id, @@ -3821,13 +3816,13 @@ async def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _mode except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStoreFileBatch, response.json()) + deserialized = _deserialize(_models.VectorStoreFileBatch, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3835,7 +3830,7 @@ async def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _mode return deserialized # type: ignore @distributed_trace_async - async def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models2.VectorStoreFileBatch: + async def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models.VectorStoreFileBatch: """Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. @@ -3858,7 +3853,7 @@ async def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.VectorStoreFileBatch] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFileBatch] = kwargs.pop("cls", None) _request = build_vector_store_file_batches_cancel_request( vector_store_id=vector_store_id, @@ -3886,13 +3881,13 @@ async def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _m except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.VectorStoreFileBatch, response.json()) + deserialized = _deserialize(_models.VectorStoreFileBatch, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3905,12 +3900,12 @@ def list_files( vector_store_id: str, batch_id: str, *, - filter: Optional[Union[str, _models2.VectorStoreFileStatusFilter]] = None, + filter: Optional[Union[str, _models.VectorStoreFileStatusFilter]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.VectorStoreFile"]: + ) -> AsyncIterable["_models.VectorStoreFile"]: """Returns a list of vector store files in a batch. :param vector_store_id: Identifier of the vector store. Required. @@ -3938,7 +3933,7 @@ def list_files( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.VectorStoreFile]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VectorStoreFile]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3970,7 +3965,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.VectorStoreFile], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.VectorStoreFile], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -3986,7 +3981,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -4007,14 +4002,14 @@ async def create_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Creates a new agent. :keyword model: The ID of the model to use. Required. @@ -4063,9 +4058,7 @@ async def create_agent( """ @overload - async def create_agent( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Agent: + async def create_agent(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Agent: """Creates a new agent. :param body: Required. @@ -4081,7 +4074,7 @@ async def create_agent( @overload async def create_agent( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Creates a new agent. :param body: Required. @@ -4103,14 +4096,14 @@ async def create_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Creates a new agent. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -4168,7 +4161,7 @@ async def create_agent( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Agent] = kwargs.pop("cls", None) + cls: ClsType[_models.Agent] = kwargs.pop("cls", None) if body is _Unset: if model is _Unset: @@ -4219,13 +4212,13 @@ async def create_agent( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Agent, response.json()) + deserialized = _deserialize(_models.Agent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4237,10 +4230,10 @@ def list_agents( self, *, limit: Optional[int] = None, - order: Optional[Union[str, _models2.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models2.Agent"]: + ) -> AsyncIterable["_models.Agent"]: """Gets a list of agents that were previously created. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and @@ -4261,7 +4254,7 @@ def list_agents( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.Agent]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Agent]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4290,7 +4283,7 @@ def prepare_request(_continuation_token=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Agent], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.Agent], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, AsyncList(list_of_elem) @@ -4306,7 +4299,7 @@ async def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -4314,7 +4307,7 @@ async def get_next(_continuation_token=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_agent(self, agent_id: str, **kwargs: Any) -> _models2.Agent: + async def get_agent(self, agent_id: str, **kwargs: Any) -> _models.Agent: """Retrieves an existing agent. :param agent_id: Identifier of the agent. Required. @@ -4334,7 +4327,7 @@ async def get_agent(self, agent_id: str, **kwargs: Any) -> _models2.Agent: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.Agent] = kwargs.pop("cls", None) + cls: ClsType[_models.Agent] = kwargs.pop("cls", None) _request = build_agents_get_agent_request( agent_id=agent_id, @@ -4361,13 +4354,13 @@ async def get_agent(self, agent_id: str, **kwargs: Any) -> _models2.Agent: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Agent, response.json()) + deserialized = _deserialize(_models.Agent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4384,14 +4377,14 @@ async def update_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -4446,7 +4439,7 @@ async def update_agent( @overload async def update_agent( self, agent_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -4464,7 +4457,7 @@ async def update_agent( @overload async def update_agent( self, agent_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -4489,14 +4482,14 @@ async def update_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -4558,7 +4551,7 @@ async def update_agent( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Agent] = kwargs.pop("cls", None) + cls: ClsType[_models.Agent] = kwargs.pop("cls", None) if body is _Unset: body = { @@ -4608,13 +4601,13 @@ async def update_agent( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Agent, response.json()) + deserialized = _deserialize(_models.Agent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4622,7 +4615,7 @@ async def update_agent( return deserialized # type: ignore @distributed_trace_async - async def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models2._models.AgentDeletionStatus: + async def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models._models.AgentDeletionStatus: """Deletes an agent. :param agent_id: Identifier of the agent. Required. @@ -4642,7 +4635,7 @@ async def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models2._models. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2._models.AgentDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.AgentDeletionStatus] = kwargs.pop("cls", None) _request = build_agents_delete_agent_request( agent_id=agent_id, @@ -4669,14 +4662,14 @@ async def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models2._models. except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models2._models.AgentDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.AgentDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -4690,23 +4683,23 @@ async def create_thread_and_run( *, agent_id: str, content_type: str = "application/json", - thread: Optional[_models2.AgentThreadCreationOptions] = None, + thread: Optional[_models.AgentThreadCreationOptions] = None, model: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models2.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :keyword agent_id: The ID of the agent for which the thread should be created. Required. @@ -4790,7 +4783,7 @@ async def create_thread_and_run( @overload async def create_thread_and_run( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :param body: Required. @@ -4806,7 +4799,7 @@ async def create_thread_and_run( @overload async def create_thread_and_run( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :param body: Required. @@ -4825,23 +4818,23 @@ async def create_thread_and_run( body: Union[JSON, IO[bytes]] = _Unset, *, agent_id: str = _Unset, - thread: Optional[_models2.AgentThreadCreationOptions] = None, + thread: Optional[_models.AgentThreadCreationOptions] = None, model: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models2.ToolDefinition]] = None, - tool_resources: Optional[_models2.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models2.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models2.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -4932,7 +4925,7 @@ async def create_thread_and_run( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: if agent_id is _Unset: @@ -4989,13 +4982,13 @@ async def create_thread_and_run( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/models/__init__.py b/sdk/ai/azure-ai-agents/azure/ai/agents/models/__init__.py index 7b89044f172a..5721a5ff90c2 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/models/__init__.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/models/__init__.py @@ -18,6 +18,8 @@ Agent, AgentThread, AgentThreadCreationOptions, + AgentV1Error, + AgentV1ErrorError, AgentsNamedToolChoice, AgentsResponseFormat, AzureAISearchToolDefinition, @@ -27,7 +29,7 @@ AzureFunctionStorageQueue, AzureFunctionToolDefinition, BingGroundingSearchConfiguration, - BingGroundingSearchConfigurationList, + BingGroundingSearchToolParameters, BingGroundingToolDefinition, CodeInterpreterToolDefinition, CodeInterpreterToolResource, @@ -207,6 +209,8 @@ "Agent", "AgentThread", "AgentThreadCreationOptions", + "AgentV1Error", + "AgentV1ErrorError", "AgentsNamedToolChoice", "AgentsResponseFormat", "AzureAISearchToolDefinition", @@ -216,7 +220,7 @@ "AzureFunctionStorageQueue", "AzureFunctionToolDefinition", "BingGroundingSearchConfiguration", - "BingGroundingSearchConfigurationList", + "BingGroundingSearchToolParameters", "BingGroundingToolDefinition", "CodeInterpreterToolDefinition", "CodeInterpreterToolResource", diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/models/_enums.py b/sdk/ai/azure-ai-agents/azure/ai/agents/models/_enums.py index b86c3dc75319..26e82fdde0ca 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/models/_enums.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/models/_enums.py @@ -19,10 +19,10 @@ class AgentsNamedToolChoiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Tool type ``code_interpreter``""" FILE_SEARCH = "file_search" """Tool type ``file_search``""" + BING_GROUNDING = "bing_grounding" + """Tool type ``bing_grounding``""" AZURE_AI_SEARCH = "azure_ai_search" """Tool type ``azure_ai_search``""" - BING_CUSTOM_SEARCH = "bing_custom_search" - """Tool type ``bing_custom_search``""" CONNECTED_AGENT = "connected_agent" """Tool type ``connected_agent``""" diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/models/_models.py b/sdk/ai/azure-ai-agents/azure/ai/agents/models/_models.py index 6eca528e2261..9c77fb155247 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/models/_models.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/models/_models.py @@ -191,8 +191,8 @@ class AgentsNamedToolChoice(_Model): """Specifies a tool the model should use. Use to force the model to call a specific tool. :ivar type: the type of tool. If type is ``function``, the function name must be set. Required. - Known values are: "function", "code_interpreter", "file_search", "azure_ai_search", - "bing_custom_search", and "connected_agent". + Known values are: "function", "code_interpreter", "file_search", "bing_grounding", + "azure_ai_search", and "connected_agent". :vartype type: str or ~azure.ai.agents.models.AgentsNamedToolChoiceType :ivar function: The name of the function to call. :vartype function: ~azure.ai.agents.models.FunctionName @@ -202,8 +202,8 @@ class AgentsNamedToolChoice(_Model): visibility=["read", "create", "update", "delete", "query"] ) """the type of tool. If type is ``function``, the function name must be set. Required. Known - values are: \"function\", \"code_interpreter\", \"file_search\", \"azure_ai_search\", - \"bing_custom_search\", and \"connected_agent\".""" + values are: \"function\", \"code_interpreter\", \"file_search\", \"bing_grounding\", + \"azure_ai_search\", and \"connected_agent\".""" function: Optional["_models.FunctionName"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The name of the function to call.""" @@ -376,13 +376,79 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class AgentV1Error(_Model): + """Error payload returned by the agents API. + + :ivar error: Represents the error. Required. + :vartype error: ~azure.ai.agents.models.AgentV1ErrorError + """ + + error: "_models.AgentV1ErrorError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the error. Required.""" + + @overload + def __init__( + self, + *, + error: "_models.AgentV1ErrorError", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentV1ErrorError(_Model): + """AgentV1ErrorError. + + :ivar message: + :vartype message: str + :ivar type: + :vartype type: str + :ivar param: + :vartype param: str + :ivar code: + :vartype code: str + """ + + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + message: Optional[str] = None, + type: Optional[str] = None, + param: Optional[str] = None, + code: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class AISearchIndexResource(_Model): """A AI Search Index resource. :ivar index_connection_id: An index connection id in an IndexResource attached to this agent. - Required. :vartype index_connection_id: str - :ivar index_name: The name of an index in an IndexResource attached to this agent. Required. + :ivar index_name: The name of an index in an IndexResource attached to this agent. :vartype index_name: str :ivar query_type: Type of query in an AIIndexResource attached to this agent. Known values are: "simple", "semantic", "vector", "vector_simple_hybrid", and "vector_semantic_hybrid". @@ -391,12 +457,14 @@ class AISearchIndexResource(_Model): :vartype top_k: int :ivar filter: filter string for search resource. :vartype filter: str + :ivar index_asset_id: Index asset id for search resource. + :vartype index_asset_id: str """ - index_connection_id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """An index connection id in an IndexResource attached to this agent. Required.""" - index_name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The name of an index in an IndexResource attached to this agent. Required.""" + index_connection_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An index connection id in an IndexResource attached to this agent.""" + index_name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of an index in an IndexResource attached to this agent.""" query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) @@ -406,16 +474,19 @@ class AISearchIndexResource(_Model): """Number of documents to retrieve from search and present to the model.""" filter: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """filter string for search resource.""" + index_asset_id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Index asset id for search resource.""" @overload def __init__( self, *, - index_connection_id: str, - index_name: str, + index_connection_id: Optional[str] = None, + index_name: Optional[str] = None, query_type: Optional[Union[str, "_models.AzureAISearchQueryType"]] = None, top_k: Optional[int] = None, filter: Optional[str] = None, # pylint: disable=redefined-builtin + index_asset_id: Optional[str] = None, ) -> None: ... @overload @@ -731,8 +802,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BingGroundingSearchConfigurationList(_Model): - """A list of search configurations currently used by the ``bing_grounding`` tool. +class BingGroundingSearchToolParameters(_Model): + """The bing grounding search tool parameters. :ivar search_configurations: The search configurations attached to this tool. There can be a maximum of 1 @@ -771,24 +842,23 @@ class BingGroundingToolDefinition(ToolDefinition, discriminator="bing_grounding" :ivar type: The object type, which is always 'bing_grounding'. Required. Default value is "bing_grounding". :vartype type: str - :ivar bing_grounding: The list of search configurations used by the bing grounding tool. - Required. - :vartype bing_grounding: ~azure.ai.agents.models.BingGroundingSearchConfigurationList + :ivar bing_grounding: The bing grounding search tool parameters. Required. + :vartype bing_grounding: ~azure.ai.agents.models.BingGroundingSearchToolParameters """ type: Literal["bing_grounding"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """The object type, which is always 'bing_grounding'. Required. Default value is \"bing_grounding\".""" - bing_grounding: "_models.BingGroundingSearchConfigurationList" = rest_field( + bing_grounding: "_models.BingGroundingSearchToolParameters" = rest_field( visibility=["read", "create", "update", "delete", "query"] ) - """The list of search configurations used by the bing grounding tool. Required.""" + """The bing grounding search tool parameters. Required.""" @overload def __init__( self, *, - bing_grounding: "_models.BingGroundingSearchConfigurationList", + bing_grounding: "_models.BingGroundingSearchToolParameters", ) -> None: ... @overload diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/models/_patch.py b/sdk/ai/azure-ai-agents/azure/ai/agents/models/_patch.py index cf3861339e4e..dbaef74e5554 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/models/_patch.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/models/_patch.py @@ -66,7 +66,7 @@ RunStep, RunStepDeltaChunk, BingGroundingSearchConfiguration, - BingGroundingSearchConfigurationList, + BingGroundingSearchToolParameters, SubmitToolOutputsAction, ThreadRun, ToolDefinition, @@ -604,6 +604,7 @@ def __init__( query_type: AzureAISearchQueryType = AzureAISearchQueryType.SIMPLE, filter: str = "", top_k: int = 5, + index_asset_id: str = "", ): """ Initialize AzureAISearch with an index_connection_id and index_name, with optional params. @@ -619,6 +620,8 @@ def __init__( :type filter: str :param top_k: Number of documents to retrieve from search and present to the model. :type top_k: int + :param index_asset_id: Index asset ID to be used by tool. + :type filter: str """ self.index_list = [ AISearchIndexResource( @@ -627,6 +630,7 @@ def __init__( query_type=query_type, filter=filter, top_k=top_k, + index_asset_id=index_asset_id, ) ] @@ -867,7 +871,7 @@ def definitions(self) -> List[BingGroundingToolDefinition]: """ return [ BingGroundingToolDefinition( - bing_grounding=BingGroundingSearchConfigurationList(search_configurations=self.connection_ids) + bing_grounding=BingGroundingSearchToolParameters(search_configurations=self.connection_ids) ) ] diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/operations/_operations.py b/sdk/ai/azure-ai-agents/azure/ai/agents/operations/_operations.py index 133c2ffe96a2..49075068aafb 100644 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/operations/_operations.py +++ b/sdk/ai/azure-ai-agents/azure/ai/agents/operations/_operations.py @@ -29,12 +29,11 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from .._configuration import AgentsClientConfiguration from .._utils.model_base import Model as _Model, SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._utils.utils import ClientMixinABC, prepare_multipart_form_data -from ..servicepatterns import models as _servicepatterns_models1 if TYPE_CHECKING: from .. import _types @@ -72,7 +71,7 @@ def build_threads_create_request(**kwargs: Any) -> HttpRequest: def build_threads_list_request( *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -210,7 +209,7 @@ def build_messages_list_request( *, run_id: Optional[str] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -302,7 +301,7 @@ def build_messages_update_request(thread_id: str, message_id: str, **kwargs: Any def build_runs_create_request( - thread_id: str, *, include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, **kwargs: Any + thread_id: str, *, include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -336,7 +335,7 @@ def build_runs_list_request( thread_id: str, *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -483,7 +482,7 @@ def build_run_steps_get_request( run_id: str, step_id: str, *, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -517,9 +516,9 @@ def build_run_steps_list_request( thread_id: str, run_id: str, *, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -559,7 +558,7 @@ def build_run_steps_list_request( def build_files_list_request( - *, purpose: Optional[Union[str, _models1.FilePurpose]] = None, **kwargs: Any + *, purpose: Optional[Union[str, _models.FilePurpose]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) @@ -675,7 +674,7 @@ def build_files_get_file_content_request(file_id: str, **kwargs: Any) -> HttpReq def build_vector_stores_list_request( *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -808,9 +807,9 @@ def build_vector_stores_delete_vector_store_request( # pylint: disable=name-too def build_vector_store_files_list_request( vector_store_id: str, *, - filter: Optional[Union[str, _models1.VectorStoreFileStatusFilter]] = None, + filter: Optional[Union[str, _models.VectorStoreFileStatusFilter]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -1014,9 +1013,9 @@ def build_vector_store_file_batches_list_files_request( # pylint: disable=name- vector_store_id: str, batch_id: str, *, - filter: Optional[Union[str, _models1.VectorStoreFileStatusFilter]] = None, + filter: Optional[Union[str, _models.VectorStoreFileStatusFilter]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -1080,7 +1079,7 @@ def build_agents_create_agent_request(**kwargs: Any) -> HttpRequest: def build_agents_list_agents_request( *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, after: Optional[str] = None, before: Optional[str] = None, **kwargs: Any @@ -1230,11 +1229,11 @@ def create( self, *, content_type: str = "application/json", - messages: Optional[List[_models1.ThreadMessageOptions]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + messages: Optional[List[_models.ThreadMessageOptions]] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.AgentThread: + ) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -1260,7 +1259,7 @@ def create( """ @overload - def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models1.AgentThread: + def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :param body: Required. @@ -1274,7 +1273,7 @@ def create(self, body: JSON, *, content_type: str = "application/json", **kwargs """ @overload - def create(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models1.AgentThread: + def create(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :param body: Required. @@ -1292,11 +1291,11 @@ def create( self, body: Union[JSON, IO[bytes]] = _Unset, *, - messages: Optional[List[_models1.ThreadMessageOptions]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + messages: Optional[List[_models.ThreadMessageOptions]] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.AgentThread: + ) -> _models.AgentThread: """Creates a new thread. Threads contain messages and can be run by agents. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -1331,7 +1330,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.AgentThread] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentThread] = kwargs.pop("cls", None) if body is _Unset: body = {"messages": messages, "metadata": metadata, "tool_resources": tool_resources} @@ -1369,13 +1368,13 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.AgentThread, response.json()) + deserialized = _deserialize(_models.AgentThread, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1387,10 +1386,10 @@ def list( self, *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.AgentThread"]: + ) -> Iterable["_models.AgentThread"]: """Gets a list of threads that were previously created. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and @@ -1411,7 +1410,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.AgentThread]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentThread]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1440,7 +1439,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.AgentThread], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.AgentThread], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -1456,7 +1455,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -1464,7 +1463,7 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get(self, thread_id: str, **kwargs: Any) -> _models1.AgentThread: + def get(self, thread_id: str, **kwargs: Any) -> _models.AgentThread: """Gets information about an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1484,7 +1483,7 @@ def get(self, thread_id: str, **kwargs: Any) -> _models1.AgentThread: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.AgentThread] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentThread] = kwargs.pop("cls", None) _request = build_threads_get_request( thread_id=thread_id, @@ -1511,13 +1510,13 @@ def get(self, thread_id: str, **kwargs: Any) -> _models1.AgentThread: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.AgentThread, response.json()) + deserialized = _deserialize(_models.AgentThread, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1530,10 +1529,10 @@ def update( thread_id: str, *, content_type: str = "application/json", - tool_resources: Optional[_models1.ToolResources] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -1560,7 +1559,7 @@ def update( @overload def update( self, thread_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -1578,7 +1577,7 @@ def update( @overload def update( self, thread_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -1599,10 +1598,10 @@ def update( thread_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, - tool_resources: Optional[_models1.ToolResources] = None, + tool_resources: Optional[_models.ToolResources] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.AgentThread: + ) -> _models.AgentThread: """Modifies an existing thread. :param thread_id: The ID of the thread to modify. Required. @@ -1636,7 +1635,7 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.AgentThread] = kwargs.pop("cls", None) + cls: ClsType[_models.AgentThread] = kwargs.pop("cls", None) if body is _Unset: body = {"metadata": metadata, "tool_resources": tool_resources} @@ -1675,13 +1674,13 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.AgentThread, response.json()) + deserialized = _deserialize(_models.AgentThread, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1689,7 +1688,7 @@ def update( return deserialized # type: ignore @distributed_trace - def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models1._models.ThreadDeletionStatus: + def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models._models.ThreadDeletionStatus: """Deletes an existing thread. :param thread_id: Identifier of the thread. Required. @@ -1709,7 +1708,7 @@ def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models1._models.Thre _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1._models.ThreadDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.ThreadDeletionStatus] = kwargs.pop("cls", None) _request = build_threads_delete_thread_request( thread_id=thread_id, @@ -1736,14 +1735,14 @@ def _delete_thread(self, thread_id: str, **kwargs: Any) -> _models1._models.Thre except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models1._models.ThreadDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.ThreadDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -1774,13 +1773,13 @@ def create( self, thread_id: str, *, - role: Union[str, _models1.MessageRole], + role: Union[str, _models.MessageRole], content: "_types.MessageInputContent", content_type: str = "application/json", - attachments: Optional[List[_models1.MessageAttachment]] = None, + attachments: Optional[List[_models.MessageAttachment]] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -1815,7 +1814,7 @@ def create( @overload def create( self, thread_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -1833,7 +1832,7 @@ def create( @overload def create( self, thread_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -1854,12 +1853,12 @@ def create( thread_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, - role: Union[str, _models1.MessageRole] = _Unset, + role: Union[str, _models.MessageRole] = _Unset, content: "_types.MessageInputContent" = _Unset, - attachments: Optional[List[_models1.MessageAttachment]] = None, + attachments: Optional[List[_models.MessageAttachment]] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Creates a new message on a specified thread. :param thread_id: Identifier of the thread. Required. @@ -1901,7 +1900,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ThreadMessage] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadMessage] = kwargs.pop("cls", None) if body is _Unset: if role is _Unset: @@ -1944,13 +1943,13 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadMessage, response.json()) + deserialized = _deserialize(_models.ThreadMessage, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1964,10 +1963,10 @@ def list( *, run_id: Optional[str] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.ThreadMessage"]: + ) -> Iterable["_models.ThreadMessage"]: """Gets a list of messages that exist on a thread. :param thread_id: Identifier of the thread. Required. @@ -1992,7 +1991,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.ThreadMessage]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ThreadMessage]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2023,7 +2022,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.ThreadMessage], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.ThreadMessage], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -2046,7 +2045,7 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models1.ThreadMessage: + def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models.ThreadMessage: """Retrieves an existing message. :param thread_id: Identifier of the thread. Required. @@ -2068,7 +2067,7 @@ def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models1.Thread _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.ThreadMessage] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadMessage] = kwargs.pop("cls", None) _request = build_messages_get_request( thread_id=thread_id, @@ -2096,13 +2095,13 @@ def get(self, thread_id: str, message_id: str, **kwargs: Any) -> _models1.Thread except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadMessage, response.json()) + deserialized = _deserialize(_models.ThreadMessage, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2118,7 +2117,7 @@ def update( content_type: str = "application/json", metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -2141,7 +2140,7 @@ def update( @overload def update( self, thread_id: str, message_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -2161,7 +2160,7 @@ def update( @overload def update( self, thread_id: str, message_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -2187,7 +2186,7 @@ def update( *, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadMessage: + ) -> _models.ThreadMessage: """Modifies an existing message on an existing thread. :param thread_id: Identifier of the thread. Required. @@ -2217,7 +2216,7 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ThreadMessage] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadMessage] = kwargs.pop("cls", None) if body is _Unset: body = {"metadata": metadata} @@ -2257,13 +2256,13 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadMessage, response.json()) + deserialized = _deserialize(_models.ThreadMessage, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2294,25 +2293,25 @@ def create( thread_id: str, *, agent_id: str, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, content_type: str = "application/json", model: Optional[str] = None, instructions: Optional[str] = None, additional_instructions: Optional[str] = None, - additional_messages: Optional[List[_models1.ThreadMessageOptions]] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, + additional_messages: Optional[List[_models.ThreadMessageOptions]] = None, + tools: Optional[List[_models.ToolDefinition]] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models1.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -2407,10 +2406,10 @@ def create( thread_id: str, body: JSON, *, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -2436,10 +2435,10 @@ def create( thread_id: str, body: IO[bytes], *, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -2466,24 +2465,24 @@ def create( body: Union[JSON, IO[bytes]] = _Unset, *, agent_id: str = _Unset, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, model: Optional[str] = None, instructions: Optional[str] = None, additional_instructions: Optional[str] = None, - additional_messages: Optional[List[_models1.ThreadMessageOptions]] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, + additional_messages: Optional[List[_models.ThreadMessageOptions]] = None, + tools: Optional[List[_models.ToolDefinition]] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models1.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new run for an agent thread. :param thread_id: Identifier of the thread. Required. @@ -2582,7 +2581,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: if agent_id is _Unset: @@ -2641,13 +2640,13 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2660,10 +2659,10 @@ def list( thread_id: str, *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.ThreadRun"]: + ) -> Iterable["_models.ThreadRun"]: """Gets a list of runs for a specified thread. :param thread_id: Identifier of the thread. Required. @@ -2686,7 +2685,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.ThreadRun]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.ThreadRun]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2716,7 +2715,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.ThreadRun], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.ThreadRun], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -2732,7 +2731,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -2740,7 +2739,7 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models1.ThreadRun: + def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models.ThreadRun: """Gets an existing run from an existing thread. :param thread_id: Identifier of the thread. Required. @@ -2762,7 +2761,7 @@ def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models1.ThreadRun: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) _request = build_runs_get_request( thread_id=thread_id, @@ -2790,13 +2789,13 @@ def get(self, thread_id: str, run_id: str, **kwargs: Any) -> _models1.ThreadRun: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2812,7 +2811,7 @@ def update( content_type: str = "application/json", metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -2835,7 +2834,7 @@ def update( @overload def update( self, thread_id: str, run_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -2855,7 +2854,7 @@ def update( @overload def update( self, thread_id: str, run_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -2881,7 +2880,7 @@ def update( *, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Modifies an existing thread run. :param thread_id: Identifier of the thread. Required. @@ -2911,7 +2910,7 @@ def update( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: body = {"metadata": metadata} @@ -2951,13 +2950,13 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2970,11 +2969,11 @@ def submit_tool_outputs( thread_id: str, run_id: str, *, - tool_outputs: List[_models1.ToolOutput], + tool_outputs: List[_models.ToolOutput], content_type: str = "application/json", stream_parameter: Optional[bool] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -2997,7 +2996,7 @@ def submit_tool_outputs( @overload def submit_tool_outputs( self, thread_id: str, run_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -3017,7 +3016,7 @@ def submit_tool_outputs( @overload def submit_tool_outputs( self, thread_id: str, run_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -3041,10 +3040,10 @@ def submit_tool_outputs( run_id: str, body: Union[JSON, IO[bytes]] = _Unset, *, - tool_outputs: List[_models1.ToolOutput] = _Unset, + tool_outputs: List[_models.ToolOutput] = _Unset, stream_parameter: Optional[bool] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Submits outputs from tools as requested by tool calls in a run. :param thread_id: Identifier of the thread. Required. @@ -3074,7 +3073,7 @@ def submit_tool_outputs( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: if tool_outputs is _Unset: @@ -3116,13 +3115,13 @@ def submit_tool_outputs( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3130,7 +3129,7 @@ def submit_tool_outputs( return deserialized # type: ignore @distributed_trace - def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models1.ThreadRun: + def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models.ThreadRun: """Cancels a run of an in‐progress thread. :param thread_id: Identifier of the thread. Required. @@ -3152,7 +3151,7 @@ def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models1.ThreadR _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) _request = build_runs_cancel_request( thread_id=thread_id, @@ -3180,13 +3179,13 @@ def cancel(self, thread_id: str, run_id: str, **kwargs: Any) -> _models1.ThreadR except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3218,9 +3217,9 @@ def get( run_id: str, step_id: str, *, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, **kwargs: Any - ) -> _models1.RunStep: + ) -> _models.RunStep: """Retrieves a single run step from a thread run. :param thread_id: Identifier of the thread. Required. @@ -3249,7 +3248,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.RunStep] = kwargs.pop("cls", None) + cls: ClsType[_models.RunStep] = kwargs.pop("cls", None) _request = build_run_steps_get_request( thread_id=thread_id, @@ -3279,13 +3278,13 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.RunStep, response.json()) + deserialized = _deserialize(_models.RunStep, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3298,12 +3297,12 @@ def list( thread_id: str, run_id: str, *, - include: Optional[List[Union[str, _models1.RunAdditionalFieldList]]] = None, + include: Optional[List[Union[str, _models.RunAdditionalFieldList]]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.RunStep"]: + ) -> Iterable["_models.RunStep"]: """Gets a list of run steps from a thread run. :param thread_id: Identifier of the thread. Required. @@ -3333,7 +3332,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.RunStep]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RunStep]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3365,7 +3364,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.RunStep], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.RunStep], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -3381,7 +3380,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -3408,8 +3407,8 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list( - self, *, purpose: Optional[Union[str, _models1.FilePurpose]] = None, **kwargs: Any - ) -> _models1.FileListResponse: + self, *, purpose: Optional[Union[str, _models.FilePurpose]] = None, **kwargs: Any + ) -> _models.FileListResponse: """Gets a list of previously uploaded files. :keyword purpose: The purpose of the file. Known values are: "fine-tune", "fine-tune-results", @@ -3431,7 +3430,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.FileListResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.FileListResponse] = kwargs.pop("cls", None) _request = build_files_list_request( purpose=purpose, @@ -3458,13 +3457,13 @@ def list( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.FileListResponse, response.json()) + deserialized = _deserialize(_models.FileListResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3472,12 +3471,12 @@ def list( return deserialized # type: ignore @overload - def _upload_file(self, body: _models1._models.UploadFileRequest, **kwargs: Any) -> _models1.FileInfo: ... + def _upload_file(self, body: _models._models.UploadFileRequest, **kwargs: Any) -> _models.FileInfo: ... @overload - def _upload_file(self, body: JSON, **kwargs: Any) -> _models1.FileInfo: ... + def _upload_file(self, body: JSON, **kwargs: Any) -> _models.FileInfo: ... @distributed_trace - def _upload_file(self, body: Union[_models1._models.UploadFileRequest, JSON], **kwargs: Any) -> _models1.FileInfo: + def _upload_file(self, body: Union[_models._models.UploadFileRequest, JSON], **kwargs: Any) -> _models.FileInfo: """Uploads a file for use by other operations. :param body: Multipart body. Is either a UploadFileRequest type or a JSON type. Required. @@ -3497,7 +3496,7 @@ def _upload_file(self, body: Union[_models1._models.UploadFileRequest, JSON], ** _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.FileInfo] = kwargs.pop("cls", None) + cls: ClsType[_models.FileInfo] = kwargs.pop("cls", None) _body = body.as_dict() if isinstance(body, _Model) else body _file_fields: List[str] = ["file"] @@ -3530,13 +3529,13 @@ def _upload_file(self, body: Union[_models1._models.UploadFileRequest, JSON], ** except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.FileInfo, response.json()) + deserialized = _deserialize(_models.FileInfo, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3544,7 +3543,7 @@ def _upload_file(self, body: Union[_models1._models.UploadFileRequest, JSON], ** return deserialized # type: ignore @distributed_trace - def _delete_file(self, file_id: str, **kwargs: Any) -> _models1._models.FileDeletionStatus: + def _delete_file(self, file_id: str, **kwargs: Any) -> _models._models.FileDeletionStatus: """Delete a previously uploaded file. :param file_id: The ID of the file to delete. Required. @@ -3564,7 +3563,7 @@ def _delete_file(self, file_id: str, **kwargs: Any) -> _models1._models.FileDele _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1._models.FileDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.FileDeletionStatus] = kwargs.pop("cls", None) _request = build_files_delete_file_request( file_id=file_id, @@ -3591,14 +3590,14 @@ def _delete_file(self, file_id: str, **kwargs: Any) -> _models1._models.FileDele except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models1._models.FileDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.FileDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -3607,7 +3606,7 @@ def _delete_file(self, file_id: str, **kwargs: Any) -> _models1._models.FileDele return deserialized # type: ignore @distributed_trace - def get(self, file_id: str, **kwargs: Any) -> _models1.FileInfo: + def get(self, file_id: str, **kwargs: Any) -> _models.FileInfo: """Returns information about a specific file. Does not retrieve file content. :param file_id: The ID of the file to retrieve. Required. @@ -3627,7 +3626,7 @@ def get(self, file_id: str, **kwargs: Any) -> _models1.FileInfo: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.FileInfo] = kwargs.pop("cls", None) + cls: ClsType[_models.FileInfo] = kwargs.pop("cls", None) _request = build_files_get_request( file_id=file_id, @@ -3654,13 +3653,13 @@ def get(self, file_id: str, **kwargs: Any) -> _models1.FileInfo: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.FileInfo, response.json()) + deserialized = _deserialize(_models.FileInfo, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3715,7 +3714,7 @@ def _get_file_content(self, file_id: str, **kwargs: Any) -> Iterator[bytes]: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) deserialized = response.iter_bytes() @@ -3748,10 +3747,10 @@ def list( self, *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.VectorStore"]: + ) -> Iterable["_models.VectorStore"]: """Returns a list of vector stores. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and @@ -3772,7 +3771,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.VectorStore]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VectorStore]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3801,7 +3800,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.VectorStore], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.VectorStore], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -3817,7 +3816,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -3831,12 +3830,12 @@ def create( content_type: str = "application/json", file_ids: Optional[List[str]] = None, name: Optional[str] = None, - store_configuration: Optional[_models1.VectorStoreConfiguration] = None, - expires_after: Optional[_models1.VectorStoreExpirationPolicy] = None, - chunking_strategy: Optional[_models1.VectorStoreChunkingStrategyRequest] = None, + store_configuration: Optional[_models.VectorStoreConfiguration] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.VectorStore: + ) -> _models.VectorStore: """Creates a vector store. :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -3866,7 +3865,7 @@ def create( """ @overload - def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models1.VectorStore: + def create(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.VectorStore: """Creates a vector store. :param body: Required. @@ -3880,7 +3879,7 @@ def create(self, body: JSON, *, content_type: str = "application/json", **kwargs """ @overload - def create(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models1.VectorStore: + def create(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.VectorStore: """Creates a vector store. :param body: Required. @@ -3900,12 +3899,12 @@ def create( *, file_ids: Optional[List[str]] = None, name: Optional[str] = None, - store_configuration: Optional[_models1.VectorStoreConfiguration] = None, - expires_after: Optional[_models1.VectorStoreExpirationPolicy] = None, - chunking_strategy: Optional[_models1.VectorStoreChunkingStrategyRequest] = None, + store_configuration: Optional[_models.VectorStoreConfiguration] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.VectorStore: + ) -> _models.VectorStore: """Creates a vector store. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -3944,7 +3943,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.VectorStore] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStore] = kwargs.pop("cls", None) if body is _Unset: body = { @@ -3989,13 +3988,13 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStore, response.json()) + deserialized = _deserialize(_models.VectorStore, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4003,7 +4002,7 @@ def create( return deserialized # type: ignore @distributed_trace - def get(self, vector_store_id: str, **kwargs: Any) -> _models1.VectorStore: + def get(self, vector_store_id: str, **kwargs: Any) -> _models.VectorStore: """Returns the vector store object matching the specified ID. :param vector_store_id: Identifier of the vector store. Required. @@ -4023,7 +4022,7 @@ def get(self, vector_store_id: str, **kwargs: Any) -> _models1.VectorStore: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.VectorStore] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStore] = kwargs.pop("cls", None) _request = build_vector_stores_get_request( vector_store_id=vector_store_id, @@ -4050,13 +4049,13 @@ def get(self, vector_store_id: str, **kwargs: Any) -> _models1.VectorStore: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStore, response.json()) + deserialized = _deserialize(_models.VectorStore, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4070,10 +4069,10 @@ def modify( *, content_type: str = "application/json", name: Optional[str] = None, - expires_after: Optional[_models1.VectorStoreExpirationPolicy] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4098,7 +4097,7 @@ def modify( @overload def modify( self, vector_store_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4116,7 +4115,7 @@ def modify( @overload def modify( self, vector_store_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4138,10 +4137,10 @@ def modify( body: Union[JSON, IO[bytes]] = _Unset, *, name: Optional[str] = None, - expires_after: Optional[_models1.VectorStoreExpirationPolicy] = None, + expires_after: Optional[_models.VectorStoreExpirationPolicy] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.VectorStore: + ) -> _models.VectorStore: """Modifies an existing vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4173,7 +4172,7 @@ def modify( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.VectorStore] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStore] = kwargs.pop("cls", None) if body is _Unset: body = {"expires_after": expires_after, "metadata": metadata, "name": name} @@ -4212,13 +4211,13 @@ def modify( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStore, response.json()) + deserialized = _deserialize(_models.VectorStore, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4226,7 +4225,7 @@ def modify( return deserialized # type: ignore @distributed_trace - def _delete_vector_store(self, vector_store_id: str, **kwargs: Any) -> _models1._models.VectorStoreDeletionStatus: + def _delete_vector_store(self, vector_store_id: str, **kwargs: Any) -> _models._models.VectorStoreDeletionStatus: """Deletes the vector store object matching the specified ID. :param vector_store_id: Identifier of the vector store. Required. @@ -4247,7 +4246,7 @@ def _delete_vector_store(self, vector_store_id: str, **kwargs: Any) -> _models1. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1._models.VectorStoreDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.VectorStoreDeletionStatus] = kwargs.pop("cls", None) _request = build_vector_stores_delete_vector_store_request( vector_store_id=vector_store_id, @@ -4274,14 +4273,14 @@ def _delete_vector_store(self, vector_store_id: str, **kwargs: Any) -> _models1. except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models1._models.VectorStoreDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.VectorStoreDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -4312,12 +4311,12 @@ def list( self, vector_store_id: str, *, - filter: Optional[Union[str, _models1.VectorStoreFileStatusFilter]] = None, + filter: Optional[Union[str, _models.VectorStoreFileStatusFilter]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.VectorStoreFile"]: + ) -> Iterable["_models.VectorStoreFile"]: """Returns a list of vector store files. :param vector_store_id: Identifier of the vector store. Required. @@ -4343,7 +4342,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.VectorStoreFile]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VectorStoreFile]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4374,7 +4373,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.VectorStoreFile], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.VectorStoreFile], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -4390,7 +4389,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -4404,10 +4403,10 @@ def create( *, content_type: str = "application/json", file_id: Optional[str] = None, - data_source: Optional[_models1.VectorStoreDataSource] = None, - chunking_strategy: Optional[_models1.VectorStoreChunkingStrategyRequest] = None, + data_source: Optional[_models.VectorStoreDataSource] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models1.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4430,7 +4429,7 @@ def create( @overload def create( self, vector_store_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4448,7 +4447,7 @@ def create( @overload def create( self, vector_store_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4470,10 +4469,10 @@ def create( body: Union[JSON, IO[bytes]] = _Unset, *, file_id: Optional[str] = None, - data_source: Optional[_models1.VectorStoreDataSource] = None, - chunking_strategy: Optional[_models1.VectorStoreChunkingStrategyRequest] = None, + data_source: Optional[_models.VectorStoreDataSource] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models1.VectorStoreFile: + ) -> _models.VectorStoreFile: """Create a vector store file by attaching a file to a vector store. :param vector_store_id: Identifier of the vector store. Required. @@ -4503,7 +4502,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.VectorStoreFile] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFile] = kwargs.pop("cls", None) if body is _Unset: body = {"chunking_strategy": chunking_strategy, "data_source": data_source, "file_id": file_id} @@ -4542,13 +4541,13 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStoreFile, response.json()) + deserialized = _deserialize(_models.VectorStoreFile, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4556,7 +4555,7 @@ def create( return deserialized # type: ignore @distributed_trace - def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models1.VectorStoreFile: + def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models.VectorStoreFile: """Retrieves a vector store file. :param vector_store_id: Identifier of the vector store. Required. @@ -4578,7 +4577,7 @@ def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models1.Vec _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.VectorStoreFile] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFile] = kwargs.pop("cls", None) _request = build_vector_store_files_get_request( vector_store_id=vector_store_id, @@ -4606,13 +4605,13 @@ def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models1.Vec except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStoreFile, response.json()) + deserialized = _deserialize(_models.VectorStoreFile, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4622,7 +4621,7 @@ def get(self, vector_store_id: str, file_id: str, **kwargs: Any) -> _models1.Vec @distributed_trace def _delete_vector_store_file( self, vector_store_id: str, file_id: str, **kwargs: Any - ) -> _models1._models.VectorStoreFileDeletionStatus: + ) -> _models._models.VectorStoreFileDeletionStatus: """Deletes a vector store file. This removes the file‐to‐store link (does not delete the file itself). @@ -4646,7 +4645,7 @@ def _delete_vector_store_file( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1._models.VectorStoreFileDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.VectorStoreFileDeletionStatus] = kwargs.pop("cls", None) _request = build_vector_store_files_delete_vector_store_file_request( vector_store_id=vector_store_id, @@ -4674,14 +4673,14 @@ def _delete_vector_store_file( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models1._models.VectorStoreFileDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.VectorStoreFileDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -4714,10 +4713,10 @@ def create( *, content_type: str = "application/json", file_ids: Optional[List[str]] = None, - data_sources: Optional[List[_models1.VectorStoreDataSource]] = None, - chunking_strategy: Optional[_models1.VectorStoreChunkingStrategyRequest] = None, + data_sources: Optional[List[_models.VectorStoreDataSource]] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models1.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -4740,7 +4739,7 @@ def create( @overload def create( self, vector_store_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -4758,7 +4757,7 @@ def create( @overload def create( self, vector_store_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -4780,10 +4779,10 @@ def create( body: Union[JSON, IO[bytes]] = _Unset, *, file_ids: Optional[List[str]] = None, - data_sources: Optional[List[_models1.VectorStoreDataSource]] = None, - chunking_strategy: Optional[_models1.VectorStoreChunkingStrategyRequest] = None, + data_sources: Optional[List[_models.VectorStoreDataSource]] = None, + chunking_strategy: Optional[_models.VectorStoreChunkingStrategyRequest] = None, **kwargs: Any - ) -> _models1.VectorStoreFileBatch: + ) -> _models.VectorStoreFileBatch: """Create a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -4813,7 +4812,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.VectorStoreFileBatch] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFileBatch] = kwargs.pop("cls", None) if body is _Unset: body = {"chunking_strategy": chunking_strategy, "data_sources": data_sources, "file_ids": file_ids} @@ -4852,13 +4851,13 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStoreFileBatch, response.json()) + deserialized = _deserialize(_models.VectorStoreFileBatch, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4866,7 +4865,7 @@ def create( return deserialized # type: ignore @distributed_trace - def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1.VectorStoreFileBatch: + def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models.VectorStoreFileBatch: """Retrieve a vector store file batch. :param vector_store_id: Identifier of the vector store. Required. @@ -4888,7 +4887,7 @@ def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1.Ve _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.VectorStoreFileBatch] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFileBatch] = kwargs.pop("cls", None) _request = build_vector_store_file_batches_get_request( vector_store_id=vector_store_id, @@ -4916,13 +4915,13 @@ def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1.Ve except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStoreFileBatch, response.json()) + deserialized = _deserialize(_models.VectorStoreFileBatch, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -4930,7 +4929,7 @@ def get(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1.Ve return deserialized # type: ignore @distributed_trace - def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1.VectorStoreFileBatch: + def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models.VectorStoreFileBatch: """Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. @@ -4953,7 +4952,7 @@ def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1 _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.VectorStoreFileBatch] = kwargs.pop("cls", None) + cls: ClsType[_models.VectorStoreFileBatch] = kwargs.pop("cls", None) _request = build_vector_store_file_batches_cancel_request( vector_store_id=vector_store_id, @@ -4981,13 +4980,13 @@ def cancel(self, vector_store_id: str, batch_id: str, **kwargs: Any) -> _models1 except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.VectorStoreFileBatch, response.json()) + deserialized = _deserialize(_models.VectorStoreFileBatch, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5000,12 +4999,12 @@ def list_files( vector_store_id: str, batch_id: str, *, - filter: Optional[Union[str, _models1.VectorStoreFileStatusFilter]] = None, + filter: Optional[Union[str, _models.VectorStoreFileStatusFilter]] = None, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.VectorStoreFile"]: + ) -> Iterable["_models.VectorStoreFile"]: """Returns a list of vector store files in a batch. :param vector_store_id: Identifier of the vector store. Required. @@ -5033,7 +5032,7 @@ def list_files( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.VectorStoreFile]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.VectorStoreFile]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5065,7 +5064,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.VectorStoreFile], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.VectorStoreFile], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -5081,7 +5080,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -5100,14 +5099,14 @@ def create_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.Agent: + ) -> _models.Agent: """Creates a new agent. :keyword model: The ID of the model to use. Required. @@ -5156,7 +5155,7 @@ def create_agent( """ @overload - def create_agent(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models1.Agent: + def create_agent(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Agent: """Creates a new agent. :param body: Required. @@ -5170,7 +5169,7 @@ def create_agent(self, body: JSON, *, content_type: str = "application/json", ** """ @overload - def create_agent(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models1.Agent: + def create_agent(self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> _models.Agent: """Creates a new agent. :param body: Required. @@ -5192,14 +5191,14 @@ def create_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.Agent: + ) -> _models.Agent: """Creates a new agent. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -5257,7 +5256,7 @@ def create_agent( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Agent] = kwargs.pop("cls", None) + cls: ClsType[_models.Agent] = kwargs.pop("cls", None) if body is _Unset: if model is _Unset: @@ -5308,13 +5307,13 @@ def create_agent( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Agent, response.json()) + deserialized = _deserialize(_models.Agent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5326,10 +5325,10 @@ def list_agents( self, *, limit: Optional[int] = None, - order: Optional[Union[str, _models1.ListSortOrder]] = None, + order: Optional[Union[str, _models.ListSortOrder]] = None, before: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models1.Agent"]: + ) -> Iterable["_models.Agent"]: """Gets a list of agents that were previously created. :keyword limit: A limit on the number of objects to be returned. Limit can range between 1 and @@ -5350,7 +5349,7 @@ def list_agents( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.Agent]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Agent]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5379,7 +5378,7 @@ def prepare_request(_continuation_token=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.Agent], deserialized.get("data", [])) + list_of_elem = _deserialize(List[_models.Agent], deserialized.get("data", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("last_id") or None, iter(list_of_elem) @@ -5395,7 +5394,7 @@ def get_next(_continuation_token=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) return pipeline_response @@ -5403,7 +5402,7 @@ def get_next(_continuation_token=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_agent(self, agent_id: str, **kwargs: Any) -> _models1.Agent: + def get_agent(self, agent_id: str, **kwargs: Any) -> _models.Agent: """Retrieves an existing agent. :param agent_id: Identifier of the agent. Required. @@ -5423,7 +5422,7 @@ def get_agent(self, agent_id: str, **kwargs: Any) -> _models1.Agent: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.Agent] = kwargs.pop("cls", None) + cls: ClsType[_models.Agent] = kwargs.pop("cls", None) _request = build_agents_get_agent_request( agent_id=agent_id, @@ -5450,13 +5449,13 @@ def get_agent(self, agent_id: str, **kwargs: Any) -> _models1.Agent: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Agent, response.json()) + deserialized = _deserialize(_models.Agent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5473,14 +5472,14 @@ def update_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -5535,7 +5534,7 @@ def update_agent( @overload def update_agent( self, agent_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -5553,7 +5552,7 @@ def update_agent( @overload def update_agent( self, agent_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -5578,14 +5577,14 @@ def update_agent( name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.Agent: + ) -> _models.Agent: """Modifies an existing agent. :param agent_id: The ID of the agent to modify. Required. @@ -5647,7 +5646,7 @@ def update_agent( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Agent] = kwargs.pop("cls", None) + cls: ClsType[_models.Agent] = kwargs.pop("cls", None) if body is _Unset: body = { @@ -5697,13 +5696,13 @@ def update_agent( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Agent, response.json()) + deserialized = _deserialize(_models.Agent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5711,7 +5710,7 @@ def update_agent( return deserialized # type: ignore @distributed_trace - def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models1._models.AgentDeletionStatus: + def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models._models.AgentDeletionStatus: """Deletes an agent. :param agent_id: Identifier of the agent. Required. @@ -5731,7 +5730,7 @@ def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models1._models.AgentD _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1._models.AgentDeletionStatus] = kwargs.pop("cls", None) + cls: ClsType[_models._models.AgentDeletionStatus] = kwargs.pop("cls", None) _request = build_agents_delete_agent_request( agent_id=agent_id, @@ -5758,14 +5757,14 @@ def _delete_agent(self, agent_id: str, **kwargs: Any) -> _models1._models.AgentD except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: deserialized = _deserialize( - _models1._models.AgentDeletionStatus, response.json() # pylint: disable=protected-access + _models._models.AgentDeletionStatus, response.json() # pylint: disable=protected-access ) if cls: @@ -5779,23 +5778,23 @@ def create_thread_and_run( *, agent_id: str, content_type: str = "application/json", - thread: Optional[_models1.AgentThreadCreationOptions] = None, + thread: Optional[_models.AgentThreadCreationOptions] = None, model: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models1.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :keyword agent_id: The ID of the agent for which the thread should be created. Required. @@ -5879,7 +5878,7 @@ def create_thread_and_run( @overload def create_thread_and_run( self, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :param body: Required. @@ -5895,7 +5894,7 @@ def create_thread_and_run( @overload def create_thread_and_run( self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :param body: Required. @@ -5914,23 +5913,23 @@ def create_thread_and_run( body: Union[JSON, IO[bytes]] = _Unset, *, agent_id: str = _Unset, - thread: Optional[_models1.AgentThreadCreationOptions] = None, + thread: Optional[_models.AgentThreadCreationOptions] = None, model: Optional[str] = None, instructions: Optional[str] = None, - tools: Optional[List[_models1.ToolDefinition]] = None, - tool_resources: Optional[_models1.ToolResources] = None, + tools: Optional[List[_models.ToolDefinition]] = None, + tool_resources: Optional[_models.ToolResources] = None, stream_parameter: Optional[bool] = None, temperature: Optional[float] = None, top_p: Optional[float] = None, max_prompt_tokens: Optional[int] = None, max_completion_tokens: Optional[int] = None, - truncation_strategy: Optional[_models1.TruncationObject] = None, + truncation_strategy: Optional[_models.TruncationObject] = None, tool_choice: Optional["_types.AgentsToolChoiceOption"] = None, response_format: Optional["_types.AgentsResponseFormatOption"] = None, parallel_tool_calls: Optional[bool] = None, metadata: Optional[Dict[str, str]] = None, **kwargs: Any - ) -> _models1.ThreadRun: + ) -> _models.ThreadRun: """Creates a new agent thread and immediately starts a run using that new thread. :param body: Is either a JSON type or a IO[bytes] type. Required. @@ -6021,7 +6020,7 @@ def create_thread_and_run( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.ThreadRun] = kwargs.pop("cls", None) + cls: ClsType[_models.ThreadRun] = kwargs.pop("cls", None) if body is _Unset: if agent_id is _Unset: @@ -6078,13 +6077,13 @@ def create_thread_and_run( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_servicepatterns_models1.AgentV1Error, response.json()) + error = _failsafe_deserialize(_models.AgentV1Error, response.json()) raise HttpResponseError(response=response, model=error) if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.ThreadRun, response.json()) + deserialized = _deserialize(_models.ThreadRun, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/__init__.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/__init__.py deleted file mode 100644 index d55ccad1f573..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/__init__.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/__init__.py deleted file mode 100644 index d55ccad1f573..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/__init__.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/__init__.py deleted file mode 100644 index 73d7e533e421..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ServicePatternsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ServicePatternsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/_operations.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/_operations.py deleted file mode 100644 index 3224145e8788..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/_operations.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from azure.core import AsyncPipelineClient - -from ...._utils.serialization import Deserializer, Serializer -from ....aio._configuration import AgentsClientConfiguration - - -class ServicePatternsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.agents.aio.AgentsClient`'s - :attr:`service_patterns` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AgentsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/_patch.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/_patch.py deleted file mode 100644 index 8bcb627aa475..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/aio/operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/__init__.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/__init__.py deleted file mode 100644 index 98da37b9e98c..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/__init__.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - - -from ._models import ( # type: ignore - AgentV1Error, - AgentV1ErrorError, -) -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "AgentV1Error", - "AgentV1ErrorError", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/_models.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/_models.py deleted file mode 100644 index 225a2734e3f3..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/_models.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=useless-super-delegation - -from typing import Any, Mapping, Optional, TYPE_CHECKING, overload - -from ..._utils.model_base import Model as _Model, rest_field - -if TYPE_CHECKING: - from .. import models as _models - - -class AgentV1Error(_Model): - """Error payload returned by the agents API. - - :ivar error: Represents the error. Required. - :vartype error: ~azure.ai.agents.servicepatterns.models.AgentV1ErrorError - """ - - error: "_models.AgentV1ErrorError" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Represents the error. Required.""" - - @overload - def __init__( - self, - *, - error: "_models.AgentV1ErrorError", - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class AgentV1ErrorError(_Model): - """AgentV1ErrorError. - - :ivar message: - :vartype message: str - :ivar type: - :vartype type: str - :ivar param: - :vartype param: str - :ivar code: - :vartype code: str - """ - - message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - param: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - - @overload - def __init__( - self, - *, - message: Optional[str] = None, - type: Optional[str] = None, - param: Optional[str] = None, - code: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/_patch.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/_patch.py deleted file mode 100644 index 8bcb627aa475..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/models/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/__init__.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/__init__.py deleted file mode 100644 index 73d7e533e421..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ServicePatternsOperations # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ServicePatternsOperations", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/_operations.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/_operations.py deleted file mode 100644 index 9d00887950e1..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/_operations.py +++ /dev/null @@ -1,29 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from azure.core import PipelineClient - -from ..._configuration import AgentsClientConfiguration -from ..._utils.serialization import Deserializer, Serializer - - -class ServicePatternsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.ai.agents.AgentsClient`'s - :attr:`service_patterns` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: AgentsClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") diff --git a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/_patch.py b/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/_patch.py deleted file mode 100644 index 8bcb627aa475..000000000000 --- a/sdk/ai/azure-ai-agents/azure/ai/agents/servicepatterns/operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------- -"""Customize generated code here. - -Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize -""" -from typing import List - -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level - - -def patch_sdk(): - """Do not remove from this file. - - `patch_sdk` is a last resort escape hatch that allows you to do customizations - you can't accomplish using the techniques described in - https://aka.ms/azsdk/python/dpcodegen/python/customize - """ diff --git a/sdk/ai/azure-ai-agents/tsp-location.yaml b/sdk/ai/azure-ai-agents/tsp-location.yaml index 4fea318300bb..4682293a1a51 100644 --- a/sdk/ai/azure-ai-agents/tsp-location.yaml +++ b/sdk/ai/azure-ai-agents/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Azure.AI.Agents -commit: ee7bcf538e5ff23b46a0ecd031b4dee30b688a0f +commit: fc0116e3fbb1ecd647a4f412f5e82eb30c11ad51 repo: Azure/azure-rest-api-specs additionalDirectories: