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

Add Navigator Tabular 101 notebook for AWS Bedrock #495

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

johntmyers
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gretel-blueprints ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 10:21pm

@mckornfield
Copy link
Contributor

We talked about this on a call but I think we should swap out the profile bits to make it more usable in collab, namely something like the following for the bedrock client

AWS_ACCESS_KEY = getpass("AWS Acces key: ")
AWS_SECRET_KEY = getpass("AWS Secret key: ")
AWS_REGION = input(f"AWS Region [default: {default_region}]: ") or "us-east-1"

bedrock_client = boto3.client(
    service_name="bedrock-runtime",
    region_name=AWS_REGION,
    aws_access_key_id=AWS_ACCESS_KEY,
    aws_secret_access_key=AWS_SECRET_KEY,
)

@yamini
Copy link
Contributor

yamini commented Dec 6, 2024

We talked about this on a call but I think we should swap out the profile bits to make it more usable in collab, namely something like the following for the bedrock client

AWS_ACCESS_KEY = getpass("AWS Acces key: ")
AWS_SECRET_KEY = getpass("AWS Secret key: ")
AWS_REGION = input(f"AWS Region [default: {default_region}]: ") or "us-east-1"

bedrock_client = boto3.client(
    service_name="bedrock-runtime",
    region_name=AWS_REGION,
    aws_access_key_id=AWS_ACCESS_KEY,
    aws_secret_access_key=AWS_SECRET_KEY,
)

I tested a version of this notebook in Colab, and got it to work. Updated the credentials section, but also moved a couple of other things around. I commented out the profile section so it's still available for anyone who wants to continue using profiles.

# Set default region and get credentials securely
default_region = "us-east-1"  # Using the notebook's original region as default
AWS_ACCESS_KEY = getpass("AWS Access key: ")
AWS_SECRET_KEY = getpass("AWS Secret key: ")
AWS_SESSION_TOKEN = getpass("AWS Session token (press Enter if not using temporary credentials): ") or None
AWS_REGION = input(f"AWS Region [default: {default_region}]: ") or default_region
ENDPOINT_NAME = input("Endpoint name: ")

# Initialize the boto3 client with explicit credentials
bedrock_client = boto3.client(
    service_name="bedrock-runtime",
    region_name=AWS_REGION,
    aws_access_key_id=AWS_ACCESS_KEY,
    aws_secret_access_key=AWS_SECRET_KEY,
    aws_session_token=AWS_SESSION_TOKEN if AWS_SESSION_TOKEN else None
)

Copy link
Contributor

@mckornfield mckornfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one comment on the setup, and also we should probably replace the pip install with the regular install once the release is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants