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.retrieve(**kwargs) -> Response 'metadata' lost 'x-amz-bedrock-kb-chunk-id' #4256

Closed
GxWwT opened this issue Sep 5, 2024 · 7 comments
Assignees
Labels
bedrock-agent-runtime bug This issue is a confirmed bug. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional information or feedback. service-api This issue is caused by the service API, not the SDK implementation.

Comments

@GxWwT
Copy link

GxWwT commented Sep 5, 2024

Describe the bug

AgentsforBedrockRuntime.Client.retrieve(**kwargs) -> Response 'metadata' lost 'x-amz-bedrock-kb-chunk-id'.
'x-amz-bedrock-kb-chunk-id' is important since it is a good param to remove deduplicate chunks.

Expected Behavior

AgentsforBedrockRuntime.Client.retrieve(**kwargs) -> Response 'metadata' get beck 'x-amz-bedrock-kb-chunk-id'

Current Behavior

AgentsforBedrockRuntime.Client.retrieve(**kwargs) -> Response 'metadata' lost 'x-amz-bedrock-kb-chunk-id'

Reproduction Steps

AgentsforBedrockRuntime.Client.retrieve(**kwargs) -> Response 'metadata' lost 'x-amz-bedrock-kb-chunk-id'

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.35.12

Environment details (OS name and version, etc.)

1.35.12

@GxWwT GxWwT added bug This issue is a confirmed bug. needs-triage This issue or PR still needs to be triaged. labels Sep 5, 2024
@tim-finnigan tim-finnigan self-assigned this Sep 5, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. Can you provide more details on this issue? Here are the Boto3 commands for AgentsforBedrockRuntime: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agent-runtime.html. Specifically we'd like to understand what command(s) you're using and what you are trying to do.

Please note that running these commands involves calls to the upstream service APIs: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_Operations_Agents_for_Amazon_Bedrock_Runtime.html, so any issues or feature requests for the API would need to get rerouted to the service team.

@tim-finnigan tim-finnigan added response-requested Waiting on additional information or feedback. p2 This is a standard priority issue bedrock-agent-runtime and removed needs-triage This issue or PR still needs to be triaged. labels Sep 5, 2024
@GxWwT
Copy link
Author

GxWwT commented Sep 6, 2024

bedrock_agent_runtime_client = boto3.client(service_name="bedrock-agent-runtime", config=my_config)
response = bedrock_agent_runtime_client.retrieve(...)
Example:
{'ResponseMetadata': {'RequestId': '', 'HTTPStatusCode': 200, 'HTTPHeaders': {'date': '', 'content-type': 'application/json', 'content-length': '', 'connection': 'keep-alive', 'x-amzn-requestid': ''}, 'RetryAttempts': 0}, 'retrievalResults': [{'content': {'text': ''}, 'location': {'s3Location': {'uri': 's3://'}, 'type': 'S3'}, 'metadata': {'x-amz-bedrock-kb-source-uri': 's3://', 'x-amz-bedrock-kb-chunk-id': '1%3A0%3Ag', 'x-amz-bedrock-kb-data-source-id': ''}, 'score': 0.37288174},

Now, there is no "x-amz-bedrock-kb-chunk-id"

@GxWwT
Copy link
Author

GxWwT commented Sep 6, 2024

x-amz-bedrock-kb-chunk-id is important since there is no unique id to remove deduplicate chunks.

@tim-finnigan
Copy link
Contributor

Thanks for following up. We would need to reach out to the Bedrock team regarding this issue, since running the retrieve command involves a call to the Retrieve API. Before doing that could you share your debug logs (with any sensitive info redacted) by adding boto3.set_stream_logger('') to your script? That will help with the investigation.

Also can you tell us if x-amz-bedrock-kb-chunk-id is now always missing when it was previously always present? Or is it now only sometimes in the response?

@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. and removed response-requested Waiting on additional information or feedback. labels Sep 6, 2024
@GxWwT
Copy link
Author

GxWwT commented Sep 6, 2024

I guess x-amz-bedrock-kb-chunk-id missing or not depends on the Chunking strategy of Bedrock Knowledge Base.
If Chunking strategy is Hierarchical chunking or Semantic chunking, then missing.
If Chunking strategy is No chunking or fixed chunking , then not missing.

@github-actions github-actions bot removed the response-requested Waiting on additional information or feedback. label Sep 7, 2024
@tim-finnigan
Copy link
Contributor

tim-finnigan commented Sep 12, 2024

@GxWwT to be clear, the SDK returns the response from the Bedrock API. Are you asking for clarification on the behavior here? Please let me know if you have a specific question for the Bedrock team. If you are requesting that the documentation be clarified, please use the Provide feedback link at the bottom of the API documentation page, and any updates will be reflected in the SDK docs.

@tim-finnigan tim-finnigan added the response-requested Waiting on additional information or feedback. label Sep 12, 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 closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 23, 2024
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. closed-for-staleness p2 This is a standard priority issue response-requested Waiting on additional information or feedback. service-api This issue is caused by the service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants