Skip to content

Commit cd459ee

Browse files
Adding the link to download the utils and minor changes (#2003)
1 parent e754b10 commit cd459ee

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/howtos/integrations/amazon_bedrock.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ The steps covered in this notebook include:
2525
%pip install --upgrade -q boto3 opensearch-py botocore awscli retrying ragas langchain-aws
2626
```
2727

28+
This command will clone the repository containing helper files needed for this tutorial.
29+
30+
```
31+
! git clone https://huggingface.co/datasets/explodinggradients/booking_agent_utils
32+
```
33+
2834

2935
```python
3036
import os
@@ -34,8 +40,8 @@ The steps covered in this notebook include:
3440
import pprint
3541
import json
3642

37-
from knowledge_base import BedrockKnowledgeBase
38-
from agent import (
43+
from booking_agent_utils.knowledge_base import BedrockKnowledgeBase
44+
from booking_agent_utils.agent import (
3945
create_agent_role_and_policies,
4046
create_lambda_role,
4147
delete_agent_roles_and_policies,
@@ -126,7 +132,7 @@ The steps covered in this notebook include:
126132
s3_client.upload_file(file_to_upload, bucket_name, file)
127133

128134

129-
upload_directory("dataset", bucket_name)
135+
upload_directory("booking_agent_utils/dataset", bucket_name)
130136
```
131137

132138
Now we start the ingestion job
@@ -530,8 +536,7 @@ def invokeAgent(query, session_id, session_state=dict()):
530536
return agent_answer, traces
531537
# End event indicates that the request finished successfully
532538
elif "trace" in event:
533-
if enable_trace:
534-
traces.append(event["trace"])
539+
traces.append(event["trace"])
535540
else:
536541
raise Exception("unexpected event.", event)
537542
return agent_answer, traces
@@ -561,6 +566,7 @@ Ragas includes metrics suited to such evaluations, and we will explore some of t
561566

562567
```python
563568
from langchain_aws import ChatBedrock
569+
from ragas.llms import LangchainLLMWrapper
564570

565571
model_id = "us.amazon.nova-pro-v1:0" # Choose your desired model
566572
region_name = "us-east-1" # Choose your desired AWS region

0 commit comments

Comments
 (0)