File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
python/example_code/bedrock-runtime/models/anthropic_claude Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 12
12
read_timeout = 1000 ,
13
13
)
14
14
# Create a Bedrock Runtime client in the AWS Region you want to use.
15
- session = boto3 .session .Session (region_name = 'us-west-2 ' )
15
+ session = boto3 .session .Session (region_name = 'us-east-1 ' )
16
16
bedrock_runtime = session .client (service_name = 'bedrock-runtime' ,
17
17
config = config )
18
+ pdf_path = input ("Enter the path to the PDF file: " )
18
19
prompt = """
19
20
Please analyze this PDF document and provide the following information:
20
21
29
30
30
31
# Set the model ID
31
32
32
- SONNET_V2_MODEL_ID = "anthropic.claude-3-5-sonnet-20241022-v2:0"
33
-
33
+ # SONNET_V2_MODEL_ID = "anthropic.claude-3-5-sonnet-20241022-v2:0"
34
+ SONNET_V2_MODEL_ID = "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
34
35
def optimize_reel_prompt (user_prompt ,ref_image ):
35
36
# open PDF
36
37
with open (ref_image , "rb" ) as f :
@@ -74,5 +75,5 @@ def optimize_reel_prompt(user_prompt,ref_image):
74
75
return text
75
76
76
77
if __name__ == "__main__" :
77
- txt = optimize_reel_prompt (prompt ,"/Path/To/your.pdf" )
78
+ txt = optimize_reel_prompt (prompt ,pdf_path )
78
79
print (txt )
You can’t perform that action at this time.
0 commit comments