Skip to content

Commit cb30efd

Browse files
SDK regeneration
1 parent 2af946e commit cb30efd

File tree

10 files changed

+584
-3
lines changed

10 files changed

+584
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "credal"
33

44
[tool.poetry]
55
name = "credal"
6-
version = "0.1.13"
6+
version = "0.1.14"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,129 @@ client.copilots.delete_copilot(
837837
</dl>
838838

839839

840+
</dd>
841+
</dl>
842+
</details>
843+
844+
<details><summary><code>client.copilots.<a href="src/credal/copilots/client.py">export</a>(...)</code></summary>
845+
<dl>
846+
<dd>
847+
848+
#### 📝 Description
849+
850+
<dl>
851+
<dd>
852+
853+
<dl>
854+
<dd>
855+
856+
Export copilot configurations for backup or migration purposes.
857+
858+
**IMPORTANT**: This endpoint requires:
859+
- Admin privileges
860+
- The 'ai-usage-analytics-log.export' scope on the API key
861+
862+
Returns all deployed copilots with their full configuration including model settings, tools, and deployment details. Optional date filters can be applied to narrow down results.
863+
</dd>
864+
</dl>
865+
</dd>
866+
</dl>
867+
868+
#### 🔌 Usage
869+
870+
<dl>
871+
<dd>
872+
873+
<dl>
874+
<dd>
875+
876+
```python
877+
import datetime
878+
879+
from credal import CredalApi
880+
881+
client = CredalApi(
882+
api_key="YOUR_API_KEY",
883+
)
884+
client.copilots.export(
885+
agent_created_from=datetime.datetime.fromisoformat(
886+
"2024-01-01 00:00:00+00:00",
887+
),
888+
agent_created_to=datetime.datetime.fromisoformat(
889+
"2024-12-31 23:59:59+00:00",
890+
),
891+
)
892+
893+
```
894+
</dd>
895+
</dl>
896+
</dd>
897+
</dl>
898+
899+
#### ⚙️ Parameters
900+
901+
<dl>
902+
<dd>
903+
904+
<dl>
905+
<dd>
906+
907+
**agent_created_from:** `typing.Optional[dt.datetime]` — Filter copilots created on or after this datetime (ISO 8601 format).
908+
909+
</dd>
910+
</dl>
911+
912+
<dl>
913+
<dd>
914+
915+
**agent_created_to:** `typing.Optional[dt.datetime]` — Filter copilots created before or on this datetime (ISO 8601 format).
916+
917+
</dd>
918+
</dl>
919+
920+
<dl>
921+
<dd>
922+
923+
**version_created_from:** `typing.Optional[dt.datetime]` — Filter copilot versions created on or after this datetime (ISO 8601 format).
924+
925+
</dd>
926+
</dl>
927+
928+
<dl>
929+
<dd>
930+
931+
**version_created_to:** `typing.Optional[dt.datetime]` — Filter copilot versions created before or on this datetime (ISO 8601 format).
932+
933+
</dd>
934+
</dl>
935+
936+
<dl>
937+
<dd>
938+
939+
**limit:** `typing.Optional[int]` — Maximum number of copilots to return. Must be a positive integer with a maximum value of 1000. Defaults to 100.
940+
941+
</dd>
942+
</dl>
943+
944+
<dl>
945+
<dd>
946+
947+
**cursor:** `typing.Optional[str]` — Cursor for pagination. Use the cursor returned in the previous response to fetch the next page of results. If not provided, returns the first page.
948+
949+
</dd>
950+
</dl>
951+
952+
<dl>
953+
<dd>
954+
955+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
956+
957+
</dd>
958+
</dl>
959+
</dd>
960+
</dl>
961+
962+
840963
</dd>
841964
</dl>
842965
</details>

src/credal/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
EndOfMessageChunk,
3636
ErrorChunk,
3737
ErrorChunkData,
38+
ExportCopilotsResponse,
39+
ExportedCopilot,
3840
FeedbackEnum,
3941
Filter,
4042
Filter_Boolean,
@@ -116,6 +118,8 @@
116118
"EndOfMessageChunk": ".copilots",
117119
"ErrorChunk": ".copilots",
118120
"ErrorChunkData": ".copilots",
121+
"ExportCopilotsResponse": ".copilots",
122+
"ExportedCopilot": ".copilots",
119123
"ExternalResourceId": ".common",
120124
"FeedbackEnum": ".copilots",
121125
"Filter": ".copilots",
@@ -221,6 +225,8 @@ def __dir__():
221225
"EndOfMessageChunk",
222226
"ErrorChunk",
223227
"ErrorChunkData",
228+
"ExportCopilotsResponse",
229+
"ExportedCopilot",
224230
"ExternalResourceId",
225231
"FeedbackEnum",
226232
"Filter",

src/credal/copilots/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
EndOfMessageChunk,
2222
ErrorChunk,
2323
ErrorChunkData,
24+
ExportCopilotsResponse,
25+
ExportedCopilot,
2426
FeedbackEnum,
2527
Filter,
2628
Filter_Boolean,
@@ -66,6 +68,8 @@
6668
"EndOfMessageChunk": ".types",
6769
"ErrorChunk": ".types",
6870
"ErrorChunkData": ".types",
71+
"ExportCopilotsResponse": ".types",
72+
"ExportedCopilot": ".types",
6973
"FeedbackEnum": ".types",
7074
"Filter": ".types",
7175
"Filter_Boolean": ".types",
@@ -134,6 +138,8 @@ def __dir__():
134138
"EndOfMessageChunk",
135139
"ErrorChunk",
136140
"ErrorChunkData",
141+
"ExportCopilotsResponse",
142+
"ExportedCopilot",
137143
"FeedbackEnum",
138144
"Filter",
139145
"Filter_Boolean",

src/credal/copilots/client.py

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3+
import datetime as dt
34
import typing
45
import uuid
56

@@ -11,6 +12,7 @@
1112
from .types.create_conversation_response import CreateConversationResponse
1213
from .types.create_copilot_response import CreateCopilotResponse
1314
from .types.delete_copilot_response import DeleteCopilotResponse
15+
from .types.export_copilots_response import ExportCopilotsResponse
1416
from .types.input_variable import InputVariable
1517
from .types.message_feedback import MessageFeedback
1618
from .types.send_agent_message_response import SendAgentMessageResponse
@@ -552,6 +554,82 @@ def delete_copilot(
552554
_response = self._raw_client.delete_copilot(id=id, request_options=request_options)
553555
return _response.data
554556

557+
def export(
558+
self,
559+
*,
560+
agent_created_from: typing.Optional[dt.datetime] = OMIT,
561+
agent_created_to: typing.Optional[dt.datetime] = OMIT,
562+
version_created_from: typing.Optional[dt.datetime] = OMIT,
563+
version_created_to: typing.Optional[dt.datetime] = OMIT,
564+
limit: typing.Optional[int] = OMIT,
565+
cursor: typing.Optional[str] = OMIT,
566+
request_options: typing.Optional[RequestOptions] = None,
567+
) -> ExportCopilotsResponse:
568+
"""
569+
Export copilot configurations for backup or migration purposes.
570+
571+
**IMPORTANT**: This endpoint requires:
572+
- Admin privileges
573+
- The 'ai-usage-analytics-log.export' scope on the API key
574+
575+
Returns all deployed copilots with their full configuration including model settings, tools, and deployment details. Optional date filters can be applied to narrow down results.
576+
577+
Parameters
578+
----------
579+
agent_created_from : typing.Optional[dt.datetime]
580+
Filter copilots created on or after this datetime (ISO 8601 format).
581+
582+
agent_created_to : typing.Optional[dt.datetime]
583+
Filter copilots created before or on this datetime (ISO 8601 format).
584+
585+
version_created_from : typing.Optional[dt.datetime]
586+
Filter copilot versions created on or after this datetime (ISO 8601 format).
587+
588+
version_created_to : typing.Optional[dt.datetime]
589+
Filter copilot versions created before or on this datetime (ISO 8601 format).
590+
591+
limit : typing.Optional[int]
592+
Maximum number of copilots to return. Must be a positive integer with a maximum value of 1000. Defaults to 100.
593+
594+
cursor : typing.Optional[str]
595+
Cursor for pagination. Use the cursor returned in the previous response to fetch the next page of results. If not provided, returns the first page.
596+
597+
request_options : typing.Optional[RequestOptions]
598+
Request-specific configuration.
599+
600+
Returns
601+
-------
602+
ExportCopilotsResponse
603+
604+
Examples
605+
--------
606+
import datetime
607+
608+
from credal import CredalApi
609+
610+
client = CredalApi(
611+
api_key="YOUR_API_KEY",
612+
)
613+
client.copilots.export(
614+
agent_created_from=datetime.datetime.fromisoformat(
615+
"2024-01-01 00:00:00+00:00",
616+
),
617+
agent_created_to=datetime.datetime.fromisoformat(
618+
"2024-12-31 23:59:59+00:00",
619+
),
620+
)
621+
"""
622+
_response = self._raw_client.export(
623+
agent_created_from=agent_created_from,
624+
agent_created_to=agent_created_to,
625+
version_created_from=version_created_from,
626+
version_created_to=version_created_to,
627+
limit=limit,
628+
cursor=cursor,
629+
request_options=request_options,
630+
)
631+
return _response.data
632+
555633

556634
class AsyncCopilotsClient:
557635
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -1149,3 +1227,86 @@ async def main() -> None:
11491227
"""
11501228
_response = await self._raw_client.delete_copilot(id=id, request_options=request_options)
11511229
return _response.data
1230+
1231+
async def export(
1232+
self,
1233+
*,
1234+
agent_created_from: typing.Optional[dt.datetime] = OMIT,
1235+
agent_created_to: typing.Optional[dt.datetime] = OMIT,
1236+
version_created_from: typing.Optional[dt.datetime] = OMIT,
1237+
version_created_to: typing.Optional[dt.datetime] = OMIT,
1238+
limit: typing.Optional[int] = OMIT,
1239+
cursor: typing.Optional[str] = OMIT,
1240+
request_options: typing.Optional[RequestOptions] = None,
1241+
) -> ExportCopilotsResponse:
1242+
"""
1243+
Export copilot configurations for backup or migration purposes.
1244+
1245+
**IMPORTANT**: This endpoint requires:
1246+
- Admin privileges
1247+
- The 'ai-usage-analytics-log.export' scope on the API key
1248+
1249+
Returns all deployed copilots with their full configuration including model settings, tools, and deployment details. Optional date filters can be applied to narrow down results.
1250+
1251+
Parameters
1252+
----------
1253+
agent_created_from : typing.Optional[dt.datetime]
1254+
Filter copilots created on or after this datetime (ISO 8601 format).
1255+
1256+
agent_created_to : typing.Optional[dt.datetime]
1257+
Filter copilots created before or on this datetime (ISO 8601 format).
1258+
1259+
version_created_from : typing.Optional[dt.datetime]
1260+
Filter copilot versions created on or after this datetime (ISO 8601 format).
1261+
1262+
version_created_to : typing.Optional[dt.datetime]
1263+
Filter copilot versions created before or on this datetime (ISO 8601 format).
1264+
1265+
limit : typing.Optional[int]
1266+
Maximum number of copilots to return. Must be a positive integer with a maximum value of 1000. Defaults to 100.
1267+
1268+
cursor : typing.Optional[str]
1269+
Cursor for pagination. Use the cursor returned in the previous response to fetch the next page of results. If not provided, returns the first page.
1270+
1271+
request_options : typing.Optional[RequestOptions]
1272+
Request-specific configuration.
1273+
1274+
Returns
1275+
-------
1276+
ExportCopilotsResponse
1277+
1278+
Examples
1279+
--------
1280+
import asyncio
1281+
import datetime
1282+
1283+
from credal import AsyncCredalApi
1284+
1285+
client = AsyncCredalApi(
1286+
api_key="YOUR_API_KEY",
1287+
)
1288+
1289+
1290+
async def main() -> None:
1291+
await client.copilots.export(
1292+
agent_created_from=datetime.datetime.fromisoformat(
1293+
"2024-01-01 00:00:00+00:00",
1294+
),
1295+
agent_created_to=datetime.datetime.fromisoformat(
1296+
"2024-12-31 23:59:59+00:00",
1297+
),
1298+
)
1299+
1300+
1301+
asyncio.run(main())
1302+
"""
1303+
_response = await self._raw_client.export(
1304+
agent_created_from=agent_created_from,
1305+
agent_created_to=agent_created_to,
1306+
version_created_from=version_created_from,
1307+
version_created_to=version_created_to,
1308+
limit=limit,
1309+
cursor=cursor,
1310+
request_options=request_options,
1311+
)
1312+
return _response.data

0 commit comments

Comments
 (0)