Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback Example README #131

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions examples/prerecorded/callback/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Callback Example

This example shows how to use the [Callback](https://developers.deepgram.com/docs/callback) functionality on the Prerecorded API.

> **_NOTE:_** To use this example, the `endpoint` component must run somewhere with a public-facing IP address. You cannot run this example locally behind your typical firewall.

## Configuration

This example consists of two components:
- `endpoint`: which is an example of what a callback endpoint would look like. Reminder: this requires running with a public-facing IP address
- `callback`: which is just a Deepgram client posts a PreRecorded transcription request using an audio file located at the following URL: [https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav](https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav)

The `callback` component requires the Deepgram API Key environment variable to be configured to run.

```sh
export DEEPGRAM_API_KEY=YOUR-APP-KEY-HERE
```

## Installation

Compile the `endpoint` application and upload the binary and sample SSL certificates to a system on the public-facing internet. This could be an EC2 instance on AWS, an instance on GCP, or etc. Then, run the `endpoint` binary.

On the `callback` project, modify the IP address constant in the code with the public-facing IP address of your EC2, GCP, etc instance.

```Go
hostport string = "<REPLACE WITH YOUR HOSTPORT - FORMAT: 127.0.0.1:3000>"
```

Then run the `callback` application. This can be done from your local laptop.