Skip to content

Added KB examples and tests and updated metadata file #7451

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

Merged
merged 19 commits into from
Jul 8, 2025

Conversation

gausekha
Copy link
Contributor

This pull request adds code examples for the APIs CreateKnowledgeBase, GetKnowledgeBase, UpdateKnowledgeBase, DeleteKnowledgeBase, and ListKnowledgeBases APIs. The same submission was made earlier but running the writeme created a large number of file diffs. This submission hopes to avoid such a large commit.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the Python This issue relates to the AWS SDK for Python (boto3) label May 16, 2025
DavidSouther and others added 3 commits May 19, 2025 14:23
…agraphs in incorrect segments to correct custom blocks. Some information was lost, for list flows, which does not have a current scenario in metadata.
@rlhagerm rlhagerm added the On Call Review needed This work needs an on-call review label Jun 16, 2025
@beqqrry-aws
Copy link
Member

@gausekha Looks like you're failing the linting at this point. If you can get that fixed up, we should be able to get this merged soon.

@beqqrry-aws beqqrry-aws added the Task A general update to the code base for language clarification, missing actions, tests, etc. label Jun 18, 2025
@gausekha
Copy link
Contributor Author

@beqqrry-aws Is it this error? Just checking. For some reason, KB requires a certain range of uuid values and I had to add this change for the tests to pass. Do you have any suggestions around this if that's the case?

error:
cannot format python/example_code/bedrock-agent/knowledge_bases/knowledge_base.py: Cannot parse: 68:0: "clientToken": "test-client-token-" + str(uuid.uuid4())

@beqqrry-aws
Copy link
Member

beqqrry-aws commented Jun 30, 2025

@beqqrry-aws Is it this error? Just checking. For some reason, KB requires a certain range of uuid values and I had to add this change for the tests to pass. Do you have any suggestions around this if that's the case?

error: cannot format python/example_code/bedrock-agent/knowledge_bases/knowledge_base.py: Cannot parse: 68:0: "clientToken": "test-client-token-" + str(uuid.uuid4())

@gausekha

Yes, that looks to be the error. My guess is it's having trouble understanding the concatenation inside of a dictionary value. Try encapsulating the whole thing in an f string instead, so it can be parsed as a single value.

@scmacdon scmacdon added On Call Review complete On call review complete and removed On Call Review needed This work needs an on-call review labels Jul 4, 2025
@rlhagerm
Copy link
Contributor

rlhagerm commented Jul 7, 2025

@gausekha , I saw this was still unmerged and I made a couple adjustments to the text and the tests, to get the tests and the PR checks passing again. If you agree with them and comment here, I will merge it.

@gausekha
Copy link
Contributor Author

gausekha commented Jul 7, 2025

Yes, thanks so much @rlhagerm they look good to me! Also, apologies for the delay @beqqrry-aws ! I have been a bit heads down and didn't get a chance to look at the linting issue. I'll try to resolve it this week if possible but if not it may have to wait until next week. Apologies for the delay!

@rlhagerm
Copy link
Contributor

rlhagerm commented Jul 8, 2025

@gausekha , I resolved the linting issue for you also. Merging today.

@rlhagerm rlhagerm merged commit 95464c3 into awsdocs:main Jul 8, 2025
16 checks passed
@gausekha
Copy link
Contributor Author

gausekha commented Jul 8, 2025

Awesome, thanks so much for taking care of that as well, Rachel! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Call Review complete On call review complete Python This issue relates to the AWS SDK for Python (boto3) Task A general update to the code base for language clarification, missing actions, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants