Fun on a Friday with Prompt Engineering and thinking about re:Invent 2023
Prithee, kind attendees of the grand assembly of AWS re:Invent, heed this counsel for a prosperous sojourn. Don attire that grants thee comfort for thy feet, as the day is long and filled with much ambulation.
How to Make the Most of Thy Visit to the Great Assembly of re:Invent
With a heart full o' rum and adventure, set forth on this grand escapade through AWS re:Invent
Certainly! Let's navigate AWS re:Invent through the lyrical avenues of poetry
Throw your hands up, from dawn to dusk, At AWS re:Invent, innovation's a must!
Edit
button, select the ones you want to accept, then click Save
- I selected all of them to be able to test the different ones. I then used the AWS CLI to call the different models, and this is where I needed to do some command-line work. I wanted to be able to reuse the input text, so I added the bullet points to a file called input_text.txt
, and used input_prompt.txt
for my prompts. The example from the documentation shows the following:1
2
3
aws bedrock-runtime invoke-model \
--model-id anthropic.claude-v2 \
--body "{\"prompt\": \"\n\nHuman:story of two dogs\n\nAssistant:\"}" invoke-model-output.txt
💡If you receive an error withaws: error: argument command: Invalid choice, valid choices are:
, you need to update your AWS CLI to the latest version, Amazon Bedrock was made generally available on 28 September 2023.
1
2
3
aws bedrock-runtime invoke-model \
--model-id anthropic.claude-v2 \
--body "{\"prompt\": \"\n\nHuman:$(jq -Rs . < input_prompt.txt)\n$(jq -Rs . < input_text.txt)\nAssistant:\"}" model_response_output.txt
string argument should contain only ASCII characters
due to the jq
encoded strings starting and ending a quote ("
). For this I needed to do a search and found the following sed
command which did the trick:1
sed -e 's/^"//' -e 's/"$//'
1
2
3
4
5
# command
jq -Rs . < input_prompt.txt | sed -e 's/^"//' -e 's/"$//'
# output
Using the following text, can you please change the style to be 16th century English, and make it more dramatic by comparing mistakes you could make with historical events prior to the 17th century?\n
1
2
3
aws bedrock-runtime invoke-model \
--model-id anthropic.claude-v2 \
--body "{\"prompt\": \"\n\nHuman:$(jq -Rs . < input_prompt.txt | sed -e 's/^"//' -e 's/"$//')\n$(jq -Rs . < input_prompt.txt | sed -e 's/^"//' -e 's/"$//')\nAssistant:\"}" model_response_output.txt
string argument should contain only ASCII characters
. Turns out that by using sed
, I may be stripping out the line breaks.bash
command. I specifically wanted to use the CLI for my first test, but this shouts "write a script in a programming language" to me with my limited bash
skills.Update inference configurations
.Re:Invent Calls You In
- Connect with other attendees on the AWS forums or via social media before the event. You can find potential session partners or people to meet up with at meals/events.
- Plan a buffer between sessions to allow time for Q&A, walking between venues, bathroom breaks, etc. Don't feel obligated to rush from one session straight to the next.
- Prioritize the sessions you most want to attend and be flexible with your schedule for others. Sometimes unexpected topics end up being most valuable.
- Bring a small notebook and pen to take notes in sessions. Jotting down key takeaways and questions will help you retain information.
- Visit the expo early to avoid long lines and crowds. Check out the demo areas when they're less busy.
- Keep an open mind and take opportunities to learn beyond just the sessions. Chatting with exhibitors and other attendees can provide great insights.
- Consider joining informal networking events like lunches/dinners organized by user groups if you want to dive deeper on specific topics.
- Pace yourself throughout the week! Rehydrating, eating healthy snacks, and taking breaks will help you maximize your experience.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
How to make the most of your time at re:Invent:
## Customize your visit by using the mobile app
The AWS Events mobile app is your companion in planning and navigating your re:Invent experience. With the app, you can explore sessions, add events to your planner, get updates and notifications about sessions and activities, and view a map of the re:Invent campus.
## Wear comfortable shoes.
You’ll be busy walking from session to session, so make sure you wear shoes that will get you from point A to point B comfortably!
## Calculate travel time when moving from one activity to the other.
Spread across six venues, the re:Invent campus is quite large, so be sure to factor in travel time either walking from place to place or catching shuttles.
## Don’t miss any sessions – plan your schedule in advance.
Only a handful of session seats are saved for walk-ups, so plan accordingly if you have sessions that you know you want to see. You can view all sessions including leadership and breakout in the Session Catalog and Attendee Guide, so be sure to use these resources when planning your schedule for the week. To reserve seats for the sessions that you want to view the most, log into your AWS re:Invent account, and add sessions to your schedule or download them to your calendar. Note: session seats are first come, first served, so arrive early.
## New to the cloud or AWS? Start with introductory sessions.
If you’re new to the cloud or AWS, don’t feel pressured to attend advanced sessions if you’re not ready. Consider starting with a mix of introductory sessions (200-level) and Chalk Talks to give you a foundation to build on.
## Visit the Expo for more learning opportunities.
The Expo at The Venetian is packed with learning opportunities. Stop by the AWS Village and dive deep into products, services, and solutions with AWS experts onsite to answer your questions. Then check out the AWS Marketplace booth for third-party applications that can streamline your path to success, as well as the AWS Partner Network Booth (APN) to learn about inspiring partner stories.
## Party with us at re:Play.
If you still have gas in the tank after a long week of learning, it’s party time! Our annual re:Play party will have two stages, one with DJs and one with live bands, performing all night. If you need a break from the tunes, relax in our central courtyard or go the reverse route and break a sweat playing dodgeball, archery tag, or Button Mash 4.0.
## Most importantly, have FUN!
Whether you’re connecting with old friends or making new ones, re:Invent is a unique opportunity to have everyone in one space, so take advantage of it. We encourage you to make the most out of your time in Las Vegas together!
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.