Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AgentsforBedrockRuntime.Client.invoke_agent is alwasy streaming one chunk #3997

Closed
merojosa opened this issue Jan 23, 2024 · 6 comments
Closed
Assignees
Labels
bedrock-agent-runtime bug This issue is a confirmed bug. p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.

Comments

@merojosa
Copy link

Describe the bug

According to the documentation, the response of invoke_agent should be streamed.

When I'm trying to invoke a particular agent, the response, no matter the size, will always be one chunk.

Partial example:

bedrock_client = boto3.client(
    service_name="bedrock-agent-runtime",
    region_name="us-east-1",
)

response = bedrock_client.invoke_agent(
    inputText=input,
    endSession=False,
    enableTrace=False,
    agentId=agent_id,
    agentAliasId=agent_alias_id,
    sessionId=str(uuid.uuid4()) if session_id is None else session_id,
)

stream = response.get("completion")
if stream:
    for event in stream:
        chunk = event.get('chunk')
        print(f"Agent Chunks: {chunk}")
        if chunk:
            yield chunk.get('bytes').decode()

Expected Behavior

invoke_agent should stream multiple chunks. Therefore, "Agent Chunks:" should be printed multiple times.

Current Behavior

"Agent Chunks:" will be printed once no matter the input.

Reproduction Steps

bedrock_client = boto3.client(
    service_name="bedrock-agent-runtime",
    region_name="us-east-1",
)

response = bedrock_client.invoke_agent(
    inputText=input,
    endSession=False,
    enableTrace=False,
    agentId=agent_id,
    agentAliasId=agent_alias_id,
    sessionId=str(uuid.uuid4()) if session_id is None else session_id,
)

stream = response.get("completion")
if stream:
    for event in stream:
        chunk = event.get('chunk')
        print(f"Agent Chunks: {chunk}")
        if chunk:
            yield chunk.get('bytes').decode()

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.34.25

Environment details (OS name and version, etc.)

macOS Sonoma 14.2.1

@merojosa merojosa added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Jan 23, 2024
@meleksomai
Copy link

This seems to be the default behavior. We identified the same issue: no matter the agent's size, it only responds with the final result. I am unsure if this is a current limitation of how agents are built in Bedrock.

@tim-finnigan tim-finnigan self-assigned this May 17, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label May 17, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. The Boto3 invoke_agent command involves a call to the underlying InvokeAgent API provided by the Bedrock service. So the issue here appears related to the API rather than directly the SDK. We can escalate this issue to the Bedrock team for further review if necessary.

Version 1.34.25 is a bit out of date, have you tried updating to a more recent version? The latest version is 1.34.107 per the CHANGELOG.

In the documentation for chunk it says it "Contains a part of an agent response and citations for it.":

image

And here is a link the PayloadPart object type that we would expect to be returned.

If still seeing the issue after updating, can you provide debug logs by adding boto3.set_stream_logger('') to your script, and redact any sensitive info?

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. service-api This issue is caused by the service API, not the SDK implementation. p2 This is a standard priority issue bedrock-agent-runtime and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels May 17, 2024
Copy link

Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label May 28, 2024
@merojosa
Copy link
Author

@tim-finnigan hello, sorry for being late, I didn't get the notification of this issue.

I updated the sdk to 1.34.113 and it seems we have the same behavior (only one chunk).

Here's what boto3.set_stream_logger('') printed, I replaced everything sensible with ${CONTEXT}:

2024-05-27 20:34:22,096 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2024-05-27 20:34:22,096 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2024-05-27 20:34:22,096 botocore.hooks [DEBUG] Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2024-05-27 20:34:22,097 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2024-05-27 20:34:22,097 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2024-05-27 20:34:22,097 botocore.hooks [DEBUG] Changing event name from before-call.apigateway to before-call.api-gateway
2024-05-27 20:34:22,098 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2024-05-27 20:34:22,098 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2024-05-27 20:34:22,098 botocore.hooks [DEBUG] Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2024-05-27 20:34:22,098 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2024-05-27 20:34:22,098 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2024-05-27 20:34:22,098 botocore.hooks [DEBUG] Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to before-parameter-build.auto-scaling.CreateLaunchConfiguration
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2024-05-27 20:34:22,099 botocore.hooks [DEBUG] Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*.auto-scaling.CreateLaunchConfiguration.complete-section
2024-05-27 20:34:22,101 botocore.hooks [DEBUG] Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2024-05-27 20:34:22,101 botocore.hooks [DEBUG] Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2024-05-27 20:34:22,101 botocore.hooks [DEBUG] Changing event name from before-parameter-build.logs.CreateExportTask to before-parameter-build.cloudwatch-logs.CreateExportTask
2024-05-27 20:34:22,101 botocore.hooks [DEBUG] Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2024-05-27 20:34:22,101 botocore.hooks [DEBUG] Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2024-05-27 20:34:22,101 botocore.hooks [DEBUG] Changing event name from docs.*.logs.CreateExportTask.complete-section to docs.*.cloudwatch-logs.CreateExportTask.complete-section
2024-05-27 20:34:22,102 botocore.hooks [DEBUG] Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2024-05-27 20:34:22,102 botocore.hooks [DEBUG] Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2024-05-27 20:34:22,102 botocore.hooks [DEBUG] Changing event name from before-parameter-build.cloudsearchdomain.Search to before-parameter-build.cloudsearch-domain.Search
2024-05-27 20:34:22,102 botocore.hooks [DEBUG] Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2024-05-27 20:34:22,102 botocore.hooks [DEBUG] Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2024-05-27 20:34:22,102 botocore.hooks [DEBUG] Changing event name from docs.*.cloudsearchdomain.Search.complete-section to docs.*.cloudsearch-domain.Search.complete-section
2024-05-27 20:34:22,104 botocore.utils [DEBUG] IMDS ENDPOINT: ${AND ENDPOINT THAT I'M NOT SURE WHAT IS}
2024-05-27 20:34:22,104 botocore.utils [DEBUG] IMDS ENDPOINT: ${AND ENDPOINT THAT I'M NOT SURE WHAT IS}
2024-05-27 20:34:22,104 botocore.utils [DEBUG] IMDS ENDPOINT: ${AND ENDPOINT THAT I'M NOT SURE WHAT IS}
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: env
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: env
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: env
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: assume-role
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: assume-role
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: assume-role
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: assume-role-with-web-identity
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: assume-role-with-web-identity
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: assume-role-with-web-identity
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: sso
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: sso
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: sso
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: shared-credentials-file
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: shared-credentials-file
2024-05-27 20:34:22,105 botocore.credentials [DEBUG] Looking for credentials via: shared-credentials-file
2024-05-27 20:34:22,105 botocore.credentials [INFO] Found credentials in shared credentials file: ~/.aws/credentials
2024-05-27 20:34:22,105 botocore.credentials [INFO] Found credentials in shared credentials file: ~/.aws/credentials
2024-05-27 20:34:22,105 botocore.credentials [INFO] Found credentials in shared credentials file: ~/.aws/credentials
2024-05-27 20:34:22,106 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/endpoints.json
2024-05-27 20:34:22,106 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/endpoints.json
2024-05-27 20:34:22,106 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/endpoints.json
2024-05-27 20:34:22,124 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/sdk-default-configuration.json
2024-05-27 20:34:22,124 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/sdk-default-configuration.json
2024-05-27 20:34:22,124 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/sdk-default-configuration.json
2024-05-27 20:34:22,125 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,125 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,125 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,150 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/service-2.json.gz
2024-05-27 20:34:22,150 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/service-2.json.gz
2024-05-27 20:34:22,150 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/service-2.json.gz
2024-05-27 20:34:22,150 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/service-2.sdk-extras.json
2024-05-27 20:34:22,150 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/service-2.sdk-extras.json
2024-05-27 20:34:22,150 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/service-2.sdk-extras.json
2024-05-27 20:34:22,162 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/endpoint-rule-set-1.json.gz
2024-05-27 20:34:22,162 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/endpoint-rule-set-1.json.gz
2024-05-27 20:34:22,162 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/secretsmanager/2017-10-17/endpoint-rule-set-1.json.gz
2024-05-27 20:34:22,162 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/partitions.json
2024-05-27 20:34:22,162 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/partitions.json
2024-05-27 20:34:22,162 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/partitions.json
2024-05-27 20:34:22,162 botocore.hooks [DEBUG] Event creating-client-class.secrets-manager: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,162 botocore.hooks [DEBUG] Event creating-client-class.secrets-manager: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,162 botocore.hooks [DEBUG] Event creating-client-class.secrets-manager: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,162 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: environment_service
2024-05-27 20:34:22,162 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: environment_service
2024-05-27 20:34:22,162 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: environment_service
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: environment_global
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: environment_global
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: environment_global
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: config_service
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: config_service
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: config_service
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: config_global
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: config_global
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] Looking for endpoint for secretsmanager via: config_global
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,163 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,163 botocore.endpoint [DEBUG] Setting secretsmanager timeout as (60, 60)
2024-05-27 20:34:22,163 botocore.endpoint [DEBUG] Setting secretsmanager timeout as (60, 60)
2024-05-27 20:34:22,163 botocore.endpoint [DEBUG] Setting secretsmanager timeout as (60, 60)
2024-05-27 20:34:22,164 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/_retry.json
2024-05-27 20:34:22,164 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/_retry.json
2024-05-27 20:34:22,164 botocore.loaders [DEBUG] Loading JSON file: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/botocore/data/_retry.json
2024-05-27 20:34:22,164 botocore.client [DEBUG] Registering retry handlers for service: secretsmanager
2024-05-27 20:34:22,164 botocore.client [DEBUG] Registering retry handlers for service: secretsmanager
2024-05-27 20:34:22,164 botocore.client [DEBUG] Registering retry handlers for service: secretsmanager
2024-05-27 20:34:22,164 botocore.hooks [DEBUG] Event before-parameter-build.secrets-manager.GetSecretValue: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,164 botocore.hooks [DEBUG] Event before-parameter-build.secrets-manager.GetSecretValue: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,164 botocore.hooks [DEBUG] Event before-parameter-build.secrets-manager.GetSecretValue: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,165 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,165 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,165 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,165 botocore.regions [DEBUG] Endpoint provider result: https://secretsmanager.us-east-1.amazonaws.com
2024-05-27 20:34:22,165 botocore.regions [DEBUG] Endpoint provider result: https://secretsmanager.us-east-1.amazonaws.com
2024-05-27 20:34:22,165 botocore.regions [DEBUG] Endpoint provider result: https://secretsmanager.us-east-1.amazonaws.com
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event before-call.secrets-manager.GetSecretValue: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event before-call.secrets-manager.GetSecretValue: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event before-call.secrets-manager.GetSecretValue: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event before-call.secrets-manager.GetSecretValue: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event before-call.secrets-manager.GetSecretValue: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event before-call.secrets-manager.GetSecretValue: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,165 botocore.endpoint [DEBUG] Making request for OperationModel(name=GetSecretValue) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'secretsmanager.GetSecretValue', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"SecretId": "${SECRET NAME}"}', 'url': 'https://secretsmanager.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x1383a8a40>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,165 botocore.endpoint [DEBUG] Making request for OperationModel(name=GetSecretValue) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'secretsmanager.GetSecretValue', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"SecretId": "${SECRET NAME}"}', 'url': 'https://secretsmanager.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x1383a8a40>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,165 botocore.endpoint [DEBUG] Making request for OperationModel(name=GetSecretValue) with params: {'url_path': '/', 'query_string': '', 'method': 'POST', 'headers': {'X-Amz-Target': 'secretsmanager.GetSecretValue', 'Content-Type': 'application/x-amz-json-1.1', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"SecretId": "${SECRET NAME}"}', 'url': 'https://secretsmanager.us-east-1.amazonaws.com/', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x1383a8a40>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event request-created.secrets-manager.GetSecretValue: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x1383a89b0>>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event request-created.secrets-manager.GetSecretValue: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x1383a89b0>>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event request-created.secrets-manager.GetSecretValue: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x1383a89b0>>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event choose-signer.secrets-manager.GetSecretValue: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event choose-signer.secrets-manager.GetSecretValue: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,165 botocore.hooks [DEBUG] Event choose-signer.secrets-manager.GetSecretValue: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,165 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,165 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,165 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,165 botocore.auth [DEBUG] CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:secretsmanager.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z
x-amz-target:secretsmanager.GetSecretValue

content-type;host;x-amz-date;x-amz-target
5f7ef818e4e4f5d29664e1cf762c11fb492213d308f3006fc5d344aba37882b1
2024-05-27 20:34:22,165 botocore.auth [DEBUG] CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:secretsmanager.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z
x-amz-target:secretsmanager.GetSecretValue

content-type;host;x-amz-date;x-amz-target
5f7ef818e4e4f5d29664e1cf762c11fb492213d308f3006fc5d344aba37882b1
2024-05-27 20:34:22,165 botocore.auth [DEBUG] CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:secretsmanager.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z
x-amz-target:secretsmanager.GetSecretValue

content-type;host;x-amz-date;x-amz-target
5f7ef818e4e4f5d29664e1cf762c11fb492213d308f3006fc5d344aba37882b1
2024-05-27 20:34:22,165 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/secretsmanager/aws4_request
bd3ec9042077e1ad0b0ff061dde7073265d69c355578d7c571471fe84f680922
2024-05-27 20:34:22,165 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/secretsmanager/aws4_request
bd3ec9042077e1ad0b0ff061dde7073265d69c355578d7c571471fe84f680922
2024-05-27 20:34:22,165 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/secretsmanager/aws4_request
bd3ec9042077e1ad0b0ff061dde7073265d69c355578d7c571471fe84f680922
2024-05-27 20:34:22,166 botocore.auth [DEBUG] Signature:
9340e186b847a3e2b5911caa38167963566c3a7afded345ecc8bfa6d11e475d9
2024-05-27 20:34:22,166 botocore.auth [DEBUG] Signature:
9340e186b847a3e2b5911caa38167963566c3a7afded345ecc8bfa6d11e475d9
2024-05-27 20:34:22,166 botocore.auth [DEBUG] Signature:
9340e186b847a3e2b5911caa38167963566c3a7afded345ecc8bfa6d11e475d9
2024-05-27 20:34:22,166 botocore.hooks [DEBUG] Event request-created.secrets-manager.GetSecretValue: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,166 botocore.hooks [DEBUG] Event request-created.secrets-manager.GetSecretValue: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,166 botocore.hooks [DEBUG] Event request-created.secrets-manager.GetSecretValue: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,166 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://secretsmanager.us-east-1.amazonaws.com/, headers={'X-Amz-Target': b'secretsmanager.GetSecretValue', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/secretsmanager/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=9340e186b847a3e2b5911caa38167963566c3a7afded345ecc8bfa6d11e475d9', 'amz-sdk-invocation-id': b'49c55871-7270-44eb-a012-000fbdbaa466', 'amz-sdk-request': b'attempt=1', 'Content-Length': '30'}>
2024-05-27 20:34:22,166 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://secretsmanager.us-east-1.amazonaws.com/, headers={'X-Amz-Target': b'secretsmanager.GetSecretValue', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/secretsmanager/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=9340e186b847a3e2b5911caa38167963566c3a7afded345ecc8bfa6d11e475d9', 'amz-sdk-invocation-id': b'49c55871-7270-44eb-a012-000fbdbaa466', 'amz-sdk-request': b'attempt=1', 'Content-Length': '30'}>
2024-05-27 20:34:22,166 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=False, method=POST, url=https://secretsmanager.us-east-1.amazonaws.com/, headers={'X-Amz-Target': b'secretsmanager.GetSecretValue', 'Content-Type': b'application/x-amz-json-1.1', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/secretsmanager/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=9340e186b847a3e2b5911caa38167963566c3a7afded345ecc8bfa6d11e475d9', 'amz-sdk-invocation-id': b'49c55871-7270-44eb-a012-000fbdbaa466', 'amz-sdk-request': b'attempt=1', 'Content-Length': '30'}>
2024-05-27 20:34:22,166 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,166 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,166 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,166 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): secretsmanager.us-east-1.amazonaws.com:443
2024-05-27 20:34:22,166 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): secretsmanager.us-east-1.amazonaws.com:443
2024-05-27 20:34:22,166 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): secretsmanager.us-east-1.amazonaws.com:443
2024-05-27 20:34:22,791 urllib3.connectionpool [DEBUG] https://secretsmanager.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 200 1471
2024-05-27 20:34:22,791 urllib3.connectionpool [DEBUG] https://secretsmanager.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 200 1471
2024-05-27 20:34:22,791 urllib3.connectionpool [DEBUG] https://secretsmanager.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 200 1471
2024-05-27 20:34:22,791 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': 'e18f9ba6-92cb-464d-b8c4-fe1e790d739d', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1471', 'Date': 'Tue, 28 May 2024 02:34:21 GMT'}
2024-05-27 20:34:22,791 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': 'e18f9ba6-92cb-464d-b8c4-fe1e790d739d', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1471', 'Date': 'Tue, 28 May 2024 02:34:21 GMT'}
2024-05-27 20:34:22,791 botocore.parsers [DEBUG] Response headers: {'x-amzn-RequestId': 'e18f9ba6-92cb-464d-b8c4-fe1e790d739d', 'Content-Type': 'application/x-amz-json-1.1', 'Content-Length': '1471', 'Date': 'Tue, 28 May 2024 02:34:21 GMT'}
2024-05-27 20:34:22,791 botocore.parsers [DEBUG] Response body:
b'${SECRET INFO}'
2024-05-27 20:34:22,791 botocore.parsers [DEBUG] Response body:
b'${SECRET INFO}'
2024-05-27 20:34:22,791 botocore.parsers [DEBUG] Response body:
b'${SECRET INFO}'
2024-05-27 20:34:22,792 botocore.hooks [DEBUG] Event needs-retry.secrets-manager.GetSecretValue: calling handler <botocore.retryhandler.RetryHandler object at 0x1383a9e20>
2024-05-27 20:34:22,792 botocore.hooks [DEBUG] Event needs-retry.secrets-manager.GetSecretValue: calling handler <botocore.retryhandler.RetryHandler object at 0x1383a9e20>
2024-05-27 20:34:22,792 botocore.hooks [DEBUG] Event needs-retry.secrets-manager.GetSecretValue: calling handler <botocore.retryhandler.RetryHandler object at 0x1383a9e20>
2024-05-27 20:34:22,792 botocore.retryhandler [DEBUG] No retry needed.
2024-05-27 20:34:22,792 botocore.retryhandler [DEBUG] No retry needed.
2024-05-27 20:34:22,792 botocore.retryhandler [DEBUG] No retry needed.
TEST
INFO:     127.0.0.1:63496 - "POST /api/call-bedrock-agent HTTP/1.1" 200 OK
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event choose-service-name: calling handler <function handle_service_name_alias at 0x1066522a0>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event creating-client-class.bedrock-agent-runtime: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event creating-client-class.bedrock-agent-runtime: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event creating-client-class.bedrock-agent-runtime: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,794 botocore.hooks [DEBUG] Event creating-client-class.bedrock-agent-runtime: calling handler <function add_generate_presigned_url at 0x106582f20>
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: environment_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_service
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] Looking for endpoint for bedrock-agent-runtime via: config_global
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,794 botocore.configprovider [DEBUG] No configured endpoint found.
2024-05-27 20:34:22,794 botocore.regions [DEBUG] Creating a regex based endpoint for bedrock-agent-runtime, us-east-1
2024-05-27 20:34:22,794 botocore.regions [DEBUG] Creating a regex based endpoint for bedrock-agent-runtime, us-east-1
2024-05-27 20:34:22,794 botocore.regions [DEBUG] Creating a regex based endpoint for bedrock-agent-runtime, us-east-1
2024-05-27 20:34:22,794 botocore.regions [DEBUG] Creating a regex based endpoint for bedrock-agent-runtime, us-east-1
2024-05-27 20:34:22,800 botocore.endpoint [DEBUG] Setting bedrock-agent-runtime timeout as (60, 60)
2024-05-27 20:34:22,800 botocore.endpoint [DEBUG] Setting bedrock-agent-runtime timeout as (60, 60)
2024-05-27 20:34:22,800 botocore.endpoint [DEBUG] Setting bedrock-agent-runtime timeout as (60, 60)
2024-05-27 20:34:22,800 botocore.endpoint [DEBUG] Setting bedrock-agent-runtime timeout as (60, 60)
2024-05-27 20:34:22,801 botocore.client [DEBUG] Registering retry handlers for service: bedrock-agent-runtime
2024-05-27 20:34:22,801 botocore.client [DEBUG] Registering retry handlers for service: bedrock-agent-runtime
2024-05-27 20:34:22,801 botocore.client [DEBUG] Registering retry handlers for service: bedrock-agent-runtime
2024-05-27 20:34:22,801 botocore.client [DEBUG] Registering retry handlers for service: bedrock-agent-runtime
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-parameter-build.bedrock-agent-runtime.InvokeAgent: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-parameter-build.bedrock-agent-runtime.InvokeAgent: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-parameter-build.bedrock-agent-runtime.InvokeAgent: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-parameter-build.bedrock-agent-runtime.InvokeAgent: calling handler <function generate_idempotent_uuid at 0x106653ce0>
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Calling endpoint provider with parameters: {'Region': 'us-east-1', 'UseDualStack': False, 'UseFIPS': False}
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Endpoint provider result: https://bedrock-agent-runtime.us-east-1.amazonaws.com
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Endpoint provider result: https://bedrock-agent-runtime.us-east-1.amazonaws.com
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Endpoint provider result: https://bedrock-agent-runtime.us-east-1.amazonaws.com
2024-05-27 20:34:22,801 botocore.regions [DEBUG] Endpoint provider result: https://bedrock-agent-runtime.us-east-1.amazonaws.com
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,801 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function add_recursion_detection_header at 0x1066531a0>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event before-call.bedrock-agent-runtime.InvokeAgent: calling handler <function inject_api_version_header_if_needed at 0x106675800>
2024-05-27 20:34:22,802 botocore.endpoint [DEBUG] Making request for OperationModel(name=InvokeAgent) with params: {'url_path': '${AGENT URL PATH WITH SESSION ID}', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"inputText": ${QUESTION TO AGENT}, "endSession": false, "enableTrace": false}', 'url': '${AGENT URL}', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x13833bfe0>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,802 botocore.endpoint [DEBUG] Making request for OperationModel(name=InvokeAgent) with params: {'url_path': '${AGENT URL PATH WITH SESSION ID}', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"inputText": ${QUESTION TO AGENT}, "endSession": false, "enableTrace": false}', 'url': '${AGENT URL}', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x13833bfe0>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,802 botocore.endpoint [DEBUG] Making request for OperationModel(name=InvokeAgent) with params: {'url_path': '${AGENT URL PATH WITH SESSION ID}', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"inputText": ${QUESTION TO AGENT}, "endSession": false, "enableTrace": false}', 'url': '${AGENT URL}', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x13833bfe0>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,802 botocore.endpoint [DEBUG] Making request for OperationModel(name=InvokeAgent) with params: {'url_path': '${AGENT URL PATH WITH SESSION ID}', 'query_string': {}, 'method': 'POST', 'headers': {'Content-Type': 'application/json', 'User-Agent': 'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113'}, 'body': b'{"inputText": ${QUESTION TO AGENT}, "endSession": false, "enableTrace": false}', 'url': '${AGENT URL}', 'context': {'client_region': 'us-east-1', 'client_config': <botocore.config.Config object at 0x13833bfe0>, 'has_streaming_input': False, 'auth_type': None}}
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x12e3f8080>>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x12e3f8080>>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x12e3f8080>>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x12e3f8080>>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event choose-signer.bedrock-agent-runtime.InvokeAgent: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event choose-signer.bedrock-agent-runtime.InvokeAgent: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event choose-signer.bedrock-agent-runtime.InvokeAgent: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,802 botocore.hooks [DEBUG] Event choose-signer.bedrock-agent-runtime.InvokeAgent: calling handler <function set_operation_specific_signer at 0x106653ba0>
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Calculating signature using v4 auth.
2024-05-27 20:34:22,803 botocore.auth [DEBUG] CanonicalRequest:
POST
${SOME URL RELATED TO MY AGENT}

content-type:application/json
host:bedrock-agent-runtime.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z

content-type;host;x-amz-date
802590ca1423a613ae2bd3e5587167fe2fe5c3ddb7b748a1a3c1f2a1bd18ef2c
2024-05-27 20:34:22,803 botocore.auth [DEBUG] CanonicalRequest:
POST
${SOME URL RELATED TO MY AGENT WITH SESSION ID}

content-type:application/json
host:bedrock-agent-runtime.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z

content-type;host;x-amz-date
802590ca1423a613ae2bd3e5587167fe2fe5c3ddb7b748a1a3c1f2a1bd18ef2c
2024-05-27 20:34:22,803 botocore.auth [DEBUG] CanonicalRequest:
POST
${SOME URL RELATED TO MY AGENT WITH SESSION ID}

content-type:application/json
host:bedrock-agent-runtime.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z

content-type;host;x-amz-date
802590ca1423a613ae2bd3e5587167fe2fe5c3ddb7b748a1a3c1f2a1bd18ef2c
2024-05-27 20:34:22,803 botocore.auth [DEBUG] CanonicalRequest:
POST
${SOME URL RELATED TO MY AGENT WITH SESSION ID}

content-type:application/json
host:bedrock-agent-runtime.us-east-1.amazonaws.com
x-amz-date:20240528T023422Z

content-type;host;x-amz-date
802590ca1423a613ae2bd3e5587167fe2fe5c3ddb7b748a1a3c1f2a1bd18ef2c
2024-05-27 20:34:22,803 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/bedrock/aws4_request
fce4ca6e42e4ff97b723ff6472f515514a93eea3d5898d4dc13a75157a6c90e4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/bedrock/aws4_request
fce4ca6e42e4ff97b723ff6472f515514a93eea3d5898d4dc13a75157a6c90e4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/bedrock/aws4_request
fce4ca6e42e4ff97b723ff6472f515514a93eea3d5898d4dc13a75157a6c90e4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] StringToSign:
AWS4-HMAC-SHA256
20240528T023422Z
20240528/us-east-1/bedrock/aws4_request
fce4ca6e42e4ff97b723ff6472f515514a93eea3d5898d4dc13a75157a6c90e4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Signature:
f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Signature:
f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Signature:
f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4
2024-05-27 20:34:22,803 botocore.auth [DEBUG] Signature:
f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4
2024-05-27 20:34:22,803 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,803 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,803 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,803 botocore.hooks [DEBUG] Event request-created.bedrock-agent-runtime.InvokeAgent: calling handler <function add_retry_headers at 0x106676020>
2024-05-27 20:34:22,803 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=True, method=POST, url=${SOME URL RELATED TO MY AGENT WITH SESSION ID}, headers={'Content-Type': b'application/json', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/bedrock/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4', 'amz-sdk-invocation-id': b'0bf4d964-0fe7-4d41-9e5f-f90573b57c31', 'amz-sdk-request': b'attempt=1', 'Content-Length': '80'}>
2024-05-27 20:34:22,803 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=True, method=POST, url=${SOME URL RELATED TO MY AGENT WITH SESSION ID}, headers={'Content-Type': b'application/json', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/bedrock/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4', 'amz-sdk-invocation-id': b'0bf4d964-0fe7-4d41-9e5f-f90573b57c31', 'amz-sdk-request': b'attempt=1', 'Content-Length': '80'}>
2024-05-27 20:34:22,803 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=True, method=POST, url=${SOME URL RELATED TO MY AGENT WITH SESSION ID}, headers={'Content-Type': b'application/json', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/bedrock/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4', 'amz-sdk-invocation-id': b'0bf4d964-0fe7-4d41-9e5f-f90573b57c31', 'amz-sdk-request': b'attempt=1', 'Content-Length': '80'}>
2024-05-27 20:34:22,803 botocore.endpoint [DEBUG] Sending http request: <AWSPreparedRequest stream_output=True, method=POST, url=${SOME URL RELATED TO MY AGENT WITH SESSION ID}, headers={'Content-Type': b'application/json', 'User-Agent': b'Boto3/1.34.113 md/Botocore#1.34.113 ua/2.0 os/macos#23.5.0 md/arch#arm64 lang/python#3.12.0 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.34.113', 'X-Amz-Date': b'20240528T023422Z', 'Authorization': b'AWS4-HMAC-SHA256 Credential=AKIAQFKQU5GHXS7N7ZH5/20240528/us-east-1/bedrock/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=f648e0f9a04a0a6cefbf233a48567c09177aeafbf99c468f3fa8b3a3ccb052d4', 'amz-sdk-invocation-id': b'0bf4d964-0fe7-4d41-9e5f-f90573b57c31', 'amz-sdk-request': b'attempt=1', 'Content-Length': '80'}>
2024-05-27 20:34:22,803 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,803 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,803 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,803 botocore.httpsession [DEBUG] Certificate path: /Users/jose.mejias/Documents/Projects/sc/SCCMProductSandbox01/app/.venv/lib/python3.12/site-packages/certifi/cacert.pem
2024-05-27 20:34:22,804 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): bedrock-agent-runtime.us-east-1.amazonaws.com:443
2024-05-27 20:34:22,804 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): bedrock-agent-runtime.us-east-1.amazonaws.com:443
2024-05-27 20:34:22,804 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): bedrock-agent-runtime.us-east-1.amazonaws.com:443
2024-05-27 20:34:22,804 urllib3.connectionpool [DEBUG] Starting new HTTPS connection (1): bedrock-agent-runtime.us-east-1.amazonaws.com:443
2024-05-27 20:34:23,348 urllib3.connectionpool [DEBUG] https://bedrock-agent-runtime.us-east-1.amazonaws.com:443 "POST ${SOME URL RELATED TO MY AGENT WITH SESSION ID} HTTP/1.1" 200 None
2024-05-27 20:34:23,348 urllib3.connectionpool [DEBUG] https://bedrock-agent-runtime.us-east-1.amazonaws.com:443 "POST ${SOME URL RELATED TO MY AGENT WITH SESSION ID} HTTP/1.1" 200 None
2024-05-27 20:34:23,348 urllib3.connectionpool [DEBUG] https://bedrock-agent-runtime.us-east-1.amazonaws.com:443 "POST ${SOME URL RELATED TO MY AGENT WITH SESSION ID} 200 None
2024-05-27 20:34:23,348 urllib3.connectionpool [DEBUG] https://bedrock-agent-runtime.us-east-1.amazonaws.com:443 "POST ${SOME URL RELATED TO MY AGENT WITH SESSION ID} HTTP/1.1" 200 None
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response headers: {'Date': 'Tue, 28 May 2024 02:34:23 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'ba1270e6-5fdc-4596-9587-5a2c590bab6a', 'x-amz-bedrock-agent-session-id': 'cd0381d0-f2f9-4196-92fb-da95893a678a', 'x-amzn-bedrock-agent-content-type': 'application/json'}
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response headers: {'Date': 'Tue, 28 May 2024 02:34:23 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'ba1270e6-5fdc-4596-9587-5a2c590bab6a', 'x-amz-bedrock-agent-session-id': 'cd0381d0-f2f9-4196-92fb-da95893a678a', 'x-amzn-bedrock-agent-content-type': 'application/json'}
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response headers: {'Date': 'Tue, 28 May 2024 02:34:23 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'ba1270e6-5fdc-4596-9587-5a2c590bab6a', 'x-amz-bedrock-agent-session-id': 'cd0381d0-f2f9-4196-92fb-da95893a678a', 'x-amzn-bedrock-agent-content-type': 'application/json'}
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response headers: {'Date': 'Tue, 28 May 2024 02:34:23 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-amzn-RequestId': 'ba1270e6-5fdc-4596-9587-5a2c590bab6a', 'x-amz-bedrock-agent-session-id': 'cd0381d0-f2f9-4196-92fb-da95893a678a', 'x-amzn-bedrock-agent-content-type': 'application/json'}
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response body:
<urllib3.response.HTTPResponse object at 0x138338af0>
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response body:
<urllib3.response.HTTPResponse object at 0x138338af0>
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response body:
<urllib3.response.HTTPResponse object at 0x138338af0>
2024-05-27 20:34:23,348 botocore.parsers [DEBUG] Response body:
<urllib3.response.HTTPResponse object at 0x138338af0>
2024-05-27 20:34:23,348 botocore.hooks [DEBUG] Event needs-retry.bedrock-agent-runtime.InvokeAgent: calling handler <botocore.retryhandler.RetryHandler object at 0x138339790>
2024-05-27 20:34:23,348 botocore.hooks [DEBUG] Event needs-retry.bedrock-agent-runtime.InvokeAgent: calling handler <botocore.retryhandler.RetryHandler object at 0x138339790>
2024-05-27 20:34:23,348 botocore.hooks [DEBUG] Event needs-retry.bedrock-agent-runtime.InvokeAgent: calling handler <botocore.retryhandler.RetryHandler object at 0x138339790>
2024-05-27 20:34:23,348 botocore.hooks [DEBUG] Event needs-retry.bedrock-agent-runtime.InvokeAgent: calling handler <botocore.retryhandler.RetryHandler object at 0x138339790>
2024-05-27 20:34:23,348 botocore.retryhandler [DEBUG] No retry needed.
2024-05-27 20:34:23,348 botocore.retryhandler [DEBUG] No retry needed.
2024-05-27 20:34:23,348 botocore.retryhandler [DEBUG] No retry needed.
2024-05-27 20:34:23,348 botocore.retryhandler [DEBUG] No retry needed.
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response headers: {':event-type': 'chunk', ':content-type': 'application/json', ':message-type': 'event'}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response headers: {':event-type': 'chunk', ':content-type': 'application/json', ':message-type': 'event'}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response headers: {':event-type': 'chunk', ':content-type': 'application/json', ':message-type': 'event'}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response headers: {':event-type': 'chunk', ':content-type': 'application/json', ':message-type': 'event'}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response body:
b'{"attribution":{"citations":[{"generatedResponsePart":{"textResponsePart":{"span":{"end":291,"start":0},"text":"${AGENT ANSWER}"}},"retrievedReferences":${REFERENCE ANSWER}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response body:
b'{"attribution":{"citations":[{"generatedResponsePart":{"textResponsePart":{"span":{"end":291,"start":0},"text":"${AGENT ANSWER}"}},"retrievedReferences":${REFERENCE ANSWER}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response body:
b'{"attribution":{"citations":[{"generatedResponsePart":{"textResponsePart":{"span":{"end":291,"start":0},"text":"${AGENT ANSWER}"}},"retrievedReferences":${REFERENCE ANSWER}
2024-05-27 20:34:41,828 botocore.parsers [DEBUG] Response body:
b'{"attribution":{"citations":[{"generatedResponsePart":{"textResponsePart":{"span":{"end":291,"start":0},"text":"${AGENT ANSWER}"}},"retrievedReferences":${REFERENCE ANSWER}

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional information or feedback. labels May 29, 2024
@tim-finnigan
Copy link
Contributor

Thanks for following up. I confirmed with the Bedrock team that this is the expected behavior, and InvokeAgent API currently only returns one chunk. And you can use trace events for details on the steps being orchestrated by the agent. I think the API documentation could be better clarified regarding the current behavior, so I created an internal ticket for the Bedrock team.

If you'd like to send any feedback directly as well, please use the Provide feedback link at the bottom of the API documentation page, and any updates to the docs will also be reflected in the Boto3 docs.

Copy link

github-actions bot commented Jun 5, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bedrock-agent-runtime bug This issue is a confirmed bug. p2 This is a standard priority issue service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

3 participants