nolgia 0.1.0__tar.gz

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.
Files changed (163) hide show
  1. nolgia-0.1.0/.gitignore +14 -0
  2. nolgia-0.1.0/PKG-INFO +59 -0
  3. nolgia-0.1.0/README.md +45 -0
  4. nolgia-0.1.0/config.yaml +3 -0
  5. nolgia-0.1.0/nolgia/__init__.py +8 -0
  6. nolgia-0.1.0/nolgia/api/__init__.py +1 -0
  7. nolgia-0.1.0/nolgia/api/agent/__init__.py +1 -0
  8. nolgia-0.1.0/nolgia/api/agent/delete_agent_config_entry.py +166 -0
  9. nolgia-0.1.0/nolgia/api/agent/deprovision_agent.py +135 -0
  10. nolgia-0.1.0/nolgia/api/agent/get_agent.py +137 -0
  11. nolgia-0.1.0/nolgia/api/agent/get_agent_config.py +141 -0
  12. nolgia-0.1.0/nolgia/api/agent/get_agent_config_internal.py +169 -0
  13. nolgia-0.1.0/nolgia/api/agent/get_agent_usage.py +137 -0
  14. nolgia-0.1.0/nolgia/api/agent/issue_agent_credentials.py +165 -0
  15. nolgia-0.1.0/nolgia/api/agent/list_agents_internal.py +174 -0
  16. nolgia-0.1.0/nolgia/api/agent/provision_agent.py +175 -0
  17. nolgia-0.1.0/nolgia/api/agent/send_agent_chat_message.py +179 -0
  18. nolgia-0.1.0/nolgia/api/agent/update_agent_config.py +182 -0
  19. nolgia-0.1.0/nolgia/api/agent/update_agent_deployment.py +191 -0
  20. nolgia-0.1.0/nolgia/api/assets/__init__.py +1 -0
  21. nolgia-0.1.0/nolgia/api/assets/delete_asset.py +168 -0
  22. nolgia-0.1.0/nolgia/api/assets/get_asset.py +165 -0
  23. nolgia-0.1.0/nolgia/api/assets/list_assets.py +253 -0
  24. nolgia-0.1.0/nolgia/api/assets/update_asset.py +199 -0
  25. nolgia-0.1.0/nolgia/api/assets/upload_asset.py +186 -0
  26. nolgia-0.1.0/nolgia/api/auth/__init__.py +1 -0
  27. nolgia-0.1.0/nolgia/api/auth/approve_device_auth.py +172 -0
  28. nolgia-0.1.0/nolgia/api/auth/get_current_user.py +132 -0
  29. nolgia-0.1.0/nolgia/api/auth/poll_device_auth.py +169 -0
  30. nolgia-0.1.0/nolgia/api/auth/start_device_auth.py +164 -0
  31. nolgia-0.1.0/nolgia/api/billing/__init__.py +1 -0
  32. nolgia-0.1.0/nolgia/api/billing/create_portal_link.py +165 -0
  33. nolgia-0.1.0/nolgia/api/billing/get_auto_refresh.py +132 -0
  34. nolgia-0.1.0/nolgia/api/billing/get_credits.py +132 -0
  35. nolgia-0.1.0/nolgia/api/billing/get_subscription.py +137 -0
  36. nolgia-0.1.0/nolgia/api/billing/put_auto_refresh.py +174 -0
  37. nolgia-0.1.0/nolgia/api/characters/__init__.py +1 -0
  38. nolgia-0.1.0/nolgia/api/characters/create_character.py +169 -0
  39. nolgia-0.1.0/nolgia/api/characters/delete_character.py +163 -0
  40. nolgia-0.1.0/nolgia/api/characters/get_character.py +165 -0
  41. nolgia-0.1.0/nolgia/api/characters/list_characters.py +132 -0
  42. nolgia-0.1.0/nolgia/api/characters/update_character.py +203 -0
  43. nolgia-0.1.0/nolgia/api/generate/__init__.py +1 -0
  44. nolgia-0.1.0/nolgia/api/generate/generate_audio.py +190 -0
  45. nolgia-0.1.0/nolgia/api/generate/generate_image.py +190 -0
  46. nolgia-0.1.0/nolgia/api/generate/generate_video.py +186 -0
  47. nolgia-0.1.0/nolgia/api/health/__init__.py +1 -0
  48. nolgia-0.1.0/nolgia/api/health/get_health.py +137 -0
  49. nolgia-0.1.0/nolgia/api/jobs/__init__.py +1 -0
  50. nolgia-0.1.0/nolgia/api/jobs/create_job_sse_ticket.py +186 -0
  51. nolgia-0.1.0/nolgia/api/jobs/get_job.py +165 -0
  52. nolgia-0.1.0/nolgia/api/jobs/list_jobs.py +219 -0
  53. nolgia-0.1.0/nolgia/api/jobs/stream_job_sse.py +205 -0
  54. nolgia-0.1.0/nolgia/api/jobs/wait_for_job.py +199 -0
  55. nolgia-0.1.0/nolgia/api/models/__init__.py +1 -0
  56. nolgia-0.1.0/nolgia/api/models/list_models.py +132 -0
  57. nolgia-0.1.0/nolgia/api/pat/__init__.py +1 -0
  58. nolgia-0.1.0/nolgia/api/pat/create_pat.py +169 -0
  59. nolgia-0.1.0/nolgia/api/pat/list_pats.py +132 -0
  60. nolgia-0.1.0/nolgia/api/pat/revoke_pat.py +163 -0
  61. nolgia-0.1.0/nolgia/api/projects/__init__.py +1 -0
  62. nolgia-0.1.0/nolgia/api/projects/add_project_assets.py +197 -0
  63. nolgia-0.1.0/nolgia/api/projects/create_project.py +169 -0
  64. nolgia-0.1.0/nolgia/api/projects/delete_project.py +163 -0
  65. nolgia-0.1.0/nolgia/api/projects/get_project.py +165 -0
  66. nolgia-0.1.0/nolgia/api/projects/list_projects.py +132 -0
  67. nolgia-0.1.0/nolgia/api/projects/remove_project_asset.py +185 -0
  68. nolgia-0.1.0/nolgia/api/projects/update_project.py +199 -0
  69. nolgia-0.1.0/nolgia/api/skills/__init__.py +1 -0
  70. nolgia-0.1.0/nolgia/api/skills/get_skill.py +164 -0
  71. nolgia-0.1.0/nolgia/api/skills/get_skill_content.py +173 -0
  72. nolgia-0.1.0/nolgia/api/skills/install_agent_skill.py +178 -0
  73. nolgia-0.1.0/nolgia/api/skills/list_agent_skills.py +142 -0
  74. nolgia-0.1.0/nolgia/api/skills/list_skills.py +141 -0
  75. nolgia-0.1.0/nolgia/api/skills/publish_skill.py +179 -0
  76. nolgia-0.1.0/nolgia/api/skills/uninstall_agent_skill.py +162 -0
  77. nolgia-0.1.0/nolgia/client.py +282 -0
  78. nolgia-0.1.0/nolgia/errors.py +16 -0
  79. nolgia-0.1.0/nolgia/models/__init__.py +169 -0
  80. nolgia-0.1.0/nolgia/models/add_project_assets_request.py +51 -0
  81. nolgia-0.1.0/nolgia/models/agent.py +149 -0
  82. nolgia-0.1.0/nolgia/models/agent_chat_request.py +42 -0
  83. nolgia-0.1.0/nolgia/models/agent_chat_response.py +42 -0
  84. nolgia-0.1.0/nolgia/models/agent_config.py +56 -0
  85. nolgia-0.1.0/nolgia/models/agent_config_entry.py +68 -0
  86. nolgia-0.1.0/nolgia/models/agent_config_entry_input.py +62 -0
  87. nolgia-0.1.0/nolgia/models/agent_credentials.py +50 -0
  88. nolgia-0.1.0/nolgia/models/agent_installed_skill.py +75 -0
  89. nolgia-0.1.0/nolgia/models/agent_status.py +10 -0
  90. nolgia-0.1.0/nolgia/models/agent_usage.py +72 -0
  91. nolgia-0.1.0/nolgia/models/aspect_ratio.py +12 -0
  92. nolgia-0.1.0/nolgia/models/asset.py +236 -0
  93. nolgia-0.1.0/nolgia/models/asset_page.py +78 -0
  94. nolgia-0.1.0/nolgia/models/audio_capabilities.py +62 -0
  95. nolgia-0.1.0/nolgia/models/audio_format.py +11 -0
  96. nolgia-0.1.0/nolgia/models/audio_model.py +25 -0
  97. nolgia-0.1.0/nolgia/models/auto_refresh_settings.py +82 -0
  98. nolgia-0.1.0/nolgia/models/auto_refresh_settings_request.py +82 -0
  99. nolgia-0.1.0/nolgia/models/character.py +107 -0
  100. nolgia-0.1.0/nolgia/models/character_list.py +56 -0
  101. nolgia-0.1.0/nolgia/models/create_character_request.py +86 -0
  102. nolgia-0.1.0/nolgia/models/create_pat_request.py +64 -0
  103. nolgia-0.1.0/nolgia/models/create_pat_response.py +56 -0
  104. nolgia-0.1.0/nolgia/models/create_project_request.py +64 -0
  105. nolgia-0.1.0/nolgia/models/credit_balance.py +105 -0
  106. nolgia-0.1.0/nolgia/models/credit_balance_bucket.py +94 -0
  107. nolgia-0.1.0/nolgia/models/credit_wallet_type.py +9 -0
  108. nolgia-0.1.0/nolgia/models/device_approve_request.py +42 -0
  109. nolgia-0.1.0/nolgia/models/device_auth_request.py +64 -0
  110. nolgia-0.1.0/nolgia/models/device_auth_response.py +98 -0
  111. nolgia-0.1.0/nolgia/models/device_token_request.py +50 -0
  112. nolgia-0.1.0/nolgia/models/device_token_response.py +81 -0
  113. nolgia-0.1.0/nolgia/models/device_token_response_token_type.py +8 -0
  114. nolgia-0.1.0/nolgia/models/error.py +88 -0
  115. nolgia-0.1.0/nolgia/models/generate_audio_request.py +110 -0
  116. nolgia-0.1.0/nolgia/models/generate_audio_response.py +78 -0
  117. nolgia-0.1.0/nolgia/models/generate_image_request.py +160 -0
  118. nolgia-0.1.0/nolgia/models/generate_image_response.py +94 -0
  119. nolgia-0.1.0/nolgia/models/generate_video_request.py +209 -0
  120. nolgia-0.1.0/nolgia/models/health_status.py +62 -0
  121. nolgia-0.1.0/nolgia/models/health_status_status.py +9 -0
  122. nolgia-0.1.0/nolgia/models/image_model.py +16 -0
  123. nolgia-0.1.0/nolgia/models/image_size.py +13 -0
  124. nolgia-0.1.0/nolgia/models/job.py +206 -0
  125. nolgia-0.1.0/nolgia/models/job_page.py +86 -0
  126. nolgia-0.1.0/nolgia/models/job_status.py +12 -0
  127. nolgia-0.1.0/nolgia/models/modality.py +10 -0
  128. nolgia-0.1.0/nolgia/models/model.py +121 -0
  129. nolgia-0.1.0/nolgia/models/model_cost.py +80 -0
  130. nolgia-0.1.0/nolgia/models/model_cost_unit.py +10 -0
  131. nolgia-0.1.0/nolgia/models/model_list.py +56 -0
  132. nolgia-0.1.0/nolgia/models/pat.py +130 -0
  133. nolgia-0.1.0/nolgia/models/pat_page.py +78 -0
  134. nolgia-0.1.0/nolgia/models/portal_link_request.py +54 -0
  135. nolgia-0.1.0/nolgia/models/portal_link_response.py +51 -0
  136. nolgia-0.1.0/nolgia/models/project.py +93 -0
  137. nolgia-0.1.0/nolgia/models/project_list.py +56 -0
  138. nolgia-0.1.0/nolgia/models/provision_agent_request.py +51 -0
  139. nolgia-0.1.0/nolgia/models/publish_skill_request.py +157 -0
  140. nolgia-0.1.0/nolgia/models/publish_skill_request_manifest.py +47 -0
  141. nolgia-0.1.0/nolgia/models/publish_skill_request_min_tier.py +14 -0
  142. nolgia-0.1.0/nolgia/models/skill.py +129 -0
  143. nolgia-0.1.0/nolgia/models/skill_content.py +72 -0
  144. nolgia-0.1.0/nolgia/models/skill_content_manifest.py +47 -0
  145. nolgia-0.1.0/nolgia/models/skill_visibility.py +9 -0
  146. nolgia-0.1.0/nolgia/models/sse_ticket.py +52 -0
  147. nolgia-0.1.0/nolgia/models/subscription.py +148 -0
  148. nolgia-0.1.0/nolgia/models/subscription_status.py +15 -0
  149. nolgia-0.1.0/nolgia/models/subscription_tier.py +13 -0
  150. nolgia-0.1.0/nolgia/models/update_agent_config_request.py +57 -0
  151. nolgia-0.1.0/nolgia/models/update_agent_deployment_request.py +90 -0
  152. nolgia-0.1.0/nolgia/models/update_asset_request.py +42 -0
  153. nolgia-0.1.0/nolgia/models/update_character_request.py +120 -0
  154. nolgia-0.1.0/nolgia/models/update_project_request.py +74 -0
  155. nolgia-0.1.0/nolgia/models/upload_asset_request.py +73 -0
  156. nolgia-0.1.0/nolgia/models/upload_asset_request_content_type.py +10 -0
  157. nolgia-0.1.0/nolgia/models/user.py +102 -0
  158. nolgia-0.1.0/nolgia/models/video_capabilities.py +121 -0
  159. nolgia-0.1.0/nolgia/models/video_model.py +26 -0
  160. nolgia-0.1.0/nolgia/models/video_shot.py +72 -0
  161. nolgia-0.1.0/nolgia/models/voice.py +64 -0
  162. nolgia-0.1.0/nolgia/types.py +54 -0
  163. nolgia-0.1.0/pyproject.toml +24 -0
@@ -0,0 +1,14 @@
1
+ node_modules/
2
+ package-lock.json
3
+ .sisyphus/notepads/auth-and-platform/
4
+
5
+ # Compiled Go binaries (cmd/* build outputs) — never commit these
6
+ /mcp
7
+ /nolgia-mcp
8
+ /sweeper
9
+
10
+ # SDK local dev artifacts
11
+ sdk/python/.venv/
12
+ __pycache__/
13
+ sdk/typescript/dist/
14
+ .claude/worktrees/
nolgia-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.4
2
+ Name: nolgia
3
+ Version: 0.1.0
4
+ Summary: Official Python client for the Nolgia API (generative media: image, audio, video)
5
+ Project-URL: Homepage, https://nolgia.ai
6
+ Project-URL: Documentation, https://nolgiainc.github.io/nolgia-api/api/
7
+ Author-email: Nolgia Engineering <contact@nolgia.ai>
8
+ License: Proprietary
9
+ Requires-Python: >=3.9
10
+ Requires-Dist: attrs>=22.2.0
11
+ Requires-Dist: httpx<0.29,>=0.23.0
12
+ Requires-Dist: python-dateutil<3,>=2.8.0
13
+ Description-Content-Type: text/markdown
14
+
15
+ # nolgia — Python SDK
16
+
17
+ Official Python client for the [Nolgia API](https://api.nolgia.ai/v1), generated from
18
+ [`api/openapi.yaml`](../../api/openapi.yaml) with
19
+ [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) (httpx-based).
20
+
21
+ > Not yet published to PyPI. Install from the repo for now.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install "git+https://github.com/nolgiainc/nolgia-api.git#subdirectory=sdk/python"
27
+ # or, inside a checkout:
28
+ pip install -e sdk/python
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ Authenticate with a personal access token (`nol_...`) or a JWT:
34
+
35
+ ```python
36
+ from nolgia import AuthenticatedClient
37
+ from nolgia.api.auth import get_current_user
38
+ from nolgia.api.generate import generate_image
39
+ from nolgia.models import GenerateImageRequest, ImageModel
40
+
41
+ client = AuthenticatedClient(base_url="https://api.nolgia.ai/v1", token="nol_...")
42
+
43
+ me = get_current_user.sync(client=client)
44
+ print(me.email)
45
+
46
+ image = generate_image.sync(
47
+ client=client,
48
+ body=GenerateImageRequest(prompt="a red fox in the snow", model=ImageModel.IMAGEN_4),
49
+ )
50
+ ```
51
+
52
+ Every endpoint module exposes `sync`, `sync_detailed`, `asyncio`, and
53
+ `asyncio_detailed` variants. Point at staging with
54
+ `base_url="https://api.stg.nolgia.ai/v1"`.
55
+
56
+ ## Layout
57
+
58
+ - `nolgia/` — **generated**, do not edit; regenerate with `make sdk-python` from the repo root
59
+ - `pyproject.toml`, `README.md`, `config.yaml` — hand-written
nolgia-0.1.0/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # nolgia — Python SDK
2
+
3
+ Official Python client for the [Nolgia API](https://api.nolgia.ai/v1), generated from
4
+ [`api/openapi.yaml`](../../api/openapi.yaml) with
5
+ [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) (httpx-based).
6
+
7
+ > Not yet published to PyPI. Install from the repo for now.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install "git+https://github.com/nolgiainc/nolgia-api.git#subdirectory=sdk/python"
13
+ # or, inside a checkout:
14
+ pip install -e sdk/python
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Authenticate with a personal access token (`nol_...`) or a JWT:
20
+
21
+ ```python
22
+ from nolgia import AuthenticatedClient
23
+ from nolgia.api.auth import get_current_user
24
+ from nolgia.api.generate import generate_image
25
+ from nolgia.models import GenerateImageRequest, ImageModel
26
+
27
+ client = AuthenticatedClient(base_url="https://api.nolgia.ai/v1", token="nol_...")
28
+
29
+ me = get_current_user.sync(client=client)
30
+ print(me.email)
31
+
32
+ image = generate_image.sync(
33
+ client=client,
34
+ body=GenerateImageRequest(prompt="a red fox in the snow", model=ImageModel.IMAGEN_4),
35
+ )
36
+ ```
37
+
38
+ Every endpoint module exposes `sync`, `sync_detailed`, `asyncio`, and
39
+ `asyncio_detailed` variants. Point at staging with
40
+ `base_url="https://api.stg.nolgia.ai/v1"`.
41
+
42
+ ## Layout
43
+
44
+ - `nolgia/` — **generated**, do not edit; regenerate with `make sdk-python` from the repo root
45
+ - `pyproject.toml`, `README.md`, `config.yaml` — hand-written
@@ -0,0 +1,3 @@
1
+ # openapi-python-client generator config (make sdk-python).
2
+ project_name_override: nolgia
3
+ package_name_override: nolgia
@@ -0,0 +1,8 @@
1
+ """A client library for accessing Nolgia API"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,166 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error import Error
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ key: str,
14
+ ) -> dict[str, Any]:
15
+
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "delete",
18
+ "url": "/agent/config/{key}".format(
19
+ key=quote(str(key), safe=""),
20
+ ),
21
+ }
22
+
23
+ return _kwargs
24
+
25
+
26
+ def _parse_response(
27
+ *, client: AuthenticatedClient | Client, response: httpx.Response
28
+ ) -> Any | Error:
29
+ if response.status_code == 204:
30
+ response_204 = cast(Any, None)
31
+ return response_204
32
+
33
+ if response.status_code == 401:
34
+ response_401 = Error.from_dict(response.json())
35
+
36
+ return response_401
37
+
38
+ if response.status_code == 404:
39
+ response_404 = Error.from_dict(response.json())
40
+
41
+ return response_404
42
+
43
+ response_default = Error.from_dict(response.json())
44
+
45
+ return response_default
46
+
47
+
48
+ def _build_response(
49
+ *, client: AuthenticatedClient | Client, response: httpx.Response
50
+ ) -> Response[Any | Error]:
51
+ return Response(
52
+ status_code=HTTPStatus(response.status_code),
53
+ content=response.content,
54
+ headers=response.headers,
55
+ parsed=_parse_response(client=client, response=response),
56
+ )
57
+
58
+
59
+ def sync_detailed(
60
+ key: str,
61
+ *,
62
+ client: AuthenticatedClient | Client,
63
+ ) -> Response[Any | Error]:
64
+ """Remove a custom configuration entry. A running agent is flipped back to `pending_deploy` so the
65
+ deploy pipeline applies the change.
66
+
67
+ Args:
68
+ key (str):
69
+
70
+ Raises:
71
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
72
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
73
+
74
+ Returns:
75
+ Response[Any | Error]
76
+ """
77
+
78
+ kwargs = _get_kwargs(
79
+ key=key,
80
+ )
81
+
82
+ response = client.get_httpx_client().request(
83
+ **kwargs,
84
+ )
85
+
86
+ return _build_response(client=client, response=response)
87
+
88
+
89
+ def sync(
90
+ key: str,
91
+ *,
92
+ client: AuthenticatedClient | Client,
93
+ ) -> Any | Error | None:
94
+ """Remove a custom configuration entry. A running agent is flipped back to `pending_deploy` so the
95
+ deploy pipeline applies the change.
96
+
97
+ Args:
98
+ key (str):
99
+
100
+ Raises:
101
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
103
+
104
+ Returns:
105
+ Any | Error
106
+ """
107
+
108
+ return sync_detailed(
109
+ key=key,
110
+ client=client,
111
+ ).parsed
112
+
113
+
114
+ async def asyncio_detailed(
115
+ key: str,
116
+ *,
117
+ client: AuthenticatedClient | Client,
118
+ ) -> Response[Any | Error]:
119
+ """Remove a custom configuration entry. A running agent is flipped back to `pending_deploy` so the
120
+ deploy pipeline applies the change.
121
+
122
+ Args:
123
+ key (str):
124
+
125
+ Raises:
126
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
127
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
128
+
129
+ Returns:
130
+ Response[Any | Error]
131
+ """
132
+
133
+ kwargs = _get_kwargs(
134
+ key=key,
135
+ )
136
+
137
+ response = await client.get_async_httpx_client().request(**kwargs)
138
+
139
+ return _build_response(client=client, response=response)
140
+
141
+
142
+ async def asyncio(
143
+ key: str,
144
+ *,
145
+ client: AuthenticatedClient | Client,
146
+ ) -> Any | Error | None:
147
+ """Remove a custom configuration entry. A running agent is flipped back to `pending_deploy` so the
148
+ deploy pipeline applies the change.
149
+
150
+ Args:
151
+ key (str):
152
+
153
+ Raises:
154
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
156
+
157
+ Returns:
158
+ Any | Error
159
+ """
160
+
161
+ return (
162
+ await asyncio_detailed(
163
+ key=key,
164
+ client=client,
165
+ )
166
+ ).parsed
@@ -0,0 +1,135 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, cast
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient, Client
7
+ from ...models.error import Error
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs() -> dict[str, Any]:
12
+
13
+ _kwargs: dict[str, Any] = {
14
+ "method": "delete",
15
+ "url": "/agent",
16
+ }
17
+
18
+ return _kwargs
19
+
20
+
21
+ def _parse_response(
22
+ *, client: AuthenticatedClient | Client, response: httpx.Response
23
+ ) -> Any | Error:
24
+ if response.status_code == 204:
25
+ response_204 = cast(Any, None)
26
+ return response_204
27
+
28
+ if response.status_code == 401:
29
+ response_401 = Error.from_dict(response.json())
30
+
31
+ return response_401
32
+
33
+ if response.status_code == 404:
34
+ response_404 = Error.from_dict(response.json())
35
+
36
+ return response_404
37
+
38
+ response_default = Error.from_dict(response.json())
39
+
40
+ return response_default
41
+
42
+
43
+ def _build_response(
44
+ *, client: AuthenticatedClient | Client, response: httpx.Response
45
+ ) -> Response[Any | Error]:
46
+ return Response(
47
+ status_code=HTTPStatus(response.status_code),
48
+ content=response.content,
49
+ headers=response.headers,
50
+ parsed=_parse_response(client=client, response=response),
51
+ )
52
+
53
+
54
+ def sync_detailed(
55
+ *,
56
+ client: AuthenticatedClient | Client,
57
+ ) -> Response[Any | Error]:
58
+ """Deprovision the current user's Hermes agent and revoke its access token.
59
+
60
+ Raises:
61
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
62
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
63
+
64
+ Returns:
65
+ Response[Any | Error]
66
+ """
67
+
68
+ kwargs = _get_kwargs()
69
+
70
+ response = client.get_httpx_client().request(
71
+ **kwargs,
72
+ )
73
+
74
+ return _build_response(client=client, response=response)
75
+
76
+
77
+ def sync(
78
+ *,
79
+ client: AuthenticatedClient | Client,
80
+ ) -> Any | Error | None:
81
+ """Deprovision the current user's Hermes agent and revoke its access token.
82
+
83
+ Raises:
84
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
86
+
87
+ Returns:
88
+ Any | Error
89
+ """
90
+
91
+ return sync_detailed(
92
+ client=client,
93
+ ).parsed
94
+
95
+
96
+ async def asyncio_detailed(
97
+ *,
98
+ client: AuthenticatedClient | Client,
99
+ ) -> Response[Any | Error]:
100
+ """Deprovision the current user's Hermes agent and revoke its access token.
101
+
102
+ Raises:
103
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
104
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
105
+
106
+ Returns:
107
+ Response[Any | Error]
108
+ """
109
+
110
+ kwargs = _get_kwargs()
111
+
112
+ response = await client.get_async_httpx_client().request(**kwargs)
113
+
114
+ return _build_response(client=client, response=response)
115
+
116
+
117
+ async def asyncio(
118
+ *,
119
+ client: AuthenticatedClient | Client,
120
+ ) -> Any | Error | None:
121
+ """Deprovision the current user's Hermes agent and revoke its access token.
122
+
123
+ Raises:
124
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
126
+
127
+ Returns:
128
+ Any | Error
129
+ """
130
+
131
+ return (
132
+ await asyncio_detailed(
133
+ client=client,
134
+ )
135
+ ).parsed
@@ -0,0 +1,137 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient, Client
7
+ from ...models.agent import Agent
8
+ from ...models.error import Error
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> dict[str, Any]:
13
+
14
+ _kwargs: dict[str, Any] = {
15
+ "method": "get",
16
+ "url": "/agent",
17
+ }
18
+
19
+ return _kwargs
20
+
21
+
22
+ def _parse_response(
23
+ *, client: AuthenticatedClient | Client, response: httpx.Response
24
+ ) -> Agent | Error:
25
+ if response.status_code == 200:
26
+ response_200 = Agent.from_dict(response.json())
27
+
28
+ return response_200
29
+
30
+ if response.status_code == 401:
31
+ response_401 = Error.from_dict(response.json())
32
+
33
+ return response_401
34
+
35
+ if response.status_code == 404:
36
+ response_404 = Error.from_dict(response.json())
37
+
38
+ return response_404
39
+
40
+ response_default = Error.from_dict(response.json())
41
+
42
+ return response_default
43
+
44
+
45
+ def _build_response(
46
+ *, client: AuthenticatedClient | Client, response: httpx.Response
47
+ ) -> Response[Agent | Error]:
48
+ return Response(
49
+ status_code=HTTPStatus(response.status_code),
50
+ content=response.content,
51
+ headers=response.headers,
52
+ parsed=_parse_response(client=client, response=response),
53
+ )
54
+
55
+
56
+ def sync_detailed(
57
+ *,
58
+ client: AuthenticatedClient | Client,
59
+ ) -> Response[Agent | Error]:
60
+ """Get the current user's Hermes agent, if provisioned.
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[Agent | Error]
68
+ """
69
+
70
+ kwargs = _get_kwargs()
71
+
72
+ response = client.get_httpx_client().request(
73
+ **kwargs,
74
+ )
75
+
76
+ return _build_response(client=client, response=response)
77
+
78
+
79
+ def sync(
80
+ *,
81
+ client: AuthenticatedClient | Client,
82
+ ) -> Agent | Error | None:
83
+ """Get the current user's Hermes agent, if provisioned.
84
+
85
+ Raises:
86
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
87
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
88
+
89
+ Returns:
90
+ Agent | Error
91
+ """
92
+
93
+ return sync_detailed(
94
+ client=client,
95
+ ).parsed
96
+
97
+
98
+ async def asyncio_detailed(
99
+ *,
100
+ client: AuthenticatedClient | Client,
101
+ ) -> Response[Agent | Error]:
102
+ """Get the current user's Hermes agent, if provisioned.
103
+
104
+ Raises:
105
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
106
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
107
+
108
+ Returns:
109
+ Response[Agent | Error]
110
+ """
111
+
112
+ kwargs = _get_kwargs()
113
+
114
+ response = await client.get_async_httpx_client().request(**kwargs)
115
+
116
+ return _build_response(client=client, response=response)
117
+
118
+
119
+ async def asyncio(
120
+ *,
121
+ client: AuthenticatedClient | Client,
122
+ ) -> Agent | Error | None:
123
+ """Get the current user's Hermes agent, if provisioned.
124
+
125
+ Raises:
126
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
127
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
128
+
129
+ Returns:
130
+ Agent | Error
131
+ """
132
+
133
+ return (
134
+ await asyncio_detailed(
135
+ client=client,
136
+ )
137
+ ).parsed