Skip to content

Commit

Permalink
Remove generate-temp-token from examples and docs (#74)
Browse files Browse the repository at this point in the history
Remove generate-temp-token option from examples since it's not mandatory any more
  • Loading branch information
anjz authored Oct 19, 2023
1 parent c8b7376 commit 1707708
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 79 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Improve upload speeds for files submitted with the batch client
- Retry requests in batch client on httpx.ProtocolError
- Remove generate-temp-token option from examples and examples in docs

## [1.11.0] - 2023-08-25

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ format:
test: unittest

manual-test:
speechmatics -v rt transcribe --url $(SM_URL) --ssl-mode regular --generate-temp-token --auth-token $(SM_AUTH_TOKEN) /tmp/example.wav
speechmatics -v rt transcribe --url $(SM_URL) --ssl-mode regular --auth-token $(SM_AUTH_TOKEN) /tmp/example.wav

.PHONY: unittest
unittest:
Expand Down
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,14 @@ A complete list of commands and flags can be found in the SDK docs at https://sp
You may also set the auth_token for each CLI command using the --auth-token flag.
The --auth-token flag overrides the value stored in the config file, e.g.
```bash
speechmatics transcribe --auth-token $AUTH_TOKEN --generate-temp-token example_audio.wav
speechmatics transcribe --auth-token $AUTH_TOKEN example_audio.wav
```

- Removing an auth_token from the toml file:
```bash
speechmatics config unset --auth-token
```

- Setting --generate-temp-token flag globally for CLI authentication:
```bash
speechmatics config set --generate-temp-token
```

- Unsetting generate temp token globally for CLI authentication:
```bash
speechmatics config unset --generate-temp-token
```

- Setting URLs for connecting to transcribers. These values can be used in places of the --url flag:
```bash
speechmatics config set --rt-url wss://eu2.rt.speechmatics.com/v2 --batch-url https://asr.api.speechmatics.com/v2
Expand All @@ -148,14 +138,14 @@ A complete list of commands and flags can be found in the SDK docs at https://sp
- Starting a real-time session for self-service SaaS customers using a .wav file as the input audio:

```bash
speechmatics transcribe --lang en --generate-temp-token example_audio.wav
speechmatics transcribe --lang en example_audio.wav
```

- Real-time transcription of online stream (needs ffmpeg installed):
```bash
ffmpeg -v 0 -i https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd \
-f s16le -ar 44100 -ac 1 -acodec pcm_s16le - | \
speechmatics transcribe --raw pcm_s16le --sample-rate 44100 --generate-temp-token -
speechmatics transcribe --raw pcm_s16le --sample-rate 44100 -
- Starting a real-time session for enterprise SaaS customers using a .wav file as the input audio:
Expand Down
2 changes: 1 addition & 1 deletion docs/_modules/speechmatics/models.html
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ <h1>Source code for speechmatics.models</h1><div class="highlight"><pre>

<span class="n">generate_temp_token</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="nb">bool</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Automatically generate a temporary token for authentication.</span>
<span class="sd"> Non-enterprise customers must set this to True. Enterprise customers should set this to False.&quot;&quot;&quot;</span>
<span class="sd"> Enterprise customers should set this to False.&quot;&quot;&quot;</span>

<span class="k">def</span> <span class="nf">set_missing_values_from_config</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mode</span><span class="p">:</span> <span class="n">UsageMode</span><span class="p">):</span>
<span class="n">stored_config</span> <span class="o">=</span> <span class="n">read_config_from_home</span><span class="p">()</span>
Expand Down
1 change: 0 additions & 1 deletion docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ The example below illustrates a waveform audio file being opened and transcribed
speechmatics.models.ConnectionSettings(
url=CONNECTION_URL,
auth_token=AUTH_TOKEN,
generate_temp_token=True, # Enterprise customers don't need to provide this parameter
)
)

Expand Down
1 change: 0 additions & 1 deletion docs/_static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #8f5902; font-style: italic } /* Comment.Special */
.highlight .gd { color: #a40000 } /* Generic.Deleted */
.highlight .ge { color: #000000; font-style: italic } /* Generic.Emph */
.highlight .ges { color: #000000 } /* Generic.EmphStrong */
.highlight .gr { color: #ef2929 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
Expand Down
82 changes: 48 additions & 34 deletions docs/cli_parser.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ <h2>Example library usage<a class="headerlink" href="#example-library-usage" tit
<span class="n">speechmatics</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ConnectionSettings</span><span class="p">(</span>
<span class="n">url</span><span class="o">=</span><span class="n">CONNECTION_URL</span><span class="p">,</span>
<span class="n">auth_token</span><span class="o">=</span><span class="n">AUTH_TOKEN</span><span class="p">,</span>
<span class="n">generate_temp_token</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="c1"># Enterprise customers don&#39;t need to provide this parameter</span>
<span class="p">)</span>
<span class="p">)</span>

Expand Down
Loading

0 comments on commit 1707708

Please sign in to comment.