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

Add Second Starter App - Virtual Scribe #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# user defined
config.json

# Binaries for programs and plugins
.DS_Store
*.exe
*.exe~
*.dll
*.o
*.a
*.so
*.dylib

# Folders
_obj
_test
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# cgo stuff
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
.idea/
*.iml
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Please check out the starters contained in this repository, for examples of how to build Deepgram into your [Language] applications.

- [Web App](./Starter-01/README.md)
- [Websockets](./Starter-01/README.md)
- [Command-line](./Starter-01/README.md)
Starters:

- [Transcription Via File Upload](./Starter-01/README.md)
- [Virtual Scribe](./Starter-02/README.md)

## What is Deepgram?

Expand Down
2 changes: 1 addition & 1 deletion Starter-01/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/deepgram-go-starters
module github.com/deepgram-go-starters/Starter-01

go 1.20

Expand Down
44 changes: 44 additions & 0 deletions Starter-02/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Virtual Scribe Assistant

The Virtual Scribe Assistant is an assistant that acts as a scribe that will take dictation of your notes, then, on command, will email you the current note. This starter app leverages Deepgram's Live Streaming API for real-time transcription.

## Prerequisites

This example uses a [microphone package](https://github.com/deepgram/deepgram-go-sdk/tree/main/pkg/audio/microphone) contained within the Go SDK repository. That package uses the [PortAudio library](http://www.portaudio.com/), a cross-platform open source audio library. If you are on Linux, you can install this library using whatever package manager (yum, apt) on your operating system. If you are on macOS, you can install this library using [brew](https://brew.sh/).

## Running the Demo

To run this demo, you need to configure the config.json file with SMTP settings for your internet provider:

```
cd ./cmd/bin/dictation
# setup the configuration
cp config.json-ORG config.json
vi config.json
# open config.json and fill in the settings contained within
# set the EMAIL_SMTP_PASSWORD environment variable in your profile (for bash: ~/.bash_profile), then run:
go run main.go
# OR supply the environment variable on the command line
# (this should only be used for evaluation purposes)
# then run:
EMAIL_SMTP_PASSWORD="YOUR_PASSWORD" go run main.go
```

## Example Details

This starter app uses the [Open Virtual Assistant](https://github.com/dvonthenen/open-virtual-assistant) project, a framework for helping you create virtual digital assistants. The advantage is that a lot of the heavy lifting is taken care of (transcription), and you just need to implement your assistant logic.

## Getting Help

We love to hear from you, so if you have questions or comments or find a bug in the project, let us know! You can either:

- [Open an issue](https://github.com/deepgram/[reponame]/issues/new) on this repository
- Ask a question, share the cool things you're working on, or see what else we have going on in our [Community Forum](https://github.com/orgs/deepgram/discussions/)
- Tweet at us! We're [@DeepgramAI on Twitter](https://twitter.com/DeepgramAI)

## Further Reading

Check out the Developer Documentation at [https://developers.deepgram.com/](https://developers.deepgram.com/)
60 changes: 60 additions & 0 deletions Starter-02/cmd/bin/dictation/cmd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2023 Deepgram Virtual Assistant contributors. All Rights Reserved.
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
// SPDX-License-Identifier: MIT

package main

import (
"bufio"
"fmt"
"os"

assistant "github.com/dvonthenen/open-virtual-assistant/pkg/assistant"
interfaces "github.com/dvonthenen/open-virtual-assistant/pkg/assistant/interfaces"
initlib "github.com/dvonthenen/open-virtual-assistant/pkg/init"

dictation "github.com/deepgram-starters/deepgram-go-starters/Starter-02/pkg/dictation"
)

func main() {
/*
Init
*/
initlib.Init(initlib.AssistantInit{
LogLevel: initlib.LogLevelStandard, // LogLevelStandard / LogLevelFull / LogLevelTrace / LogLevelVerbose
})

/*
Assistant
*/
myAssistant, err := dictation.New()
if err != nil {
fmt.Printf("dictation.New failed. Err: %v\n", err)
os.Exit(1)
}

var assistImpl interfaces.AssistantImpl
assistImpl = myAssistant

assist, err := assistant.New(&assistImpl, &assistant.AssistantOptions{})
if err != nil {
fmt.Printf("assistant.New failed. Err: %v\n", err)
os.Exit(1)
}

fmt.Printf("\nStarting the Dictation Assistant...\n\n")

// blocking call
err = assist.Start()
if err != nil {
fmt.Printf("assist.Start failed. Err: %v\n", err)
os.Exit(1)
}

fmt.Print("Press ENTER to exit!\n\n")
input := bufio.NewScanner(os.Stdin)
input.Scan()

// clean up
assist.Stop()
}
11 changes: 11 additions & 0 deletions Starter-02/cmd/bin/dictation/config.json-ORG
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"template": "template.html",
"skipServerAuth": "true",
"emailTo": "REPLACE-WITH-YOUR-EMAIL",
"emailFrom": "REPLACE-WITH-YOUR-EMAIL",
"emailSubject": "REPLACE-WITH-YOUR-SUBJECT",
"emailSmtpAddr": "REPLACE-WITH-YOUR-SMTP-SERVER",
"emailSmtpPort": "REPLACE-WITH-YOUR-SMTP-PORT",
"emailSmtpUsername": "REPLACE-WITH-YOUR-SMTP-USERNAME",
"emailSmtpPassword": "DELETE-THIS-KEY-AND-USE-ENVIRONMENT-VARIABLE-INSTEAD"
}
8 changes: 8 additions & 0 deletions Starter-02/cmd/bin/dictation/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Transcription:
-------------------
{{range $val := .Transcription}}
{{$val}}
{{end}}

From: {{.From}}
To: {{.To}}
54 changes: 54 additions & 0 deletions Starter-02/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
module github.com/deepgram-starters/deepgram-go-starters/Starter-02

go 1.18

require (
github.com/dvonthenen/open-virtual-assistant v0.2.0
gopkg.in/mail.v2 v2.3.1
)

require (
cloud.google.com/go v0.110.2 // indirect
cloud.google.com/go/compute v1.19.3 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/longrunning v0.5.0 // indirect
cloud.google.com/go/speech v1.19.0 // indirect
cloud.google.com/go/texttospeech v1.6.0 // indirect
github.com/deepgram/deepgram-go-sdk v1.0.0 // indirect
github.com/dvonthenen/websocket v1.5.1-dyv.2 // indirect
github.com/faiface/beep v1.1.0 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5 // indirect
github.com/hajimehoshi/go-mp3 v0.3.3 // indirect
github.com/hajimehoshi/oto v0.7.1 // indirect
github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/pkg/errors v0.9.1 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp/shiny v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/image v0.0.0-20190802002840-cff245a6509b // indirect
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
k8s.io/klog/v2 v2.110.1 // indirect
)
Loading