Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove hc region #237

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading