Kmukasa / LernaLang

A language learning mobile application built with React Native, Firebase and ChatGPT
7 stars 0 forks source link

Add NodeJS #8

Open Kmukasa opened 1 year ago

Kmukasa commented 1 year ago

Add NodeJs Server

GET getTranslation (textToTranslate: string) -> translation: string - wrapper for google cloud
POST generateSpeechToText (fileUri: string) -> transcription: string - wrapper for whisper
GET getMessage (messages: array ) -> messageObject - wrapper for openAI

I've been going back and forth on whether to add a server but I'm hoping that it'll solve the following problems. I've been having a hard time translating text using the GCP traslate api so I'm hoping this will make it easier to do so by using the@google-cloud/translate npm package. In addition, React Native has a couple of limitations getting the appropriate audio file object to pass to the whisper api. In addition, it might be safer and easier to handle error and retry logic with a server.