Skip to content

Add new workflow #384

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

Merged
merged 4 commits into from
Jan 15, 2025
Merged

Add new workflow #384

merged 4 commits into from
Jan 15, 2025

Conversation

carita
Copy link
Contributor

@carita carita commented Nov 18, 2024

Issue #, if available:

Description of changes:
Message categorizing no-code example with AWS Step Functions, Amazon Bedrock and Amazon Simple Queue Service

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

## Requirements

- Create an AWS account if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
- AWS CLI installed and configured
Copy link
Contributor

Choose a reason for hiding this comment

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

DefaultQueue:
Type: AWS::SQS::Queue
Properties:
MessageRetentionPeriod: 345600
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest reducing this to a day or less. Or call it out in the README

carita and others added 2 commits December 17, 2024 14:49
Update information texts

Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com>
Copy link
Contributor

@bfreiberg bfreiberg left a comment

Choose a reason for hiding this comment

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

Looks good, some more minor comments. As a side note, it would be good to move the state machine definition to JSONata (can be done after publishing)

@@ -0,0 +1,92 @@
# Message categorizing with Amazon Bedrock and Amazon SQS
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Message categorizing with Amazon Bedrock and Amazon SQS
# Message categorization with Amazon Bedrock and Amazon SQS

@@ -0,0 +1,92 @@
# Message categorizing with Amazon Bedrock and Amazon SQS

This workflow demonstrates how you can use Amazon Bedrock to categorize messages and then send them to an Amazon SQS queue for further processing. The AWS Serverless Application Model (SAM) template deploys the AWS Step Functions state machine which defines the workflow.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This workflow demonstrates how you can use Amazon Bedrock to categorize messages and then send them to an Amazon SQS queue for further processing. The AWS Serverless Application Model (SAM) template deploys the AWS Step Functions state machine which defines the workflow.
This workflow demonstrates how you can use Amazon Bedrock to categorize messages and then send them to an Amazon SQS queue for further processing. The AWS Serverless Application Model (SAM) template deploys an AWS Step Functions state machine which defines the workflow.

- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) installed and configured
- [Git Installed](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) (AWS SAM) installed
- NOTE! This example uses Amazon Bedrock foundation model anthropic.claude-3-haiku-20240307-v1:0. To change the model used in the example, you will need to adjust the BedrockAccess policy attached to the Step Functions. Also note that different models take inputs in different formats. To use another model, you will also need to adjust the input parameters sent to the model in the State Machine invokeModel step.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- NOTE! This example uses Amazon Bedrock foundation model anthropic.claude-3-haiku-20240307-v1:0. To change the model used in the example, you will need to adjust the BedrockAccess policy attached to the Step Functions. Also note that different models take inputs in different formats. To use another model, you will also need to adjust the input parameters sent to the model in the State Machine invokeModel step.
- NOTE! This example uses Amazon Bedrock foundation model anthropic.claude-3-haiku-20240307-v1:0. To change the model used in the example, you will need to adjust the BedrockAccess policy attached to the Step Functions state machine. Also note that different models take inputs in different formats. To use another model, you will also need to adjust the input parameters sent to the model in the `invokeModel` step.

Copy link
Contributor

Choose a reason for hiding this comment

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

Step Functions is the service, state machine the resource

}
```

after the execution you will see the same message in your Billing SQS Queue.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
after the execution you will see the same message in your Billing SQS Queue.
after the execution you will see the same message in your Billing SQS queue.

},
{
"type": "text",
"text": "You are a text categorizing program. Given the a list of categories [\"COMPLAINT\",\"BILLING\"], categorize the text into one of these classes (\"Category\"). Give the answer with exactly one class and no additional text. If you cannot categorize the text, please use [\"UNKNOWN\"] category. Do not try to make up a category."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"text": "You are a text categorizing program. Given the a list of categories [\"COMPLAINT\",\"BILLING\"], categorize the text into one of these classes (\"Category\"). Give the answer with exactly one class and no additional text. If you cannot categorize the text, please use [\"UNKNOWN\"] category. Do not try to make up a category."
"text": "You are a text categorizing program. Given the list of categories [\"COMPLAINT\",\"BILLING\"], categorize the text into one of these classes (\"Category\"). Give the answer with exactly one class and no additional text. If you cannot categorize the text, please use [\"UNKNOWN\"] category. Do not try to make up a category."

@bfreiberg
Copy link
Contributor

Looks good, thanks for your contribution. Your workflow will be merged soon

@julianwood julianwood merged commit 28759b7 into aws-samples:main Jan 15, 2025
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.

3 participants