Automatyzacja złożonych chatbotów w Amazon Bedrock
KrzysztofKkol1
54 views
26 slides
Oct 08, 2024
Slide 1 of 26
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
26
About This Presentation
Amazon Bedrock to usługa w AWS, która ułatwia i automatyzuje tworzenie złożonych chatbotów, wykorzystujących duże modele językowe. Oprócz wiedzy, którą model posiada, można w prosty sposób wyposażyć bota w naszą własną, prywatną wiedzę oraz poprosić go o wywołanie zewnętrznyc...
Amazon Bedrock to usługa w AWS, która ułatwia i automatyzuje tworzenie złożonych chatbotów, wykorzystujących duże modele językowe. Oprócz wiedzy, którą model posiada, można w prosty sposób wyposażyć bota w naszą własną, prywatną wiedzę oraz poprosić go o wywołanie zewnętrznych endpointów, w razie gdyby ta wiedza nie wystarczała. W trakcie prelekcji wyjaśnię i pokażę jak łatwe jest przygotowywanie takich rozwiązań w Amazon Bedrock.
Size: 24.78 MB
Language: en
Added: Oct 08, 2024
Slides: 26 pages
Slide Content
Automatyzacja złożonych chatbotów w Amazon Bedrock Krzysztof Kąkol Chief of Data Engineering @ Xebia Poland
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
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
Layer 1 Content generation
Content generation
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
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
Many users -> your costs might explode Prompt injection – validate prompts or validate responses Good system prompt is critical – write guardrails and test them Chunk-level permissions are extremely difficult to handle Chunking is the most important work to do Sometimes custom orchestration is the only choice Be aware !
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