hackagent 0.3.1__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.
- hackagent/__init__.py +12 -0
- hackagent/agent.py +214 -0
- hackagent/api/__init__.py +1 -0
- hackagent/api/agent/__init__.py +1 -0
- hackagent/api/agent/agent_create.py +347 -0
- hackagent/api/agent/agent_destroy.py +140 -0
- hackagent/api/agent/agent_list.py +242 -0
- hackagent/api/agent/agent_partial_update.py +361 -0
- hackagent/api/agent/agent_retrieve.py +235 -0
- hackagent/api/agent/agent_update.py +361 -0
- hackagent/api/apilogs/__init__.py +1 -0
- hackagent/api/apilogs/apilogs_list.py +170 -0
- hackagent/api/apilogs/apilogs_retrieve.py +162 -0
- hackagent/api/attack/__init__.py +1 -0
- hackagent/api/attack/attack_create.py +275 -0
- hackagent/api/attack/attack_destroy.py +146 -0
- hackagent/api/attack/attack_list.py +254 -0
- hackagent/api/attack/attack_partial_update.py +289 -0
- hackagent/api/attack/attack_retrieve.py +247 -0
- hackagent/api/attack/attack_update.py +289 -0
- hackagent/api/checkout/__init__.py +1 -0
- hackagent/api/checkout/checkout_create.py +225 -0
- hackagent/api/generate/__init__.py +1 -0
- hackagent/api/generate/generate_create.py +253 -0
- hackagent/api/judge/__init__.py +1 -0
- hackagent/api/judge/judge_create.py +253 -0
- hackagent/api/key/__init__.py +1 -0
- hackagent/api/key/key_create.py +179 -0
- hackagent/api/key/key_destroy.py +103 -0
- hackagent/api/key/key_list.py +170 -0
- hackagent/api/key/key_retrieve.py +162 -0
- hackagent/api/organization/__init__.py +1 -0
- hackagent/api/organization/organization_create.py +208 -0
- hackagent/api/organization/organization_destroy.py +104 -0
- hackagent/api/organization/organization_list.py +170 -0
- hackagent/api/organization/organization_me_retrieve.py +126 -0
- hackagent/api/organization/organization_partial_update.py +222 -0
- hackagent/api/organization/organization_retrieve.py +163 -0
- hackagent/api/organization/organization_update.py +222 -0
- hackagent/api/prompt/__init__.py +1 -0
- hackagent/api/prompt/prompt_create.py +171 -0
- hackagent/api/prompt/prompt_destroy.py +104 -0
- hackagent/api/prompt/prompt_list.py +185 -0
- hackagent/api/prompt/prompt_partial_update.py +185 -0
- hackagent/api/prompt/prompt_retrieve.py +163 -0
- hackagent/api/prompt/prompt_update.py +185 -0
- hackagent/api/result/__init__.py +1 -0
- hackagent/api/result/result_create.py +175 -0
- hackagent/api/result/result_destroy.py +106 -0
- hackagent/api/result/result_list.py +249 -0
- hackagent/api/result/result_partial_update.py +193 -0
- hackagent/api/result/result_retrieve.py +167 -0
- hackagent/api/result/result_trace_create.py +177 -0
- hackagent/api/result/result_update.py +189 -0
- hackagent/api/run/__init__.py +1 -0
- hackagent/api/run/run_create.py +187 -0
- hackagent/api/run/run_destroy.py +112 -0
- hackagent/api/run/run_list.py +291 -0
- hackagent/api/run/run_partial_update.py +201 -0
- hackagent/api/run/run_result_create.py +177 -0
- hackagent/api/run/run_retrieve.py +179 -0
- hackagent/api/run/run_run_tests_create.py +187 -0
- hackagent/api/run/run_update.py +201 -0
- hackagent/api/user/__init__.py +1 -0
- hackagent/api/user/user_create.py +212 -0
- hackagent/api/user/user_destroy.py +106 -0
- hackagent/api/user/user_list.py +174 -0
- hackagent/api/user/user_me_retrieve.py +126 -0
- hackagent/api/user/user_me_update.py +196 -0
- hackagent/api/user/user_partial_update.py +226 -0
- hackagent/api/user/user_retrieve.py +167 -0
- hackagent/api/user/user_update.py +226 -0
- hackagent/attacks/AdvPrefix/__init__.py +41 -0
- hackagent/attacks/AdvPrefix/completions.py +416 -0
- hackagent/attacks/AdvPrefix/config.py +259 -0
- hackagent/attacks/AdvPrefix/evaluation.py +745 -0
- hackagent/attacks/AdvPrefix/evaluators.py +564 -0
- hackagent/attacks/AdvPrefix/generate.py +711 -0
- hackagent/attacks/AdvPrefix/utils.py +307 -0
- hackagent/attacks/__init__.py +35 -0
- hackagent/attacks/advprefix.py +507 -0
- hackagent/attacks/base.py +106 -0
- hackagent/attacks/strategies.py +906 -0
- hackagent/cli/__init__.py +19 -0
- hackagent/cli/commands/__init__.py +20 -0
- hackagent/cli/commands/agent.py +100 -0
- hackagent/cli/commands/attack.py +417 -0
- hackagent/cli/commands/config.py +301 -0
- hackagent/cli/commands/results.py +327 -0
- hackagent/cli/config.py +249 -0
- hackagent/cli/main.py +515 -0
- hackagent/cli/tui/__init__.py +31 -0
- hackagent/cli/tui/actions_logger.py +200 -0
- hackagent/cli/tui/app.py +288 -0
- hackagent/cli/tui/base.py +137 -0
- hackagent/cli/tui/logger.py +318 -0
- hackagent/cli/tui/views/__init__.py +33 -0
- hackagent/cli/tui/views/agents.py +488 -0
- hackagent/cli/tui/views/attacks.py +624 -0
- hackagent/cli/tui/views/config.py +244 -0
- hackagent/cli/tui/views/dashboard.py +307 -0
- hackagent/cli/tui/views/results.py +1210 -0
- hackagent/cli/tui/widgets/__init__.py +24 -0
- hackagent/cli/tui/widgets/actions.py +346 -0
- hackagent/cli/tui/widgets/logs.py +435 -0
- hackagent/cli/utils.py +276 -0
- hackagent/client.py +286 -0
- hackagent/errors.py +37 -0
- hackagent/logger.py +83 -0
- hackagent/models/__init__.py +109 -0
- hackagent/models/agent.py +223 -0
- hackagent/models/agent_request.py +129 -0
- hackagent/models/api_token_log.py +184 -0
- hackagent/models/attack.py +154 -0
- hackagent/models/attack_request.py +82 -0
- hackagent/models/checkout_session_request_request.py +76 -0
- hackagent/models/checkout_session_response.py +59 -0
- hackagent/models/choice.py +81 -0
- hackagent/models/choice_message.py +67 -0
- hackagent/models/evaluation_status_enum.py +14 -0
- hackagent/models/generate_error_response.py +59 -0
- hackagent/models/generate_request_request.py +212 -0
- hackagent/models/generate_success_response.py +115 -0
- hackagent/models/generic_error_response.py +70 -0
- hackagent/models/message_request.py +67 -0
- hackagent/models/organization.py +102 -0
- hackagent/models/organization_minimal.py +68 -0
- hackagent/models/organization_request.py +71 -0
- hackagent/models/paginated_agent_list.py +123 -0
- hackagent/models/paginated_api_token_log_list.py +123 -0
- hackagent/models/paginated_attack_list.py +123 -0
- hackagent/models/paginated_organization_list.py +123 -0
- hackagent/models/paginated_prompt_list.py +123 -0
- hackagent/models/paginated_result_list.py +123 -0
- hackagent/models/paginated_run_list.py +123 -0
- hackagent/models/paginated_user_api_key_list.py +123 -0
- hackagent/models/paginated_user_profile_list.py +123 -0
- hackagent/models/patched_agent_request.py +128 -0
- hackagent/models/patched_attack_request.py +92 -0
- hackagent/models/patched_organization_request.py +71 -0
- hackagent/models/patched_prompt_request.py +125 -0
- hackagent/models/patched_result_request.py +237 -0
- hackagent/models/patched_run_request.py +138 -0
- hackagent/models/patched_user_profile_request.py +99 -0
- hackagent/models/prompt.py +220 -0
- hackagent/models/prompt_request.py +126 -0
- hackagent/models/result.py +294 -0
- hackagent/models/result_list_evaluation_status.py +14 -0
- hackagent/models/result_request.py +232 -0
- hackagent/models/run.py +233 -0
- hackagent/models/run_list_status.py +12 -0
- hackagent/models/run_request.py +133 -0
- hackagent/models/status_enum.py +12 -0
- hackagent/models/step_type_enum.py +14 -0
- hackagent/models/trace.py +121 -0
- hackagent/models/trace_request.py +94 -0
- hackagent/models/usage.py +75 -0
- hackagent/models/user_api_key.py +201 -0
- hackagent/models/user_api_key_request.py +73 -0
- hackagent/models/user_profile.py +135 -0
- hackagent/models/user_profile_minimal.py +76 -0
- hackagent/models/user_profile_request.py +99 -0
- hackagent/router/__init__.py +25 -0
- hackagent/router/adapters/__init__.py +20 -0
- hackagent/router/adapters/base.py +63 -0
- hackagent/router/adapters/google_adk.py +671 -0
- hackagent/router/adapters/litellm_adapter.py +524 -0
- hackagent/router/adapters/openai_adapter.py +426 -0
- hackagent/router/router.py +969 -0
- hackagent/router/types.py +54 -0
- hackagent/tracking/__init__.py +42 -0
- hackagent/tracking/context.py +163 -0
- hackagent/tracking/decorators.py +299 -0
- hackagent/tracking/tracker.py +441 -0
- hackagent/types.py +54 -0
- hackagent/utils.py +194 -0
- hackagent/vulnerabilities/__init__.py +13 -0
- hackagent/vulnerabilities/prompts.py +81 -0
- hackagent-0.3.1.dist-info/METADATA +122 -0
- hackagent-0.3.1.dist-info/RECORD +183 -0
- hackagent-0.3.1.dist-info/WHEEL +4 -0
- hackagent-0.3.1.dist-info/entry_points.txt +2 -0
- hackagent-0.3.1.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...types import Response
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
id: UUID,
|
|
14
|
+
) -> dict[str, Any]:
|
|
15
|
+
_kwargs: dict[str, Any] = {
|
|
16
|
+
"method": "delete",
|
|
17
|
+
"url": f"/agent/{id}",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return _kwargs
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def _parse_response(
|
|
24
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
25
|
+
) -> Optional[Any]:
|
|
26
|
+
if response.status_code == 204:
|
|
27
|
+
return None
|
|
28
|
+
if client.raise_on_unexpected_status:
|
|
29
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
30
|
+
else:
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _build_response(
|
|
35
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
36
|
+
) -> Response[Any]:
|
|
37
|
+
return Response(
|
|
38
|
+
status_code=HTTPStatus(response.status_code),
|
|
39
|
+
content=response.content,
|
|
40
|
+
headers=response.headers,
|
|
41
|
+
parsed=_parse_response(client=client, response=response),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def sync_detailed(
|
|
46
|
+
id: UUID,
|
|
47
|
+
*,
|
|
48
|
+
client: AuthenticatedClient,
|
|
49
|
+
) -> Response[Any]:
|
|
50
|
+
"""Provides CRUD operations for Agent instances.
|
|
51
|
+
|
|
52
|
+
This ViewSet manages Agent records, ensuring that users can only interact
|
|
53
|
+
with agents based on their permissions and organizational context.
|
|
54
|
+
It filters agent listings for users and handles the logic for creating
|
|
55
|
+
agents, including associating them with the correct organization and owner.
|
|
56
|
+
|
|
57
|
+
SDK-primary endpoint - API Key authentication is recommended for programmatic access.
|
|
58
|
+
Auth0 authentication is supported as fallback for web dashboard use.
|
|
59
|
+
|
|
60
|
+
Permissions are based on IsAuthenticated, with queryset filtering providing
|
|
61
|
+
row-level access control.
|
|
62
|
+
|
|
63
|
+
Class Attributes:
|
|
64
|
+
queryset (QuerySet): The default queryset for listing agents, initially all agents.
|
|
65
|
+
This is further filtered by `get_queryset()`.
|
|
66
|
+
serializer_class (AgentSerializer): The serializer used for validating and
|
|
67
|
+
deserializing input, and for serializing output.
|
|
68
|
+
authentication_classes (list): API Key (primary) + Auth0 (fallback) authentication.
|
|
69
|
+
permission_classes (list): List of permission classes to use.
|
|
70
|
+
parser_classes (list): List of parser classes for handling request data.
|
|
71
|
+
lookup_field (str): The model field used for looking up individual instances (UUID 'id').
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
id (UUID):
|
|
75
|
+
|
|
76
|
+
Raises:
|
|
77
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
78
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Response[Any]
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
kwargs = _get_kwargs(
|
|
85
|
+
id=id,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
response = client.get_httpx_client().request(
|
|
89
|
+
**kwargs,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return _build_response(client=client, response=response)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
async def asyncio_detailed(
|
|
96
|
+
id: UUID,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient,
|
|
99
|
+
) -> Response[Any]:
|
|
100
|
+
"""Provides CRUD operations for Agent instances.
|
|
101
|
+
|
|
102
|
+
This ViewSet manages Agent records, ensuring that users can only interact
|
|
103
|
+
with agents based on their permissions and organizational context.
|
|
104
|
+
It filters agent listings for users and handles the logic for creating
|
|
105
|
+
agents, including associating them with the correct organization and owner.
|
|
106
|
+
|
|
107
|
+
SDK-primary endpoint - API Key authentication is recommended for programmatic access.
|
|
108
|
+
Auth0 authentication is supported as fallback for web dashboard use.
|
|
109
|
+
|
|
110
|
+
Permissions are based on IsAuthenticated, with queryset filtering providing
|
|
111
|
+
row-level access control.
|
|
112
|
+
|
|
113
|
+
Class Attributes:
|
|
114
|
+
queryset (QuerySet): The default queryset for listing agents, initially all agents.
|
|
115
|
+
This is further filtered by `get_queryset()`.
|
|
116
|
+
serializer_class (AgentSerializer): The serializer used for validating and
|
|
117
|
+
deserializing input, and for serializing output.
|
|
118
|
+
authentication_classes (list): API Key (primary) + Auth0 (fallback) authentication.
|
|
119
|
+
permission_classes (list): List of permission classes to use.
|
|
120
|
+
parser_classes (list): List of parser classes for handling request data.
|
|
121
|
+
lookup_field (str): The model field used for looking up individual instances (UUID 'id').
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
id (UUID):
|
|
125
|
+
|
|
126
|
+
Raises:
|
|
127
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
128
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Response[Any]
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
kwargs = _get_kwargs(
|
|
135
|
+
id=id,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
139
|
+
|
|
140
|
+
return _build_response(client=client, response=response)
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.paginated_agent_list import PaginatedAgentList
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
page: Union[Unset, int] = UNSET,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
params: dict[str, Any] = {}
|
|
17
|
+
|
|
18
|
+
params["page"] = page
|
|
19
|
+
|
|
20
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
21
|
+
|
|
22
|
+
_kwargs: dict[str, Any] = {
|
|
23
|
+
"method": "get",
|
|
24
|
+
"url": "/agent",
|
|
25
|
+
"params": params,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return _kwargs
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _parse_response(
|
|
32
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
33
|
+
) -> Optional[PaginatedAgentList]:
|
|
34
|
+
if response.status_code == 200:
|
|
35
|
+
response_200 = PaginatedAgentList.from_dict(response.json())
|
|
36
|
+
|
|
37
|
+
return response_200
|
|
38
|
+
if client.raise_on_unexpected_status:
|
|
39
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
40
|
+
else:
|
|
41
|
+
return None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _build_response(
|
|
45
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
46
|
+
) -> Response[PaginatedAgentList]:
|
|
47
|
+
return Response(
|
|
48
|
+
status_code=HTTPStatus(response.status_code),
|
|
49
|
+
content=response.content,
|
|
50
|
+
headers=response.headers,
|
|
51
|
+
parsed=_parse_response(client=client, response=response),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def sync_detailed(
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient,
|
|
58
|
+
page: Union[Unset, int] = UNSET,
|
|
59
|
+
) -> Response[PaginatedAgentList]:
|
|
60
|
+
"""Provides CRUD operations for Agent instances.
|
|
61
|
+
|
|
62
|
+
This ViewSet manages Agent records, ensuring that users can only interact
|
|
63
|
+
with agents based on their permissions and organizational context.
|
|
64
|
+
It filters agent listings for users and handles the logic for creating
|
|
65
|
+
agents, including associating them with the correct organization and owner.
|
|
66
|
+
|
|
67
|
+
SDK-primary endpoint - API Key authentication is recommended for programmatic access.
|
|
68
|
+
Auth0 authentication is supported as fallback for web dashboard use.
|
|
69
|
+
|
|
70
|
+
Permissions are based on IsAuthenticated, with queryset filtering providing
|
|
71
|
+
row-level access control.
|
|
72
|
+
|
|
73
|
+
Class Attributes:
|
|
74
|
+
queryset (QuerySet): The default queryset for listing agents, initially all agents.
|
|
75
|
+
This is further filtered by `get_queryset()`.
|
|
76
|
+
serializer_class (AgentSerializer): The serializer used for validating and
|
|
77
|
+
deserializing input, and for serializing output.
|
|
78
|
+
authentication_classes (list): API Key (primary) + Auth0 (fallback) authentication.
|
|
79
|
+
permission_classes (list): List of permission classes to use.
|
|
80
|
+
parser_classes (list): List of parser classes for handling request data.
|
|
81
|
+
lookup_field (str): The model field used for looking up individual instances (UUID 'id').
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
page (Union[Unset, int]):
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
88
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
Response[PaginatedAgentList]
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
kwargs = _get_kwargs(
|
|
95
|
+
page=page,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
response = client.get_httpx_client().request(
|
|
99
|
+
**kwargs,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
return _build_response(client=client, response=response)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def sync(
|
|
106
|
+
*,
|
|
107
|
+
client: AuthenticatedClient,
|
|
108
|
+
page: Union[Unset, int] = UNSET,
|
|
109
|
+
) -> Optional[PaginatedAgentList]:
|
|
110
|
+
"""Provides CRUD operations for Agent instances.
|
|
111
|
+
|
|
112
|
+
This ViewSet manages Agent records, ensuring that users can only interact
|
|
113
|
+
with agents based on their permissions and organizational context.
|
|
114
|
+
It filters agent listings for users and handles the logic for creating
|
|
115
|
+
agents, including associating them with the correct organization and owner.
|
|
116
|
+
|
|
117
|
+
SDK-primary endpoint - API Key authentication is recommended for programmatic access.
|
|
118
|
+
Auth0 authentication is supported as fallback for web dashboard use.
|
|
119
|
+
|
|
120
|
+
Permissions are based on IsAuthenticated, with queryset filtering providing
|
|
121
|
+
row-level access control.
|
|
122
|
+
|
|
123
|
+
Class Attributes:
|
|
124
|
+
queryset (QuerySet): The default queryset for listing agents, initially all agents.
|
|
125
|
+
This is further filtered by `get_queryset()`.
|
|
126
|
+
serializer_class (AgentSerializer): The serializer used for validating and
|
|
127
|
+
deserializing input, and for serializing output.
|
|
128
|
+
authentication_classes (list): API Key (primary) + Auth0 (fallback) authentication.
|
|
129
|
+
permission_classes (list): List of permission classes to use.
|
|
130
|
+
parser_classes (list): List of parser classes for handling request data.
|
|
131
|
+
lookup_field (str): The model field used for looking up individual instances (UUID 'id').
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
page (Union[Unset, int]):
|
|
135
|
+
|
|
136
|
+
Raises:
|
|
137
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
138
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
PaginatedAgentList
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
return sync_detailed(
|
|
145
|
+
client=client,
|
|
146
|
+
page=page,
|
|
147
|
+
).parsed
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
async def asyncio_detailed(
|
|
151
|
+
*,
|
|
152
|
+
client: AuthenticatedClient,
|
|
153
|
+
page: Union[Unset, int] = UNSET,
|
|
154
|
+
) -> Response[PaginatedAgentList]:
|
|
155
|
+
"""Provides CRUD operations for Agent instances.
|
|
156
|
+
|
|
157
|
+
This ViewSet manages Agent records, ensuring that users can only interact
|
|
158
|
+
with agents based on their permissions and organizational context.
|
|
159
|
+
It filters agent listings for users and handles the logic for creating
|
|
160
|
+
agents, including associating them with the correct organization and owner.
|
|
161
|
+
|
|
162
|
+
SDK-primary endpoint - API Key authentication is recommended for programmatic access.
|
|
163
|
+
Auth0 authentication is supported as fallback for web dashboard use.
|
|
164
|
+
|
|
165
|
+
Permissions are based on IsAuthenticated, with queryset filtering providing
|
|
166
|
+
row-level access control.
|
|
167
|
+
|
|
168
|
+
Class Attributes:
|
|
169
|
+
queryset (QuerySet): The default queryset for listing agents, initially all agents.
|
|
170
|
+
This is further filtered by `get_queryset()`.
|
|
171
|
+
serializer_class (AgentSerializer): The serializer used for validating and
|
|
172
|
+
deserializing input, and for serializing output.
|
|
173
|
+
authentication_classes (list): API Key (primary) + Auth0 (fallback) authentication.
|
|
174
|
+
permission_classes (list): List of permission classes to use.
|
|
175
|
+
parser_classes (list): List of parser classes for handling request data.
|
|
176
|
+
lookup_field (str): The model field used for looking up individual instances (UUID 'id').
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
page (Union[Unset, int]):
|
|
180
|
+
|
|
181
|
+
Raises:
|
|
182
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
183
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
184
|
+
|
|
185
|
+
Returns:
|
|
186
|
+
Response[PaginatedAgentList]
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
kwargs = _get_kwargs(
|
|
190
|
+
page=page,
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
194
|
+
|
|
195
|
+
return _build_response(client=client, response=response)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
async def asyncio(
|
|
199
|
+
*,
|
|
200
|
+
client: AuthenticatedClient,
|
|
201
|
+
page: Union[Unset, int] = UNSET,
|
|
202
|
+
) -> Optional[PaginatedAgentList]:
|
|
203
|
+
"""Provides CRUD operations for Agent instances.
|
|
204
|
+
|
|
205
|
+
This ViewSet manages Agent records, ensuring that users can only interact
|
|
206
|
+
with agents based on their permissions and organizational context.
|
|
207
|
+
It filters agent listings for users and handles the logic for creating
|
|
208
|
+
agents, including associating them with the correct organization and owner.
|
|
209
|
+
|
|
210
|
+
SDK-primary endpoint - API Key authentication is recommended for programmatic access.
|
|
211
|
+
Auth0 authentication is supported as fallback for web dashboard use.
|
|
212
|
+
|
|
213
|
+
Permissions are based on IsAuthenticated, with queryset filtering providing
|
|
214
|
+
row-level access control.
|
|
215
|
+
|
|
216
|
+
Class Attributes:
|
|
217
|
+
queryset (QuerySet): The default queryset for listing agents, initially all agents.
|
|
218
|
+
This is further filtered by `get_queryset()`.
|
|
219
|
+
serializer_class (AgentSerializer): The serializer used for validating and
|
|
220
|
+
deserializing input, and for serializing output.
|
|
221
|
+
authentication_classes (list): API Key (primary) + Auth0 (fallback) authentication.
|
|
222
|
+
permission_classes (list): List of permission classes to use.
|
|
223
|
+
parser_classes (list): List of parser classes for handling request data.
|
|
224
|
+
lookup_field (str): The model field used for looking up individual instances (UUID 'id').
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
page (Union[Unset, int]):
|
|
228
|
+
|
|
229
|
+
Raises:
|
|
230
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
231
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
232
|
+
|
|
233
|
+
Returns:
|
|
234
|
+
PaginatedAgentList
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
await asyncio_detailed(
|
|
239
|
+
client=client,
|
|
240
|
+
page=page,
|
|
241
|
+
)
|
|
242
|
+
).parsed
|