mistralai 1.11.1__py3-none-any.whl → 1.12.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mistralai/_version.py +2 -2
- mistralai/audio.py +20 -0
- mistralai/conversations.py +48 -8
- mistralai/extra/__init__.py +48 -0
- mistralai/extra/exceptions.py +49 -4
- mistralai/extra/realtime/__init__.py +25 -0
- mistralai/extra/realtime/connection.py +207 -0
- mistralai/extra/realtime/transcription.py +271 -0
- mistralai/files.py +6 -0
- mistralai/mistral_agents.py +391 -8
- mistralai/models/__init__.py +103 -0
- mistralai/models/agentaliasresponse.py +23 -0
- mistralai/models/agentconversation.py +14 -4
- mistralai/models/agents_api_v1_agents_create_or_update_aliasop.py +26 -0
- mistralai/models/agents_api_v1_agents_get_versionop.py +2 -2
- mistralai/models/agents_api_v1_agents_getop.py +12 -3
- mistralai/models/agents_api_v1_agents_list_version_aliasesop.py +16 -0
- mistralai/models/audiotranscriptionrequest.py +8 -0
- mistralai/models/audiotranscriptionrequeststream.py +8 -0
- mistralai/models/conversationrequest.py +8 -2
- mistralai/models/conversationrestartrequest.py +18 -4
- mistralai/models/conversationrestartstreamrequest.py +20 -4
- mistralai/models/conversationstreamrequest.py +12 -2
- mistralai/models/files_api_routes_list_filesop.py +8 -1
- mistralai/models/mistralpromptmode.py +4 -0
- mistralai/models/modelcapabilities.py +3 -0
- mistralai/models/realtimetranscriptionerror.py +27 -0
- mistralai/models/realtimetranscriptionerrordetail.py +29 -0
- mistralai/models/realtimetranscriptionsession.py +20 -0
- mistralai/models/realtimetranscriptionsessioncreated.py +30 -0
- mistralai/models/realtimetranscriptionsessionupdated.py +30 -0
- mistralai/models/timestampgranularity.py +4 -1
- mistralai/models/transcriptionsegmentchunk.py +41 -2
- mistralai/models/transcriptionstreamsegmentdelta.py +38 -2
- mistralai/transcriptions.py +24 -0
- {mistralai-1.11.1.dist-info → mistralai-1.12.0.dist-info}/METADATA +6 -2
- {mistralai-1.11.1.dist-info → mistralai-1.12.0.dist-info}/RECORD +39 -28
- {mistralai-1.11.1.dist-info → mistralai-1.12.0.dist-info}/WHEEL +0 -0
- {mistralai-1.11.1.dist-info → mistralai-1.12.0.dist-info}/licenses/LICENSE +0 -0
mistralai/mistral_agents.py
CHANGED
|
@@ -5,6 +5,7 @@ from mistralai import models, utils
|
|
|
5
5
|
from mistralai._hooks import HookContext
|
|
6
6
|
from mistralai.models import (
|
|
7
7
|
agentcreationrequest as models_agentcreationrequest,
|
|
8
|
+
agents_api_v1_agents_getop as models_agents_api_v1_agents_getop,
|
|
8
9
|
agentupdaterequest as models_agentupdaterequest,
|
|
9
10
|
completionargs as models_completionargs,
|
|
10
11
|
requestsource as models_requestsource,
|
|
@@ -494,7 +495,12 @@ class MistralAgents(BaseSDK):
|
|
|
494
495
|
self,
|
|
495
496
|
*,
|
|
496
497
|
agent_id: str,
|
|
497
|
-
agent_version: OptionalNullable[
|
|
498
|
+
agent_version: OptionalNullable[
|
|
499
|
+
Union[
|
|
500
|
+
models_agents_api_v1_agents_getop.QueryParamAgentVersion,
|
|
501
|
+
models_agents_api_v1_agents_getop.QueryParamAgentVersionTypedDict,
|
|
502
|
+
]
|
|
503
|
+
] = UNSET,
|
|
498
504
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
499
505
|
server_url: Optional[str] = None,
|
|
500
506
|
timeout_ms: Optional[int] = None,
|
|
@@ -502,7 +508,7 @@ class MistralAgents(BaseSDK):
|
|
|
502
508
|
) -> models.Agent:
|
|
503
509
|
r"""Retrieve an agent entity.
|
|
504
510
|
|
|
505
|
-
Given an agent retrieve an agent entity with its attributes.
|
|
511
|
+
Given an agent, retrieve an agent entity with its attributes. The agent_version parameter can be an integer version number or a string alias.
|
|
506
512
|
|
|
507
513
|
:param agent_id:
|
|
508
514
|
:param agent_version:
|
|
@@ -587,7 +593,12 @@ class MistralAgents(BaseSDK):
|
|
|
587
593
|
self,
|
|
588
594
|
*,
|
|
589
595
|
agent_id: str,
|
|
590
|
-
agent_version: OptionalNullable[
|
|
596
|
+
agent_version: OptionalNullable[
|
|
597
|
+
Union[
|
|
598
|
+
models_agents_api_v1_agents_getop.QueryParamAgentVersion,
|
|
599
|
+
models_agents_api_v1_agents_getop.QueryParamAgentVersionTypedDict,
|
|
600
|
+
]
|
|
601
|
+
] = UNSET,
|
|
591
602
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
592
603
|
server_url: Optional[str] = None,
|
|
593
604
|
timeout_ms: Optional[int] = None,
|
|
@@ -595,7 +606,7 @@ class MistralAgents(BaseSDK):
|
|
|
595
606
|
) -> models.Agent:
|
|
596
607
|
r"""Retrieve an agent entity.
|
|
597
608
|
|
|
598
|
-
Given an agent retrieve an agent entity with its attributes.
|
|
609
|
+
Given an agent, retrieve an agent entity with its attributes. The agent_version parameter can be an integer version number or a string alias.
|
|
599
610
|
|
|
600
611
|
:param agent_id:
|
|
601
612
|
:param agent_version:
|
|
@@ -1514,7 +1525,7 @@ class MistralAgents(BaseSDK):
|
|
|
1514
1525
|
self,
|
|
1515
1526
|
*,
|
|
1516
1527
|
agent_id: str,
|
|
1517
|
-
version:
|
|
1528
|
+
version: str,
|
|
1518
1529
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1519
1530
|
server_url: Optional[str] = None,
|
|
1520
1531
|
timeout_ms: Optional[int] = None,
|
|
@@ -1548,7 +1559,7 @@ class MistralAgents(BaseSDK):
|
|
|
1548
1559
|
|
|
1549
1560
|
req = self._build_request(
|
|
1550
1561
|
method="GET",
|
|
1551
|
-
path="/v1/agents/{agent_id}/
|
|
1562
|
+
path="/v1/agents/{agent_id}/versions/{version}",
|
|
1552
1563
|
base_url=base_url,
|
|
1553
1564
|
url_variables=url_variables,
|
|
1554
1565
|
request=request,
|
|
@@ -1607,7 +1618,7 @@ class MistralAgents(BaseSDK):
|
|
|
1607
1618
|
self,
|
|
1608
1619
|
*,
|
|
1609
1620
|
agent_id: str,
|
|
1610
|
-
version:
|
|
1621
|
+
version: str,
|
|
1611
1622
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1612
1623
|
server_url: Optional[str] = None,
|
|
1613
1624
|
timeout_ms: Optional[int] = None,
|
|
@@ -1641,7 +1652,7 @@ class MistralAgents(BaseSDK):
|
|
|
1641
1652
|
|
|
1642
1653
|
req = self._build_request_async(
|
|
1643
1654
|
method="GET",
|
|
1644
|
-
path="/v1/agents/{agent_id}/
|
|
1655
|
+
path="/v1/agents/{agent_id}/versions/{version}",
|
|
1645
1656
|
base_url=base_url,
|
|
1646
1657
|
url_variables=url_variables,
|
|
1647
1658
|
request=request,
|
|
@@ -1695,3 +1706,375 @@ class MistralAgents(BaseSDK):
|
|
|
1695
1706
|
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1696
1707
|
|
|
1697
1708
|
raise models.SDKError("Unexpected response received", http_res)
|
|
1709
|
+
|
|
1710
|
+
def create_version_alias(
|
|
1711
|
+
self,
|
|
1712
|
+
*,
|
|
1713
|
+
agent_id: str,
|
|
1714
|
+
alias: str,
|
|
1715
|
+
version: int,
|
|
1716
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1717
|
+
server_url: Optional[str] = None,
|
|
1718
|
+
timeout_ms: Optional[int] = None,
|
|
1719
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1720
|
+
) -> models.AgentAliasResponse:
|
|
1721
|
+
r"""Create or update an agent version alias.
|
|
1722
|
+
|
|
1723
|
+
Create a new alias or update an existing alias to point to a specific version. Aliases are unique per agent and can be reassigned to different versions.
|
|
1724
|
+
|
|
1725
|
+
:param agent_id:
|
|
1726
|
+
:param alias:
|
|
1727
|
+
:param version:
|
|
1728
|
+
:param retries: Override the default retry configuration for this method
|
|
1729
|
+
:param server_url: Override the default server URL for this method
|
|
1730
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1731
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1732
|
+
"""
|
|
1733
|
+
base_url = None
|
|
1734
|
+
url_variables = None
|
|
1735
|
+
if timeout_ms is None:
|
|
1736
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1737
|
+
|
|
1738
|
+
if server_url is not None:
|
|
1739
|
+
base_url = server_url
|
|
1740
|
+
else:
|
|
1741
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1742
|
+
|
|
1743
|
+
request = models.AgentsAPIV1AgentsCreateOrUpdateAliasRequest(
|
|
1744
|
+
agent_id=agent_id,
|
|
1745
|
+
alias=alias,
|
|
1746
|
+
version=version,
|
|
1747
|
+
)
|
|
1748
|
+
|
|
1749
|
+
req = self._build_request(
|
|
1750
|
+
method="PUT",
|
|
1751
|
+
path="/v1/agents/{agent_id}/aliases",
|
|
1752
|
+
base_url=base_url,
|
|
1753
|
+
url_variables=url_variables,
|
|
1754
|
+
request=request,
|
|
1755
|
+
request_body_required=False,
|
|
1756
|
+
request_has_path_params=True,
|
|
1757
|
+
request_has_query_params=True,
|
|
1758
|
+
user_agent_header="user-agent",
|
|
1759
|
+
accept_header_value="application/json",
|
|
1760
|
+
http_headers=http_headers,
|
|
1761
|
+
security=self.sdk_configuration.security,
|
|
1762
|
+
allow_empty_value=None,
|
|
1763
|
+
timeout_ms=timeout_ms,
|
|
1764
|
+
)
|
|
1765
|
+
|
|
1766
|
+
if retries == UNSET:
|
|
1767
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1768
|
+
retries = self.sdk_configuration.retry_config
|
|
1769
|
+
|
|
1770
|
+
retry_config = None
|
|
1771
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1772
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1773
|
+
|
|
1774
|
+
http_res = self.do_request(
|
|
1775
|
+
hook_ctx=HookContext(
|
|
1776
|
+
config=self.sdk_configuration,
|
|
1777
|
+
base_url=base_url or "",
|
|
1778
|
+
operation_id="agents_api_v1_agents_create_or_update_alias",
|
|
1779
|
+
oauth2_scopes=None,
|
|
1780
|
+
security_source=get_security_from_env(
|
|
1781
|
+
self.sdk_configuration.security, models.Security
|
|
1782
|
+
),
|
|
1783
|
+
),
|
|
1784
|
+
request=req,
|
|
1785
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1786
|
+
retry_config=retry_config,
|
|
1787
|
+
)
|
|
1788
|
+
|
|
1789
|
+
response_data: Any = None
|
|
1790
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1791
|
+
return unmarshal_json_response(models.AgentAliasResponse, http_res)
|
|
1792
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1793
|
+
response_data = unmarshal_json_response(
|
|
1794
|
+
models.HTTPValidationErrorData, http_res
|
|
1795
|
+
)
|
|
1796
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1797
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1798
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1799
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1800
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1801
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1802
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1803
|
+
|
|
1804
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1805
|
+
|
|
1806
|
+
async def create_version_alias_async(
|
|
1807
|
+
self,
|
|
1808
|
+
*,
|
|
1809
|
+
agent_id: str,
|
|
1810
|
+
alias: str,
|
|
1811
|
+
version: int,
|
|
1812
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1813
|
+
server_url: Optional[str] = None,
|
|
1814
|
+
timeout_ms: Optional[int] = None,
|
|
1815
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1816
|
+
) -> models.AgentAliasResponse:
|
|
1817
|
+
r"""Create or update an agent version alias.
|
|
1818
|
+
|
|
1819
|
+
Create a new alias or update an existing alias to point to a specific version. Aliases are unique per agent and can be reassigned to different versions.
|
|
1820
|
+
|
|
1821
|
+
:param agent_id:
|
|
1822
|
+
:param alias:
|
|
1823
|
+
:param version:
|
|
1824
|
+
:param retries: Override the default retry configuration for this method
|
|
1825
|
+
:param server_url: Override the default server URL for this method
|
|
1826
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1827
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1828
|
+
"""
|
|
1829
|
+
base_url = None
|
|
1830
|
+
url_variables = None
|
|
1831
|
+
if timeout_ms is None:
|
|
1832
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1833
|
+
|
|
1834
|
+
if server_url is not None:
|
|
1835
|
+
base_url = server_url
|
|
1836
|
+
else:
|
|
1837
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1838
|
+
|
|
1839
|
+
request = models.AgentsAPIV1AgentsCreateOrUpdateAliasRequest(
|
|
1840
|
+
agent_id=agent_id,
|
|
1841
|
+
alias=alias,
|
|
1842
|
+
version=version,
|
|
1843
|
+
)
|
|
1844
|
+
|
|
1845
|
+
req = self._build_request_async(
|
|
1846
|
+
method="PUT",
|
|
1847
|
+
path="/v1/agents/{agent_id}/aliases",
|
|
1848
|
+
base_url=base_url,
|
|
1849
|
+
url_variables=url_variables,
|
|
1850
|
+
request=request,
|
|
1851
|
+
request_body_required=False,
|
|
1852
|
+
request_has_path_params=True,
|
|
1853
|
+
request_has_query_params=True,
|
|
1854
|
+
user_agent_header="user-agent",
|
|
1855
|
+
accept_header_value="application/json",
|
|
1856
|
+
http_headers=http_headers,
|
|
1857
|
+
security=self.sdk_configuration.security,
|
|
1858
|
+
allow_empty_value=None,
|
|
1859
|
+
timeout_ms=timeout_ms,
|
|
1860
|
+
)
|
|
1861
|
+
|
|
1862
|
+
if retries == UNSET:
|
|
1863
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1864
|
+
retries = self.sdk_configuration.retry_config
|
|
1865
|
+
|
|
1866
|
+
retry_config = None
|
|
1867
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1868
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1869
|
+
|
|
1870
|
+
http_res = await self.do_request_async(
|
|
1871
|
+
hook_ctx=HookContext(
|
|
1872
|
+
config=self.sdk_configuration,
|
|
1873
|
+
base_url=base_url or "",
|
|
1874
|
+
operation_id="agents_api_v1_agents_create_or_update_alias",
|
|
1875
|
+
oauth2_scopes=None,
|
|
1876
|
+
security_source=get_security_from_env(
|
|
1877
|
+
self.sdk_configuration.security, models.Security
|
|
1878
|
+
),
|
|
1879
|
+
),
|
|
1880
|
+
request=req,
|
|
1881
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1882
|
+
retry_config=retry_config,
|
|
1883
|
+
)
|
|
1884
|
+
|
|
1885
|
+
response_data: Any = None
|
|
1886
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1887
|
+
return unmarshal_json_response(models.AgentAliasResponse, http_res)
|
|
1888
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1889
|
+
response_data = unmarshal_json_response(
|
|
1890
|
+
models.HTTPValidationErrorData, http_res
|
|
1891
|
+
)
|
|
1892
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1893
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1894
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1895
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1896
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1897
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1898
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1899
|
+
|
|
1900
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1901
|
+
|
|
1902
|
+
def list_version_aliases(
|
|
1903
|
+
self,
|
|
1904
|
+
*,
|
|
1905
|
+
agent_id: str,
|
|
1906
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1907
|
+
server_url: Optional[str] = None,
|
|
1908
|
+
timeout_ms: Optional[int] = None,
|
|
1909
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1910
|
+
) -> List[models.AgentAliasResponse]:
|
|
1911
|
+
r"""List all aliases for an agent.
|
|
1912
|
+
|
|
1913
|
+
Retrieve all version aliases for a specific agent.
|
|
1914
|
+
|
|
1915
|
+
:param agent_id:
|
|
1916
|
+
:param retries: Override the default retry configuration for this method
|
|
1917
|
+
:param server_url: Override the default server URL for this method
|
|
1918
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1919
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1920
|
+
"""
|
|
1921
|
+
base_url = None
|
|
1922
|
+
url_variables = None
|
|
1923
|
+
if timeout_ms is None:
|
|
1924
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1925
|
+
|
|
1926
|
+
if server_url is not None:
|
|
1927
|
+
base_url = server_url
|
|
1928
|
+
else:
|
|
1929
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1930
|
+
|
|
1931
|
+
request = models.AgentsAPIV1AgentsListVersionAliasesRequest(
|
|
1932
|
+
agent_id=agent_id,
|
|
1933
|
+
)
|
|
1934
|
+
|
|
1935
|
+
req = self._build_request(
|
|
1936
|
+
method="GET",
|
|
1937
|
+
path="/v1/agents/{agent_id}/aliases",
|
|
1938
|
+
base_url=base_url,
|
|
1939
|
+
url_variables=url_variables,
|
|
1940
|
+
request=request,
|
|
1941
|
+
request_body_required=False,
|
|
1942
|
+
request_has_path_params=True,
|
|
1943
|
+
request_has_query_params=True,
|
|
1944
|
+
user_agent_header="user-agent",
|
|
1945
|
+
accept_header_value="application/json",
|
|
1946
|
+
http_headers=http_headers,
|
|
1947
|
+
security=self.sdk_configuration.security,
|
|
1948
|
+
allow_empty_value=None,
|
|
1949
|
+
timeout_ms=timeout_ms,
|
|
1950
|
+
)
|
|
1951
|
+
|
|
1952
|
+
if retries == UNSET:
|
|
1953
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1954
|
+
retries = self.sdk_configuration.retry_config
|
|
1955
|
+
|
|
1956
|
+
retry_config = None
|
|
1957
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1958
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1959
|
+
|
|
1960
|
+
http_res = self.do_request(
|
|
1961
|
+
hook_ctx=HookContext(
|
|
1962
|
+
config=self.sdk_configuration,
|
|
1963
|
+
base_url=base_url or "",
|
|
1964
|
+
operation_id="agents_api_v1_agents_list_version_aliases",
|
|
1965
|
+
oauth2_scopes=None,
|
|
1966
|
+
security_source=get_security_from_env(
|
|
1967
|
+
self.sdk_configuration.security, models.Security
|
|
1968
|
+
),
|
|
1969
|
+
),
|
|
1970
|
+
request=req,
|
|
1971
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
1972
|
+
retry_config=retry_config,
|
|
1973
|
+
)
|
|
1974
|
+
|
|
1975
|
+
response_data: Any = None
|
|
1976
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1977
|
+
return unmarshal_json_response(List[models.AgentAliasResponse], http_res)
|
|
1978
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1979
|
+
response_data = unmarshal_json_response(
|
|
1980
|
+
models.HTTPValidationErrorData, http_res
|
|
1981
|
+
)
|
|
1982
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
1983
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1984
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1985
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1986
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
1987
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1988
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
1989
|
+
|
|
1990
|
+
raise models.SDKError("Unexpected response received", http_res)
|
|
1991
|
+
|
|
1992
|
+
async def list_version_aliases_async(
|
|
1993
|
+
self,
|
|
1994
|
+
*,
|
|
1995
|
+
agent_id: str,
|
|
1996
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1997
|
+
server_url: Optional[str] = None,
|
|
1998
|
+
timeout_ms: Optional[int] = None,
|
|
1999
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
2000
|
+
) -> List[models.AgentAliasResponse]:
|
|
2001
|
+
r"""List all aliases for an agent.
|
|
2002
|
+
|
|
2003
|
+
Retrieve all version aliases for a specific agent.
|
|
2004
|
+
|
|
2005
|
+
:param agent_id:
|
|
2006
|
+
:param retries: Override the default retry configuration for this method
|
|
2007
|
+
:param server_url: Override the default server URL for this method
|
|
2008
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
2009
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
2010
|
+
"""
|
|
2011
|
+
base_url = None
|
|
2012
|
+
url_variables = None
|
|
2013
|
+
if timeout_ms is None:
|
|
2014
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
2015
|
+
|
|
2016
|
+
if server_url is not None:
|
|
2017
|
+
base_url = server_url
|
|
2018
|
+
else:
|
|
2019
|
+
base_url = self._get_url(base_url, url_variables)
|
|
2020
|
+
|
|
2021
|
+
request = models.AgentsAPIV1AgentsListVersionAliasesRequest(
|
|
2022
|
+
agent_id=agent_id,
|
|
2023
|
+
)
|
|
2024
|
+
|
|
2025
|
+
req = self._build_request_async(
|
|
2026
|
+
method="GET",
|
|
2027
|
+
path="/v1/agents/{agent_id}/aliases",
|
|
2028
|
+
base_url=base_url,
|
|
2029
|
+
url_variables=url_variables,
|
|
2030
|
+
request=request,
|
|
2031
|
+
request_body_required=False,
|
|
2032
|
+
request_has_path_params=True,
|
|
2033
|
+
request_has_query_params=True,
|
|
2034
|
+
user_agent_header="user-agent",
|
|
2035
|
+
accept_header_value="application/json",
|
|
2036
|
+
http_headers=http_headers,
|
|
2037
|
+
security=self.sdk_configuration.security,
|
|
2038
|
+
allow_empty_value=None,
|
|
2039
|
+
timeout_ms=timeout_ms,
|
|
2040
|
+
)
|
|
2041
|
+
|
|
2042
|
+
if retries == UNSET:
|
|
2043
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
2044
|
+
retries = self.sdk_configuration.retry_config
|
|
2045
|
+
|
|
2046
|
+
retry_config = None
|
|
2047
|
+
if isinstance(retries, utils.RetryConfig):
|
|
2048
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
2049
|
+
|
|
2050
|
+
http_res = await self.do_request_async(
|
|
2051
|
+
hook_ctx=HookContext(
|
|
2052
|
+
config=self.sdk_configuration,
|
|
2053
|
+
base_url=base_url or "",
|
|
2054
|
+
operation_id="agents_api_v1_agents_list_version_aliases",
|
|
2055
|
+
oauth2_scopes=None,
|
|
2056
|
+
security_source=get_security_from_env(
|
|
2057
|
+
self.sdk_configuration.security, models.Security
|
|
2058
|
+
),
|
|
2059
|
+
),
|
|
2060
|
+
request=req,
|
|
2061
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
2062
|
+
retry_config=retry_config,
|
|
2063
|
+
)
|
|
2064
|
+
|
|
2065
|
+
response_data: Any = None
|
|
2066
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
2067
|
+
return unmarshal_json_response(List[models.AgentAliasResponse], http_res)
|
|
2068
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
2069
|
+
response_data = unmarshal_json_response(
|
|
2070
|
+
models.HTTPValidationErrorData, http_res
|
|
2071
|
+
)
|
|
2072
|
+
raise models.HTTPValidationError(response_data, http_res)
|
|
2073
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
2074
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2075
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
2076
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
2077
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
2078
|
+
raise models.SDKError("API error occurred", http_res, http_res_text)
|
|
2079
|
+
|
|
2080
|
+
raise models.SDKError("Unexpected response received", http_res)
|