Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Latest commit

 

History

History
 
 

deepgramLanguageDetection

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

🧹Deepgram Language Detection

A Cloud Function for Language detection using Deepgram

Example input:

{
  "fileUrl": "https://static.deepgram.com/examples/interview_speech-analytics.wav"
}

Example output:

{
  "deepgramData": {},
  "success": true
}

Example error output:

{
  "success": false,
  "message": "Error"
}

📝 Environment Variables

DEEPGRAM_API_KEY - Your Deepgram secret API key. Details are under link: Deepgram_getting_started

🚀 Deployment

  1. Clone this repository, and enter this function folder:
git clone https://github.com/open-runtimes/examples.git && cd examples
cd java/deepgramLanguageDetection
  1. Build the code:
docker run -e INTERNAL_RUNTIME_ENTRYPOINT=Index.java --rm --interactive --tty --volume $PWD:/usr/code openruntimes/java:v2-11.0 sh /usr/local/src/build.sh
  1. Spin-up open-runtime:
docker run -p 3000:3000 -e INTERNAL_RUNTIME_KEY=secret-key --rm --interactive --tty --volume $PWD/code.tar.gz:/tmp/code.tar.gz:ro openruntimes/java:v2-11.0 sh /usr/local/src/start.sh

Your function is now listening on port 3000, and you can execute it by sending POST request with appropriate authorization headers. To learn more about runtime, you can visit Java runtime README.

  1. Run the curl function to send request.
curl --location --request POST 'http://localhost:3000/' \
--header 'X-Internal-Challenge: secret-key' \
--header 'Content-Type: application/json' \
--data-raw '{"payload": "{\"fileUrl\": \"https://static.deepgram.com/examples/interview_speech-analytics.wav\"}", 
"variables": {"DEEPGRAM_SECRET_KEY":"<YOUR_API_KEY>"}}
'

📝 Notes

  • This function is designed for use with Appwrite Cloud Functions. You can learn more about it in Appwrite docs.