Custom user agent#277
Conversation
leandrodamascena
left a comment
There was a problem hiding this comment.
Hey @brnaba-aws! Overall this PR looks good, I just left some small comments that make sense you take a look.
| self.bedrock_agent_client = boto3.client('bedrock-agent-runtime') | ||
|
|
||
| user_agent.register_feature_to_client(self.bedrock_agent_client, feature="bedrock-flows-agent") |
There was a problem hiding this comment.
Not sure if removing region was intentional or not.
| ) | ||
| else: | ||
| self.client = boto3.client('bedrock-runtime') | ||
| region_name=options.region or os.environ.get('AWS_REGION')) |
There was a problem hiding this comment.
Now you are forcing the condition of having options.region or the AWS_REGION env. It is certainly my fault for not understanding the entire codebase, but if that is not the explicit intention, you are probably creating a regression.
| chat_history: list[ConversationMessage], | ||
| additional_params: Optional[dict[str, str]] = None) -> ConversationMessage: |
There was a problem hiding this comment.
I'm not sure which Python versions you support in the project, but if you support Python < 3.8 you will have a problem here. list and dict were introduced in the PEP585 and only supports Python 3.9+. Or you revert this or add future statement on top of this file.
Added custom user agent