Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mickleroy/bedrock-summarize-api-cdk
Summarize an input text using Amazon Bedrock (Titan Text Lite LLM) with Lambda, API Gateway and CDK for Typescript
https://github.com/mickleroy/bedrock-summarize-api-cdk
Last synced: 10 days ago
JSON representation
Summarize an input text using Amazon Bedrock (Titan Text Lite LLM) with Lambda, API Gateway and CDK for Typescript
- Host: GitHub
- URL: https://github.com/mickleroy/bedrock-summarize-api-cdk
- Owner: mickleroy
- Created: 2023-12-10T10:07:27.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-12-10T10:28:46.000Z (about 1 year ago)
- Last Synced: 2024-10-31T13:17:55.288Z (about 2 months ago)
- Language: TypeScript
- Size: 253 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Summarize API CDK Bedrock
This Typescript CDK project creates an API gateway and Lambda to summarize an input text using Amazon Bedrock.
The Amazon Titan Text Lite model must be enabled on the target account.
![Summarize API Design](/summarize-api-design.png)
**Request**
```
{
"inputText": "Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs. The passage is
attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a
type specimen book. It usually begins with"
}
```**Response**
```
{
"summary": "\nLorem ipsum is dummy text used in print, graphic, and web design. It is attributed to an unknown typesetter in the 15th century."
}
```## Useful commands
* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `cdk deploy` deploy this stack to your default AWS account/region
* `cdk diff` compare deployed stack with current state
* `cdk synth` emits the synthesized CloudFormation template