Skip to content

Commit

Permalink
feat(documentation): Updated summary readme file. (#57)
Browse files Browse the repository at this point in the history
* first set of fixes following testing

* fixes

* add fix in embeddings job

* move all lambda functions into dedicated folders for consistency

* fix import

* fix env var name

* updated step function choice state

* update summary construct readme file

---------

Co-authored-by: Alain Krok <[email protected]>
Co-authored-by: Dinesh Sajwan <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent e3e316e commit 1fd1276
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/patterns/gen-ai/aws-summarization-appsync-stepfn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ AWS Lambda functions provisioned in this construct use [Powertools for AWS Lambd

Here is a minimal deployable pattern definition:

Typescript
Create a CDK typescript project and then update the stack with below configuration.

``` typescript
import { Construct } from 'constructs';
import { Stack, StackProps } from 'aws-cdk-lib';
Expand All @@ -72,14 +73,31 @@ summarizationTestConstruct = new SummarizationAppsyncStepfn(

```

For optional props like redis cluster set cfnCacheClusterProps.

```
const cfnCacheClusterProps: elasticache.CfnCacheClusterProps = {
cacheNodeType: 'cache.r6g.xlarge',
engine: 'redis',
numCacheNodes: 1,
};
```
If file transformation is required set isFileTransformationRequired to 'True'

```
isFileTransformationRequired: 'True'
```

For existing resource like Amazon VPC , Amazon S3 buckets use props like existingVpc, existingInputAssetsBucket and existingTransformedAssetsBucket.

The code below provides an example of a mutation call and associated subscription to trigger the summarization workflow and get response notifications:

Mutation call to trigger the question:

```
mutation MyMutation {
generateSummary(summaryInput:{files:[{name: "document1.txt", status: ""}], summary_job_id:"81"}) {
file_name
name
status
summary
summary_job_id
Expand All @@ -96,8 +114,8 @@ If pdf format is selected, the file needs to be in the input S3 bucket and the c
Subscription call to get notifications about the summarization process:
```
subscription MySubscription {
updateSummaryJobStatus(file_name: "document1.txt", summary_job_id: "81") {
file_name
updateSummaryJobStatus(name: "document1.txt", summary_job_id: "81") {
name
status
summary
summary_job_id
Expand All @@ -108,10 +126,10 @@ subscription MySubscription {
Where:
- summary_job_id: id which can be used to filter subscriptions on client side
- status: status update of the summarization process for the file(s) specified
- file_name: name of the file stored in the input S3 bucket, same name + extension as passed to the previous mutation call.
- name: name of the file stored in the input S3 bucket, same name + extension as passed to the previous mutation call.
- summary: summary returned by the Large Language Model for the document specified, as a base64 encoded string

```If multiple files are requested for summarization , then the client should filter response based on summary_job_id and file_name for each file. ```
```If multiple files are requested for summarization , then the client should filter response based on summary_job_id and name for each file. ```

## Initializer

Expand Down

0 comments on commit 1fd1276

Please sign in to comment.