diff --git a/cdk/examples/generative_ai_rag/app.py b/cdk/examples/generative_ai_rag/app.py index 933072de..bdbeb58b 100644 --- a/cdk/examples/generative_ai_rag/app.py +++ b/cdk/examples/generative_ai_rag/app.py @@ -7,19 +7,19 @@ from lib.gen_ai_rag_stack import GenAIRagServiceStack from lib.gen_ai_rag_stack_props import GenAIRagServiceStackProps -from other_stack.bedrock_agent_stack import BedrockAgentStack +from other_stack.bedrock_stack import BedrockStack app = App() env_config = dotenv_values(".env") deploy_core = bool(util.strtobool(env_config["deploy_core_stack"])) -deploy_bedrock = bool(util.strtobool(env_config.pop("deploy_bedrock_agent"))) +deploy_bedrock = bool(util.strtobool(env_config.pop("deploy_bedrock"))) if deploy_bedrock: - BedrockAgentStack( + BedrockStack( app, - "BedrockAgentStack", + "BedrockStack", env=Environment( account=env_config["account_number"], region=env_config["aws_region"], diff --git a/cdk/examples/generative_ai_rag/sample.env b/cdk/examples/generative_ai_rag/sample.env index a8291d19..868e0c8f 100644 --- a/cdk/examples/generative_ai_rag/sample.env +++ b/cdk/examples/generative_ai_rag/sample.env @@ -1,5 +1,5 @@ deploy_core_stack="True" -deploy_bedrock_agent="True" +deploy_bedrock="True" # Essential Props account_number="" diff --git a/cdk/examples/generative_ai_rag/web-app/pages/foundation_model.py b/cdk/examples/generative_ai_rag/web-app/pages/foundation_model.py index 620efa11..40ef1f36 100644 --- a/cdk/examples/generative_ai_rag/web-app/pages/foundation_model.py +++ b/cdk/examples/generative_ai_rag/web-app/pages/foundation_model.py @@ -4,7 +4,7 @@ import json from botocore.exceptions import ClientError -st.caption("Using Calude 3 Haiku from Anthropic") +st.caption("Using Claude 3.5 Sonnet V1 from Anthropic") @st.cache_data def get_parameter(name): @@ -38,7 +38,7 @@ def get_parameter(name): client = boto3.client("bedrock-runtime") # Set the model ID, e.g., Claude 3 Haiku. - model_id = "anthropic.claude-3-haiku-20240307-v1:0" + model_id = "anthropic.claude-3-5-sonnet-20240620-v1:0" # Format the request payload using the model's native structure. native_request = { diff --git a/cdk/examples/generative_ai_rag/web-app/pages/rag_integration.py b/cdk/examples/generative_ai_rag/web-app/pages/rag_integration.py index 26bf44ed..d8e9232b 100644 --- a/cdk/examples/generative_ai_rag/web-app/pages/rag_integration.py +++ b/cdk/examples/generative_ai_rag/web-app/pages/rag_integration.py @@ -5,7 +5,7 @@ from typing import Dict, Any, List, Optional, Generator # Constants -MODEL_ID = 'anthropic.claude-3-5-sonnet-20241022-v2:0' +MODEL_ID = 'anthropic.claude-3-5-sonnet-20240620-v1:0' KNOWLEDGE_BASE_PARAM = "knowledge_base_id" MODEL_ARN = f"arn:aws:bedrock:us-west-2::foundation-model/{MODEL_ID}" INITIAL_MESSAGE = "Hello, Builders! Ask me any questions you have about AWS re:Invent sessions." diff --git a/cdk/examples/other_stack/bedrock_agent_stack.py b/cdk/examples/other_stack/bedrock_stack.py similarity index 96% rename from cdk/examples/other_stack/bedrock_agent_stack.py rename to cdk/examples/other_stack/bedrock_stack.py index 67b74946..5564aafc 100644 --- a/cdk/examples/other_stack/bedrock_agent_stack.py +++ b/cdk/examples/other_stack/bedrock_stack.py @@ -10,7 +10,7 @@ from constructs import Construct -class BedrockAgentStack(Stack): +class BedrockStack(Stack): def __init__( self, scope: Construct, @@ -55,7 +55,7 @@ def __init__( ) # create parameter store - self.agent_id_parameter = StringParameter( + self.kb_id_parameter = StringParameter( self, "BedrockKnowledgeBaseIdParameter", parameter_name="knowledge_base_id",