|
28 | 28 | from ...pagination import SyncPage, AsyncPage |
29 | 29 | from ...types.agent import Agent |
30 | 30 | from ..._base_client import AsyncPaginator, make_request_options |
| 31 | +from ...types.agent_configs_param import AgentConfigsParam |
31 | 32 | from ...types.create_agent_output import CreateAgentOutput |
32 | 33 | from ...types.agent_metadata_response import AgentMetadataResponse |
33 | 34 |
|
@@ -62,7 +63,7 @@ def create( |
62 | 63 | self, |
63 | 64 | *, |
64 | 65 | name: str, |
65 | | - agent_configs: agent_create_params.AgentConfigs | NotGiven = NOT_GIVEN, |
| 66 | + agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN, |
66 | 67 | datastore_ids: List[str] | NotGiven = NOT_GIVEN, |
67 | 68 | description: str | NotGiven = NOT_GIVEN, |
68 | 69 | filter_prompt: str | NotGiven = NOT_GIVEN, |
@@ -154,7 +155,7 @@ def update( |
154 | 155 | self, |
155 | 156 | agent_id: str, |
156 | 157 | *, |
157 | | - agent_configs: agent_update_params.AgentConfigs | NotGiven = NOT_GIVEN, |
| 158 | + agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN, |
158 | 159 | datastore_ids: List[str] | NotGiven = NOT_GIVEN, |
159 | 160 | filter_prompt: str | NotGiven = NOT_GIVEN, |
160 | 161 | llm_model_id: str | NotGiven = NOT_GIVEN, |
@@ -320,6 +321,42 @@ def delete( |
320 | 321 | cast_to=object, |
321 | 322 | ) |
322 | 323 |
|
| 324 | + def copy( |
| 325 | + self, |
| 326 | + agent_id: str, |
| 327 | + *, |
| 328 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 329 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 330 | + extra_headers: Headers | None = None, |
| 331 | + extra_query: Query | None = None, |
| 332 | + extra_body: Body | None = None, |
| 333 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 334 | + ) -> CreateAgentOutput: |
| 335 | + """ |
| 336 | + Copy an existing agent with all its configurations and datastore associations. |
| 337 | + The copied agent will have "[COPY]" appended to its name. |
| 338 | +
|
| 339 | + Args: |
| 340 | + agent_id: ID of the agent to copy |
| 341 | +
|
| 342 | + extra_headers: Send extra headers |
| 343 | +
|
| 344 | + extra_query: Add additional query parameters to the request |
| 345 | +
|
| 346 | + extra_body: Add additional JSON properties to the request |
| 347 | +
|
| 348 | + timeout: Override the client-level default timeout for this request, in seconds |
| 349 | + """ |
| 350 | + if not agent_id: |
| 351 | + raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}") |
| 352 | + return self._post( |
| 353 | + f"/agents/{agent_id}/copy", |
| 354 | + options=make_request_options( |
| 355 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 356 | + ), |
| 357 | + cast_to=CreateAgentOutput, |
| 358 | + ) |
| 359 | + |
323 | 360 | def metadata( |
324 | 361 | self, |
325 | 362 | agent_id: str, |
@@ -424,7 +461,7 @@ async def create( |
424 | 461 | self, |
425 | 462 | *, |
426 | 463 | name: str, |
427 | | - agent_configs: agent_create_params.AgentConfigs | NotGiven = NOT_GIVEN, |
| 464 | + agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN, |
428 | 465 | datastore_ids: List[str] | NotGiven = NOT_GIVEN, |
429 | 466 | description: str | NotGiven = NOT_GIVEN, |
430 | 467 | filter_prompt: str | NotGiven = NOT_GIVEN, |
@@ -516,7 +553,7 @@ async def update( |
516 | 553 | self, |
517 | 554 | agent_id: str, |
518 | 555 | *, |
519 | | - agent_configs: agent_update_params.AgentConfigs | NotGiven = NOT_GIVEN, |
| 556 | + agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN, |
520 | 557 | datastore_ids: List[str] | NotGiven = NOT_GIVEN, |
521 | 558 | filter_prompt: str | NotGiven = NOT_GIVEN, |
522 | 559 | llm_model_id: str | NotGiven = NOT_GIVEN, |
@@ -682,6 +719,42 @@ async def delete( |
682 | 719 | cast_to=object, |
683 | 720 | ) |
684 | 721 |
|
| 722 | + async def copy( |
| 723 | + self, |
| 724 | + agent_id: str, |
| 725 | + *, |
| 726 | + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 727 | + # The extra values given here take precedence over values defined on the client or passed to this method. |
| 728 | + extra_headers: Headers | None = None, |
| 729 | + extra_query: Query | None = None, |
| 730 | + extra_body: Body | None = None, |
| 731 | + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, |
| 732 | + ) -> CreateAgentOutput: |
| 733 | + """ |
| 734 | + Copy an existing agent with all its configurations and datastore associations. |
| 735 | + The copied agent will have "[COPY]" appended to its name. |
| 736 | +
|
| 737 | + Args: |
| 738 | + agent_id: ID of the agent to copy |
| 739 | +
|
| 740 | + extra_headers: Send extra headers |
| 741 | +
|
| 742 | + extra_query: Add additional query parameters to the request |
| 743 | +
|
| 744 | + extra_body: Add additional JSON properties to the request |
| 745 | +
|
| 746 | + timeout: Override the client-level default timeout for this request, in seconds |
| 747 | + """ |
| 748 | + if not agent_id: |
| 749 | + raise ValueError(f"Expected a non-empty value for `agent_id` but received {agent_id!r}") |
| 750 | + return await self._post( |
| 751 | + f"/agents/{agent_id}/copy", |
| 752 | + options=make_request_options( |
| 753 | + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 754 | + ), |
| 755 | + cast_to=CreateAgentOutput, |
| 756 | + ) |
| 757 | + |
685 | 758 | async def metadata( |
686 | 759 | self, |
687 | 760 | agent_id: str, |
@@ -774,6 +847,9 @@ def __init__(self, agents: AgentsResource) -> None: |
774 | 847 | self.delete = to_raw_response_wrapper( |
775 | 848 | agents.delete, |
776 | 849 | ) |
| 850 | + self.copy = to_raw_response_wrapper( |
| 851 | + agents.copy, |
| 852 | + ) |
777 | 853 | self.metadata = to_raw_response_wrapper( |
778 | 854 | agents.metadata, |
779 | 855 | ) |
@@ -802,6 +878,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: |
802 | 878 | self.delete = async_to_raw_response_wrapper( |
803 | 879 | agents.delete, |
804 | 880 | ) |
| 881 | + self.copy = async_to_raw_response_wrapper( |
| 882 | + agents.copy, |
| 883 | + ) |
805 | 884 | self.metadata = async_to_raw_response_wrapper( |
806 | 885 | agents.metadata, |
807 | 886 | ) |
@@ -830,6 +909,9 @@ def __init__(self, agents: AgentsResource) -> None: |
830 | 909 | self.delete = to_streamed_response_wrapper( |
831 | 910 | agents.delete, |
832 | 911 | ) |
| 912 | + self.copy = to_streamed_response_wrapper( |
| 913 | + agents.copy, |
| 914 | + ) |
833 | 915 | self.metadata = to_streamed_response_wrapper( |
834 | 916 | agents.metadata, |
835 | 917 | ) |
@@ -858,6 +940,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None: |
858 | 940 | self.delete = async_to_streamed_response_wrapper( |
859 | 941 | agents.delete, |
860 | 942 | ) |
| 943 | + self.copy = async_to_streamed_response_wrapper( |
| 944 | + agents.copy, |
| 945 | + ) |
861 | 946 | self.metadata = async_to_streamed_response_wrapper( |
862 | 947 | agents.metadata, |
863 | 948 | ) |
|
0 commit comments