Skip to content

Commit

Permalink
remove hc region (#237)
Browse files Browse the repository at this point in the history
* remove hc region

* fix the lint
  • Loading branch information
joozero authored Oct 7, 2024
1 parent fa49c09 commit f299ac7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cdk/examples/generative_ai_rag/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ boto3
aws-cdk.aws-lambda-python-alpha==2.156.0a0
cdklabs.generative-ai-cdk-constructs>=0.1.271
constructs>=10.0.0,<11.0.0
setuptools>=75.1.0
setuptools>=75.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_parameter(name):
# Use the native inference API to send a text message to Anthropic Claude.

# Create a Bedrock Runtime client in the AWS Region of your choice.
client = boto3.client("bedrock-runtime", region_name="us-east-1")
client = boto3.client("bedrock-runtime")

# Set the model ID, e.g., Claude 3 Haiku.
model_id = "anthropic.claude-3-haiku-20240307-v1:0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def get_parameter(name):
msg = chunk['bytes'].decode('utf-8')
st.session_state.messages.append(
{
"role": "assistant",
"role": "assistant",
"content": msg
}
)
st.chat_message("assistant").write(msg)
except Exception as e:
print(f"Error: {e}")
st.error("An error occurred while processing the agent's response. Please check the logs for details.")

msg = "I encountered an issue while processing the response. Could you please rephrase your prompt or try a different question?"
st.session_state.messages.append({"role": "assistant", "content": msg})
st.chat_message("assistant").write(msg)

0 comments on commit f299ac7

Please sign in to comment.