create_agentic_persona_configuration
async
¶
create_agentic_persona_configuration(
name: AgenticPersonaConfigurationName,
model_ids: AgenticModelIdList,
*,
config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
client_token: Optional[IdempotencyToken] = None,
description: Optional[AgenticPersonaConfigurationDescription] = None,
agentic_connector_ids: Optional[AgenticConnectorIdList] = None,
agentic_context_ids: Optional[AgenticContextIdList] = None,
workspace_enforced_policy_id: Optional[WorkspaceEnforcedPolicyId] = None,
agent_enforced_policy_id: Optional[AgentEnforcedPolicyId] = None,
tags: Optional[TagList] = None,
) -> CreateAgenticPersonaConfigurationResult
Creates an Amazon WorkSpaces agentic persona configuration with the specified models, connectors, contexts, and enforced policies. The name must be unique among the persona configurations in your account.
If the name is in use, the operation returns ConflictException, and its ResourceId identifies the existing persona configuration. If you exceed the persona or tag limit, it returns ServiceQuotaExceededException.
Parameters:
-
client_token(Optional[IdempotencyToken], default:None) –A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request with the same parameters, the service returns the result of that request and doesn't create another persona configuration.
If you reuse the token with different parameters, the operation returns
ValidationException. If you deleted the persona configuration created with this token, the operation returnsResourceNotFoundException. -
name(AgenticPersonaConfigurationName) –The name of the persona configuration.
-
description(Optional[AgenticPersonaConfigurationDescription], default:None) –The description of the persona configuration.
-
model_ids(AgenticModelIdList) –The identifiers of the models that WorkSpaces created with this configuration can use. Specify 1–25 models. The models must be on your account's model list.
-
agentic_connector_ids(Optional[AgenticConnectorIdList], default:None) –The identifiers of the connectors to add to WorkSpaces created with this configuration. The connectors must be activated for your account.
-
agentic_context_ids(Optional[AgenticContextIdList], default:None) –The identifiers of the contexts to add to WorkSpaces created with this configuration.
-
workspace_enforced_policy_id(Optional[WorkspaceEnforcedPolicyId], default:None) –The identifier of the WorkSpace-enforced policy to apply to WorkSpaces created with this configuration.
-
agent_enforced_policy_id(Optional[AgentEnforcedPolicyId], default:None) –The identifier of the agent-enforced policy to apply to WorkSpaces created with this configuration.
-
tags(Optional[TagList], default:None) –The tags to add to the persona configuration.
Raises:
-
AccessDeniedException–The user is not authorized to access a resource.
-
ConflictException–The request conflicts with the current state of a resource, for example because a name is already in use or the resource is still in use. Resolve the conflict, and then retry your request.
-
ResourceNotFoundException–The resource could not be found.
-
ServiceQuotaExceededException–The request would exceed a service quota. Request a quota increase or reduce the number of resources in your request.
-
ThrottlingException–The request was throttled. Retry the request with exponential backoff.
-
ValidationException–Your request failed validation. Check the error message for the parameter that isn't valid.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Example – Creating a persona configuration The following example creates a persona configuration with two models, a connector, a context, and both enforced policies.
>>> await client.create_agentic_persona_configuration(client_token='a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', name='backend-developer', description='Persona for backend developers.', model_ids=['anthropic.claude-sonnet-5-5', 'anthropic.claude-opus-5-5'], agentic_connector_ids=['wsacn-github'], agentic_context_ids=['wsactx-a1b2c3d4'], workspace_enforced_policy_id='wsep-a1b2c3d4', agent_enforced_policy_id='wsae-a1b2c3d4', tags=[{'Key': 'team', 'Value': 'platform'}])
Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 | |