module
Version:
v0.0.0-...-bae6603
Opens a new window with list of versions in this module.
Published: Sep 12, 2024
License: MIT
Opens a new window with license information.
README
¶
paraphraser-api
Backend for paraphrasing tool leveraging LLM APIs.
Implemented as an AWS Lambda application and utilizes Serverless Framework for deployment.
Prerequisites
Endpoints
-
POST /paraphrase
- available providers: "chatgpt", "gemini"
- available tones: "formal", "amicable", "fun", "casual", "sympathetic", "persuasive"
- sample request:
{
"provider": "chatgpt",
"tone": "formal",
"text": "I'm hungry. What's for dinner?"
}
- sample response:
{
"result": "I am currently experiencing hunger. May I inquire about the menu for this evening's meal?"
}
-
GET /providers
-
GET /tones
- sample response:
{
"tones": [
"formal",
"amicable",
"fun",
"casual",
"sympathetic",
"persuasive"
]
}
Usage
$ make .env
- see generated
.env
file for configuration
tidy dependencies
$ make deps
run unit tests
$ make test
run all tests (unit + integration tests)
$ make testIncludeInt
build serverless functions
$ make build
- this generates
bin
directory to be used in deployment
deploy serverless application
$ make deploy
Helpers during development:
$ make fmt
generate test mocks (to be used with stretchr/testify) for all interfaces in project
$ make mocks
- can be configured in
.mockery.yaml
Directories
¶
functions
|
|
|
|
|
|
|
|
|
|
internal
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.