-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
base: main
Are you sure you want to change the base?
Conversation
…agraphs in incorrect segments to correct custom blocks. Some information was lost, for list flows, which does not have a current scenario in metadata.
parser = argparse.ArgumentParser( | ||
description="Work with knowledge bases in your AWS account." | ||
) | ||
parser.add_argument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to run these steps together as a set? For example: Create a KnowledgeBase, List, Get, Update, then Delete? With the role created as part of the process? Otherwise the user has to know what the required Role will look like, and provide the arn. We try to have scenarios be self-contained. For more information, see the example standards. If this is not possible for some reason and an exception needs to be made, let us know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @gausekha, did you have a chance to review Rachel's note here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rlhagerm and @beqqrry-aws my apologies got caught up with a few things and didn't get a chance! Shall check and get back on this. It should be possible to run the examples in a set using the created role shall confirm and get back on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rlhagerm and @beqqrry-aws I just added the IAM role and a scenario: gausekha@0dec32e. I am trying to run this locally but keep running into an error about specifying the region. Could you please take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gausekha , I'm not getting any error about the region. Maybe you need to specify it in your profile? What I am getting is this, which seems to be a problem with the specified CollectionArn. I don't think it's supposed to be the same as the embeddingModelArn.
botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the CreateKnowledgeBase operation: 1 validation error detected: Value 'arn:aws:bedrock:us-east-1::foundati on-model/amazon.titan-embed-text-v1' at 'storageConfiguration.opensearchServerlessConfiguration.collectionArn' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws(-cn|- us-gov|-eusc|-iso(-[b-f])?)?:aoss:([a-z]{2,}-){2,}\d:\d{12}:collection/[a-z0-9-]{3,32}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see - got it that makes sense. Shall update it, thanks for catching it! And yes, shall try to update my profile as well and get a clean build before pushing the next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rlhagerm Please LMK once you have a chance to look at this. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the CollectionArn something the user is supposed to provide? It looks like what is in there now is a placeholder, which may be fine, but we should include some information on how to provide the correct value and/or replace it in the code.
…-doc-sdk-examples into gausekha-kb-python-examples
"storageConfiguration": { | ||
"type": "OPENSEARCH_SERVERLESS", | ||
"opensearchServerlessConfiguration": { | ||
"collectionArn": "arn:aws:aoss:us-east-1::123456789012:collection/abcdefgh12345678defgh", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, does the collection arn come from a pre-existing collection? Does the user need to configure it somewhere first and provide it as an input? It seems unclear how the arn is set.
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.