AgentsforBedrockRuntimeClient#
Index > AgentsforBedrockRuntime > AgentsforBedrockRuntimeClient
Auto-generated documentation for AgentsforBedrockRuntime type annotations stubs module types-aiobotocore-bedrock-agent-runtime.
AgentsforBedrockRuntimeClient#
Type annotations and code completion for session.client("bedrock-agent-runtime")
boto3 documentation
# AgentsforBedrockRuntimeClient usage example
from aioboto3.session import Session
from types_aiobotocore_bedrock_agent_runtime.client import AgentsforBedrockRuntimeClient
session = Session()
async with session.client("bedrock-agent-runtime") as client:
client: AgentsforBedrockRuntimeClient
Exceptions#
aioboto3
client exceptions are generated in runtime.
This class provides code completion for session.client("bedrock-agent-runtime").exceptions
structure.
# AgentsforBedrockRuntimeClient.exceptions usage example
async with session.client("bedrock-agent-runtime") as client:
try:
do_something(client)
except (
client.exceptions.AccessDeniedException,
client.exceptions.BadGatewayException,
client.exceptions.ClientError,
client.exceptions.ConflictException,
client.exceptions.DependencyFailedException,
client.exceptions.InternalServerException,
client.exceptions.ResourceNotFoundException,
client.exceptions.ServiceQuotaExceededException,
client.exceptions.ThrottlingException,
client.exceptions.ValidationException,
) as e:
print(e)
# AgentsforBedrockRuntimeClient.exceptions type checking example
from types_aiobotocore_bedrock_agent_runtime.client import Exceptions
def handle_error(exc: Exceptions.AccessDeniedException) -> None:
...
Methods#
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for session.client("bedrock-agent-runtime").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
close#
Closes underlying endpoint connections.
Type annotations and code completion for session.client("bedrock-agent-runtime").close
method.
boto3 documentation
# close method definition
await def close(
self,
) -> None:
...
generate_presigned_url#
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for session.client("bedrock-agent-runtime").generate_presigned_url
method.
boto3 documentation
# generate_presigned_url method definition
await def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
invoke_agent#
Invokes the specified Bedrock model to run inference using the input provided in the request body.
Type annotations and code completion for session.client("bedrock-agent-runtime").invoke_agent
method.
boto3 documentation
# invoke_agent method definition
await def invoke_agent(
self,
*,
agentId: str,
agentAliasId: str,
sessionId: str,
inputText: str,
sessionState: SessionStateTypeDef = ..., # (1)
endSession: bool = ...,
enableTrace: bool = ...,
) -> InvokeAgentResponseTypeDef: # (2)
...
# invoke_agent method usage example with argument unpacking
kwargs: InvokeAgentRequestRequestTypeDef = { # (1)
"agentId": ...,
"agentAliasId": ...,
"sessionId": ...,
"inputText": ...,
}
parent.invoke_agent(**kwargs)
retrieve#
Retrieve from knowledge base.
Type annotations and code completion for session.client("bedrock-agent-runtime").retrieve
method.
boto3 documentation
# retrieve method definition
await def retrieve(
self,
*,
knowledgeBaseId: str,
retrievalQuery: KnowledgeBaseQueryTypeDef, # (1)
retrievalConfiguration: KnowledgeBaseRetrievalConfigurationTypeDef = ..., # (2)
nextToken: str = ...,
) -> RetrieveResponseTypeDef: # (3)
...
- See KnowledgeBaseQueryTypeDef
- See KnowledgeBaseRetrievalConfigurationTypeDef
- See RetrieveResponseTypeDef
# retrieve method usage example with argument unpacking
kwargs: RetrieveRequestRequestTypeDef = { # (1)
"knowledgeBaseId": ...,
"retrievalQuery": ...,
}
parent.retrieve(**kwargs)
retrieve_and_generate#
RetrieveAndGenerate API See also: AWS API Documentation.
Type annotations and code completion for session.client("bedrock-agent-runtime").retrieve_and_generate
method.
boto3 documentation
# retrieve_and_generate method definition
await def retrieve_and_generate(
self,
*,
input: RetrieveAndGenerateInputTypeDef, # (1)
sessionId: str = ...,
retrieveAndGenerateConfiguration: RetrieveAndGenerateConfigurationTypeDef = ..., # (2)
sessionConfiguration: RetrieveAndGenerateSessionConfigurationTypeDef = ..., # (3)
) -> RetrieveAndGenerateResponseTypeDef: # (4)
...
- See RetrieveAndGenerateInputTypeDef
- See RetrieveAndGenerateConfigurationTypeDef
- See RetrieveAndGenerateSessionConfigurationTypeDef
- See RetrieveAndGenerateResponseTypeDef
# retrieve_and_generate method usage example with argument unpacking
kwargs: RetrieveAndGenerateRequestRequestTypeDef = { # (1)
"input": ...,
}
parent.retrieve_and_generate(**kwargs)
__aenter__#
Type annotations and code completion for session.client("bedrock-agent-runtime").__aenter__
method.
boto3 documentation
# __aenter__ method definition
await def __aenter__(
self,
) -> AgentsforBedrockRuntimeClient:
...
__aexit__#
Type annotations and code completion for session.client("bedrock-agent-runtime").__aexit__
method.
boto3 documentation
# __aexit__ method definition
await def __aexit__(
self,
exc_type: Any,
exc_val: Any,
exc_tb: Any,
) -> Any:
...
get_paginator#
Type annotations and code completion for session.client("bedrock-agent-runtime").get_paginator
method with overloads.
client.get_paginator("retrieve")
-> RetrievePaginator