Skip to content

Commit 04fabfd

Browse files
feat(api): update via SDK Studio
1 parent feab9f8 commit 04fabfd

32 files changed

+1370
-768
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 31
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-1a0953dc66ce8db792aafbd041002cc13f32b899808423f92834a0621afd08da.yml
3-
openapi_spec_hash: 1935056f9a730857d94060d89f458143
4-
config_hash: 1ecef0ff4fd125bbc00eec65e3dd4798
1+
configured_endpoints: 34
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/contextual-ai%2Fsunrise-db7245c74772a8cd47c02886619fed0568fbb58b1fa8aba0dc77524b924a4fb6.yml
3+
openapi_spec_hash: ca3de8d7b14b78683e39464fe7d4b1e1
4+
config_hash: 410f8a2f86f605885911277be47c3c78

api.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ from contextual.types import (
88
Datastore,
99
DatastoreMetadata,
1010
ListDatastoresResponse,
11+
DatastoreUpdateResponse,
1112
)
1213
```
1314

1415
Methods:
1516

1617
- <code title="post /datastores">client.datastores.<a href="./src/contextual/resources/datastores/datastores.py">create</a>(\*\*<a href="src/contextual/types/datastore_create_params.py">params</a>) -> <a href="./src/contextual/types/create_datastore_response.py">CreateDatastoreResponse</a></code>
18+
- <code title="put /datastores/{datastore_id}">client.datastores.<a href="./src/contextual/resources/datastores/datastores.py">update</a>(datastore_id, \*\*<a href="src/contextual/types/datastore_update_params.py">params</a>) -> <a href="./src/contextual/types/datastore_update_response.py">DatastoreUpdateResponse</a></code>
1719
- <code title="get /datastores">client.datastores.<a href="./src/contextual/resources/datastores/datastores.py">list</a>(\*\*<a href="src/contextual/types/datastore_list_params.py">params</a>) -> <a href="./src/contextual/types/datastore.py">SyncDatastoresPage[Datastore]</a></code>
1820
- <code title="delete /datastores/{datastore_id}">client.datastores.<a href="./src/contextual/resources/datastores/datastores.py">delete</a>(datastore_id) -> object</code>
1921
- <code title="get /datastores/{datastore_id}/metadata">client.datastores.<a href="./src/contextual/resources/datastores/datastores.py">metadata</a>(datastore_id) -> <a href="./src/contextual/types/datastore_metadata.py">DatastoreMetadata</a></code>
@@ -24,13 +26,21 @@ Methods:
2426
Types:
2527

2628
```python
27-
from contextual.types.datastores import DocumentMetadata, IngestionResponse, ListDocumentsResponse
29+
from contextual.types.datastores import (
30+
BaseMetadataFilter,
31+
CompositeMetadataFilter,
32+
DocumentMetadata,
33+
IngestionResponse,
34+
ListDocumentsResponse,
35+
DocumentGetParseResultResponse,
36+
)
2837
```
2938

3039
Methods:
3140

3241
- <code title="get /datastores/{datastore_id}/documents">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">list</a>(datastore_id, \*\*<a href="src/contextual/types/datastores/document_list_params.py">params</a>) -> <a href="./src/contextual/types/datastores/document_metadata.py">SyncDocumentsPage[DocumentMetadata]</a></code>
3342
- <code title="delete /datastores/{datastore_id}/documents/{document_id}">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">delete</a>(document_id, \*, datastore_id) -> object</code>
43+
- <code title="get /datastores/{datastore_id}/documents/{document_id}/parse">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">get_parse_result</a>(document_id, \*, datastore_id, \*\*<a href="src/contextual/types/datastores/document_get_parse_result_params.py">params</a>) -> <a href="./src/contextual/types/datastores/document_get_parse_result_response.py">DocumentGetParseResultResponse</a></code>
3444
- <code title="post /datastores/{datastore_id}/documents">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">ingest</a>(datastore_id, \*\*<a href="src/contextual/types/datastores/document_ingest_params.py">params</a>) -> <a href="./src/contextual/types/datastores/ingestion_response.py">IngestionResponse</a></code>
3545
- <code title="get /datastores/{datastore_id}/documents/{document_id}/metadata">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">metadata</a>(document_id, \*, datastore_id) -> <a href="./src/contextual/types/datastores/document_metadata.py">DocumentMetadata</a></code>
3646
- <code title="post /datastores/{datastore_id}/documents/{document_id}/metadata">client.datastores.documents.<a href="./src/contextual/resources/datastores/documents.py">set_metadata</a>(document_id, \*, datastore_id, \*\*<a href="src/contextual/types/datastores/document_set_metadata_params.py">params</a>) -> <a href="./src/contextual/types/datastores/document_metadata.py">DocumentMetadata</a></code>
@@ -42,8 +52,10 @@ Types:
4252
```python
4353
from contextual.types import (
4454
Agent,
55+
AgentConfigs,
4556
AgentMetadata,
4657
CreateAgentOutput,
58+
FilterAndRerankConfig,
4759
GenerateResponseConfig,
4860
GlobalConfig,
4961
ListAgentsResponse,
@@ -58,6 +70,7 @@ Methods:
5870
- <code title="put /agents/{agent_id}">client.agents.<a href="./src/contextual/resources/agents/agents.py">update</a>(agent_id, \*\*<a href="src/contextual/types/agent_update_params.py">params</a>) -> object</code>
5971
- <code title="get /agents">client.agents.<a href="./src/contextual/resources/agents/agents.py">list</a>(\*\*<a href="src/contextual/types/agent_list_params.py">params</a>) -> <a href="./src/contextual/types/agent.py">SyncPage[Agent]</a></code>
6072
- <code title="delete /agents/{agent_id}">client.agents.<a href="./src/contextual/resources/agents/agents.py">delete</a>(agent_id) -> object</code>
73+
- <code title="post /agents/{agent_id}/copy">client.agents.<a href="./src/contextual/resources/agents/agents.py">copy</a>(agent_id) -> <a href="./src/contextual/types/create_agent_output.py">CreateAgentOutput</a></code>
6174
- <code title="get /agents/{agent_id}/metadata">client.agents.<a href="./src/contextual/resources/agents/agents.py">metadata</a>(agent_id) -> <a href="./src/contextual/types/agent_metadata_response.py">AgentMetadataResponse</a></code>
6275
- <code title="put /agents/{agent_id}/reset">client.agents.<a href="./src/contextual/resources/agents/agents.py">reset</a>(agent_id) -> object</code>
6376

src/contextual/resources/agents/agents.py

Lines changed: 89 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from ...pagination import SyncPage, AsyncPage
2929
from ...types.agent import Agent
3030
from ..._base_client import AsyncPaginator, make_request_options
31+
from ...types.agent_configs_param import AgentConfigsParam
3132
from ...types.create_agent_output import CreateAgentOutput
3233
from ...types.agent_metadata_response import AgentMetadataResponse
3334

@@ -62,7 +63,7 @@ def create(
6263
self,
6364
*,
6465
name: str,
65-
agent_configs: agent_create_params.AgentConfigs | NotGiven = NOT_GIVEN,
66+
agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN,
6667
datastore_ids: List[str] | NotGiven = NOT_GIVEN,
6768
description: str | NotGiven = NOT_GIVEN,
6869
filter_prompt: str | NotGiven = NOT_GIVEN,
@@ -154,7 +155,7 @@ def update(
154155
self,
155156
agent_id: str,
156157
*,
157-
agent_configs: agent_update_params.AgentConfigs | NotGiven = NOT_GIVEN,
158+
agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN,
158159
datastore_ids: List[str] | NotGiven = NOT_GIVEN,
159160
filter_prompt: str | NotGiven = NOT_GIVEN,
160161
llm_model_id: str | NotGiven = NOT_GIVEN,
@@ -320,6 +321,42 @@ def delete(
320321
cast_to=object,
321322
)
322323

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+
323360
def metadata(
324361
self,
325362
agent_id: str,
@@ -424,7 +461,7 @@ async def create(
424461
self,
425462
*,
426463
name: str,
427-
agent_configs: agent_create_params.AgentConfigs | NotGiven = NOT_GIVEN,
464+
agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN,
428465
datastore_ids: List[str] | NotGiven = NOT_GIVEN,
429466
description: str | NotGiven = NOT_GIVEN,
430467
filter_prompt: str | NotGiven = NOT_GIVEN,
@@ -516,7 +553,7 @@ async def update(
516553
self,
517554
agent_id: str,
518555
*,
519-
agent_configs: agent_update_params.AgentConfigs | NotGiven = NOT_GIVEN,
556+
agent_configs: AgentConfigsParam | NotGiven = NOT_GIVEN,
520557
datastore_ids: List[str] | NotGiven = NOT_GIVEN,
521558
filter_prompt: str | NotGiven = NOT_GIVEN,
522559
llm_model_id: str | NotGiven = NOT_GIVEN,
@@ -682,6 +719,42 @@ async def delete(
682719
cast_to=object,
683720
)
684721

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+
685758
async def metadata(
686759
self,
687760
agent_id: str,
@@ -774,6 +847,9 @@ def __init__(self, agents: AgentsResource) -> None:
774847
self.delete = to_raw_response_wrapper(
775848
agents.delete,
776849
)
850+
self.copy = to_raw_response_wrapper(
851+
agents.copy,
852+
)
777853
self.metadata = to_raw_response_wrapper(
778854
agents.metadata,
779855
)
@@ -802,6 +878,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
802878
self.delete = async_to_raw_response_wrapper(
803879
agents.delete,
804880
)
881+
self.copy = async_to_raw_response_wrapper(
882+
agents.copy,
883+
)
805884
self.metadata = async_to_raw_response_wrapper(
806885
agents.metadata,
807886
)
@@ -830,6 +909,9 @@ def __init__(self, agents: AgentsResource) -> None:
830909
self.delete = to_streamed_response_wrapper(
831910
agents.delete,
832911
)
912+
self.copy = to_streamed_response_wrapper(
913+
agents.copy,
914+
)
833915
self.metadata = to_streamed_response_wrapper(
834916
agents.metadata,
835917
)
@@ -858,6 +940,9 @@ def __init__(self, agents: AsyncAgentsResource) -> None:
858940
self.delete = async_to_streamed_response_wrapper(
859941
agents.delete,
860942
)
943+
self.copy = async_to_streamed_response_wrapper(
944+
agents.copy,
945+
)
861946
self.metadata = async_to_streamed_response_wrapper(
862947
agents.metadata,
863948
)

0 commit comments

Comments
 (0)