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

Amazon Bedrock agent example #135

Merged
merged 9 commits into from May 15, 2024
Merged

Amazon Bedrock agent example #135

merged 9 commits into from May 15, 2024

Conversation

begimher
Copy link
Contributor

@begimher begimher commented May 9, 2024

Change Description

An example code to invoke Amazon Bedrock agent

Issue reference

N/A

Checklist

  • I have reviewed the contribution guidelines
  • [ NA] My code includes unit tests
  • All unit tests and lint checks pass locally
  • [NA] My PR contains documentation updates / additions if required

@begimher begimher requested a review from asofter as a code owner May 9, 2024 19:14
@asofter
Copy link
Collaborator

asofter commented May 9, 2024

Hey @begimher , thanks for the contribution. I noticed there is a duplicated code in the file, is this expected?

agentId=agent_id,
agentAliasId=agent_alias_id,
sessionId=session_id,
inputText=prompt,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be sanitized_prompt?

Comment on lines 8 to 11
region = ""
agent_id = ""
agent_alias_id = ""
session_id = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are constants they should be capitalized.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff is failing, have you installed pre-commit?

input_scanners = [Anonymize(vault), Toxicity(), TokenLimit(), PromptInjection()]
output_scanners = [Deanonymize(vault), NoRefusal(), Relevance(), Sensitive()]

prompt = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitlization?

@begimher
Copy link
Contributor Author

Thank you @CandiedCode @asofter !

@asofter
Copy link
Collaborator

asofter commented May 15, 2024

@begimher thank you for the contribution

@asofter asofter merged commit 10116b5 into protectai:main May 15, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants