Skip to content

Commit

Permalink
Improve CI, docs and listen endpoint.
Browse files Browse the repository at this point in the history
* Add `ci.yml` for CI.
* Add `smart_format`, `punctuate`, `paragraphs`, `diarize` options to listen endpoint.
* Improve docs.
  • Loading branch information
onurozgurozkan committed Jan 4, 2024
1 parent 2ad0913 commit a843311
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 9 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Elixir CI

on:
pull_request:
push:
branches:
- main
- 'v*'

jobs:
mix_test:
name: mix test (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp}})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- elixir: 1.14.x
otp: 25
os: ubuntu-22.04
- elixir: 1.15.x
otp: 25
os: ubuntu-22.04
- elixir: 1.16.x
otp: 26
os: ubuntu-latest
warnings_as_errors: true
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Install Dependencies
run: |
mix local.hex --force
mix local.rebar --force
mix deps.get --only test
- name: Cache build artifacts
uses: actions/cache@v3
with:
path: |
~/.hex
~/.mix
_build
key: ${{ matrix.otp }}-${{ matrix.elixir }}-build
- run: mix compile --warnings-as-errors
- run: mix test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ hipcall_deepgram-*.tar
# Temporary files, for example, from tests.
/tmp/
.env
.NOTES.md
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

## v0.2.0 (2024-01-05)

* Add `ci.yml` for CI.
* Add `smart_format`, `punctuate`, `paragraphs`, `diarize` options to listen endpoint.
* Improve docs.

## v0.1.0 (2024-01-04)

* First release.
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 [Hipcall LTD](https://www.hipcall.com/en-gb/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Unofficial Deepgram API Wrapper written in Elixir.

## Examples

iex> audio_url = "https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav"
iex> option = [model: "base", language: "tr"]
iex> HipcallDeepgram.listen(audio_url, option)
```elixir
iex> audio_url = "https://static.deepgram.com/examples/Bueller-Life-moves-pretty-fast.wav"
iex> option = [model: "base", language: "tr", punctuate: true, diarize: true, paragraphs: true, smart_format: true]
iex> HipcallDeepgram.listen(audio_url, option)
```

## Installation

Expand All @@ -27,7 +29,7 @@ be found at <https://hexdocs.pm/hipcall_deepgram>.

## Hipcall

All Hipcall libraries:
All [Hipcall](https://www.hipcall.com/en-gb/) libraries:

- [HipcallDisposableEmail](https://github.com/hipcall/hipcall_disposable_email) - Simple library checking the email's domain is disposable or not.
- [HipcallDeepgram](https://github.com/hipcall/hipcall_deepgram) - Unofficial Deepgram API Wrapper written in Elixir.
36 changes: 34 additions & 2 deletions lib/hipcall_deepgram.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ defmodule HipcallDeepgram do
},
doc: """
AI model used to process submitted audio. Default: nova-2-general.
For more information https://developers.deepgram.com/docs/model
Learn more https://developers.deepgram.com/docs/model
""",
default: "nova-2-general"
],
Expand Down Expand Up @@ -86,9 +86,41 @@ defmodule HipcallDeepgram do
},
doc: """
The BCP-47 language tag that hints at the primary spoken language. Default: en.
For more information https://developers.deepgram.com/docs/language
Learn more https://developers.deepgram.com/docs/language
""",
default: "en"
],
punctuate: [
type: :boolean,
doc: """
Add punctuation and capitalization to the transcript. Default: false.
Learn more https://developers.deepgram.com/docs/punctuation
""",
default: false
],
diarize: [
type: :boolean,
doc: """
Recognize speaker changes. Each word in the transcript will be assigned a speaker number starting at 0. Default: false.
Learn more https://developers.deepgram.com/docs/diarization
""",
default: false
],
paragraphs: [
type: :boolean,
doc: """
Split audio into paragraphs. Default: false.
Learn more https://developers.deepgram.com/docs/paragraphs
""",
default: false
],
smart_format: [
type: :boolean,
doc: """
Apply formatting to transcript output. When set to true, additional formatting will be applied to transcripts to improve readability. Default: false.
Learn more https://developers.deepgram.com/docs/smart-format
""",
default: false
]
]

Expand Down
20 changes: 17 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
defmodule HipcallDeepgram.MixProject do
use Mix.Project

@source_url "https://github.com/hipcall/hipcall_deepgram"
@version "0.2.0"

def project do
[
app: :hipcall_deepgram,
name: "HipcallDeepgram",
description: "Unofficial Deepgram API Wrapper written in Elixir.",
version: "0.1.0",
elixir: "~> 1.15",
version: @version,
elixir: "~> 1.14",
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package()
Expand Down Expand Up @@ -37,8 +40,19 @@ defmodule HipcallDeepgram.MixProject do
licenses: ["MIT"],
links: %{
"Website" => "https://www.hipcall.com/en-gb/",
"GitHub" => "https://github.com/hipcall/hipcall_deepgram"
"GitHub" => @source_url
}
]
end

def docs do
[
main: "readme",
name: "HipcallDeepgram",
canonical: "https://hex.pm/packages/hipcall_disposable_email",
source_ref: "v#{@version}",
source_url: @source_url,
extras: ["README.md", "CHANGELOG.md", "LICENSE.md"]
]
end
end

0 comments on commit a843311

Please sign in to comment.