This presentation delves into the capabilities of Amazon Bedrock, an AWS service designed to empower the use of Generative AI. Multiple use cases and patterns - like summarization, information extraction, or question answering - will be presented during the session, along with the implementation methods and some demos.
3. xebia.com
Krzysztof Kąkol
Chief of Data Engineering and
Solutions Architect in Xebia Poland
AWS Community Builder & AWS Ambassador
https://www.linkedin.com/in/krzysztofkakol/
Other stuff:
Classical and jazz pianist
PhD in AI-driven sound processing
4. xebia.com
Access a range of leading FMs
through a single API
Extend the power of LLMs
with your data using retrieval
augmented generation (RAG)
Privately customize FMs with
your own data
Amazon Bedrock
Build agents that execute
complex business tasks by
dynamically invoking APIs
Get the best price
performance without
managing infrastructure
Enable data security and
compliance
7. xebia.com
Content generation
boto3_bedrock = boto3.client('bedrock-runtime')
response = boto3_bedrock.invoke_model(
body = '{"inputText": "Create short email from John Smith to SuperHotels requesting for special offers of hotels in San Francisco."}',
modelId = 'amazon.titan-tg1-large'
)
response_body = json.loads(response.get('body').read())
print(response_body.get('results')[0].get('outputText'))
Dear SuperHotels,
I hope this email finds you well. I am reaching out to inquire about any special offers or discounts available at your hotels in
San Francisco. As a frequent traveler, I value quality accommodations and great value. I would be delighted to learn about
any current promotions or packages that you have to offer.
Thank you for your attention to this matter.
I look forward to hearing back from you soon.
Best regards,
John Smith
19. xebia.com
Agents
client = boto3.client('bedrock-agent-runtime’)
response = client.invoke_agent(
agentAliasId='AJJCWRSIB2',
agentId='3LZHTSX13Q',
inputText='Can you show the offers list?',
sessionId='abc123’
)
completion = ""
for event in response.get("completion"):
chunk = event["chunk"]
completion = completion + chunk["bytes"].decode()
Here are the available destinations/offers:
- Egypt, Hurghada
- Italy, Venice
- Mexico, Cancun
20. xebia.com
• Amazon Bedrock gives access to plenty of different foundation models
• You can easily orchestrate potentially difficult tasks (like RAGs or agents), all the heavy lifting is done
by Bedrock
• Bedrock enables high-level API which simplifies implementing even sophisticated LLM-related scenarios
Summary