Skip to content

Commit

Permalink
Update model and remove the word "agent" (#244)
Browse files Browse the repository at this point in the history
* Update model id

* Remove the word agent
  • Loading branch information
dorukozturk authored Oct 23, 2024
1 parent 6e78950 commit d1273a8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions cdk/examples/generative_ai_rag/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion cdk/examples/generative_ai_rag/sample.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
deploy_core_stack="True"
deploy_bedrock_agent="True"
deploy_bedrock="True"

# Essential Props
account_number="<ACCOUNT_NUMBER>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from constructs import Construct

class BedrockAgentStack(Stack):
class BedrockStack(Stack):
def __init__(
self,
scope: Construct,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit d1273a8

Please sign in to comment.