paraphraser-api

module
v0.0.0-...-bae6603 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: MIT

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

    • sample response:
      {
          "providers": [
              "chatgpt",
              "gemini"
          ]
      }
      
  • GET /tones

    • sample response:
      {
          "tones": [
              "formal",
              "amicable",
              "fun",
              "casual",
              "sympathetic",
              "persuasive"
          ]
      }
      

Usage

configure
$ 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:
format all .go files in project (using go fmt)
$ 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

Path Synopsis
functions
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL