Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 6c797fc

Browse files
authored
Sync from internal repo (2024-06-17) (#23)
* docs(sdk/go): sync with openapi spec (#5069) GitOrigin-RevId: bd4311c190949828f7929a119b1a6a7ba874c3e9 * feat(sdk/go): improve support for LeMUR response data (#5255) GitOrigin-RevId: 363d2cdfc1bcaa3bbcdab292f640a0e18f6a2a3e * fix(sdk/go): update real-time example (#5253) GitOrigin-RevId: d0ae6d5dd145435644cc4cf5f3e5f7d18ab16249 * Fix linter issues
1 parent 32ea176 commit 6c797fc

File tree

8 files changed

+163
-45
lines changed

8 files changed

+163
-45
lines changed

assemblyai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
const (
15-
version = "1.5.1"
15+
version = "1.6.0"
1616
defaultBaseURLScheme = "https"
1717
defaultBaseURLHost = "api.assemblyai.com"
1818
)

examples/realtime/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/AssemblyAI/DeepLearning/assemblyai/developer_tools/go/examples
33
go 1.21
44

55
require (
6-
github.com/AssemblyAI/assemblyai-go-sdk v1.4.1
6+
github.com/AssemblyAI/assemblyai-go-sdk v1.5.1
77
github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5
88
)
99

examples/realtime/go.sum

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
github.com/AssemblyAI/assemblyai-go-sdk v1.5.1 h1:FQRncG9p+GCjtmG7iiRvHAYpjdmo6nBzhdtKzTWv1UM=
2+
github.com/AssemblyAI/assemblyai-go-sdk v1.5.1/go.mod h1:ytTvsjAVL+nXZnzBfDagQ/LxDQaKL9W/eTiCo3ZuPJA=
3+
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
4+
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
5+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
7+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8+
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
9+
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
10+
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
11+
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
12+
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
13+
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
14+
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
15+
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
16+
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
17+
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
18+
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
19+
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
20+
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
21+
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
22+
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
23+
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
24+
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
25+
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
26+
github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls=
27+
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
28+
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
29+
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
30+
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
31+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
32+
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
33+
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
34+
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
35+
github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5 h1:5AlozfqaVjGYGhms2OsdUyfdJME76E6rx5MdGpjzZpc=
36+
github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5/go.mod h1:WY8R6YKlI2ZI3UyzFk7P6yGSuS+hFwNtEzrexRyD7Es=
37+
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
38+
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
39+
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
40+
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
41+
github.com/klauspost/compress v1.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8=
42+
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
43+
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
44+
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
45+
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
46+
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
47+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
48+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
49+
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
50+
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
51+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
52+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
53+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
54+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
55+
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
56+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
57+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
58+
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
59+
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
60+
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
61+
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
62+
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
63+
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
64+
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
65+
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
66+
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
67+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
68+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
69+
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
70+
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
71+
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
72+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
73+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
74+
nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
75+
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=

examples/realtime/realtime.go

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,6 @@ import (
1212
"github.com/gordonklaus/portaudio"
1313
)
1414

15-
type realtimeHandler struct{}
16-
17-
func (h *realtimeHandler) SessionBegins(event assemblyai.SessionBegins) {
18-
slog.Info("session begins")
19-
}
20-
21-
func (h *realtimeHandler) SessionTerminated(event assemblyai.SessionTerminated) {
22-
slog.Info("session terminated")
23-
}
24-
25-
func (h *realtimeHandler) FinalTranscript(transcript assemblyai.FinalTranscript) {
26-
fmt.Println(transcript.Text)
27-
}
28-
29-
func (h *realtimeHandler) PartialTranscript(transcript assemblyai.PartialTranscript) {
30-
fmt.Printf("%s\r", transcript.Text)
31-
}
32-
33-
func (h *realtimeHandler) Error(err error) {
34-
slog.Error("Something bad happened", "err", err)
35-
}
36-
3715
func main() {
3816
sigs := make(chan os.Signal, 1)
3917

@@ -52,14 +30,30 @@ func main() {
5230
framesPerBuffer = 3_200
5331
)
5432

55-
var h realtimeHandler
33+
transcriber := &assemblyai.RealTimeTranscriber{
34+
OnSessionBegins: func(event assemblyai.SessionBegins) {
35+
slog.Info("session begins")
36+
},
37+
OnSessionTerminated: func(event assemblyai.SessionTerminated) {
38+
slog.Info("session terminated")
39+
},
40+
OnFinalTranscript: func(transcript assemblyai.FinalTranscript) {
41+
fmt.Println(transcript.Text)
42+
},
43+
OnPartialTranscript: func(transcript assemblyai.PartialTranscript) {
44+
fmt.Printf("%s\r", transcript.Text)
45+
},
46+
OnError: func(err error) {
47+
slog.Error("Something bad happened", "err", err)
48+
},
49+
}
5650

5751
apiKey := os.Getenv("ASSEMBLYAI_API_KEY")
5852

5953
client := assemblyai.NewRealTimeClientWithOptions(
6054
assemblyai.WithRealTimeAPIKey(apiKey),
6155
assemblyai.WithRealTimeSampleRate(int(sampleRate)),
62-
assemblyai.WithHandler(&h),
56+
assemblyai.WithRealTimeTranscriber(transcriber),
6357
)
6458

6559
ctx := context.Background()

examples/realtime/recorder.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ import (
99

1010
type recorder struct {
1111
stream *portaudio.Stream
12-
in []int16
12+
buffer []int16
1313
}
1414

1515
func newRecorder(sampleRate int, framesPerBuffer int) (*recorder, error) {
16-
in := make([]int16, framesPerBuffer)
16+
buffer := make([]int16, framesPerBuffer)
1717

18-
stream, err := portaudio.OpenDefaultStream(1, 0, float64(sampleRate), framesPerBuffer, in)
18+
stream, err := portaudio.OpenDefaultStream(1, 0, float64(sampleRate), framesPerBuffer, buffer)
1919
if err != nil {
2020
return nil, err
2121
}
2222

2323
return &recorder{
2424
stream: stream,
25-
in: in,
25+
buffer: buffer,
2626
}, nil
2727
}
2828

@@ -31,12 +31,9 @@ func (r *recorder) Read() ([]byte, error) {
3131
return nil, err
3232
}
3333

34-
// Apple computers use little endian.
35-
byteOrder := binary.LittleEndian
34+
var buf bytes.Buffer
3635

37-
buf := new(bytes.Buffer)
38-
39-
if err := binary.Write(buf, byteOrder, r.in); err != nil {
36+
if err := binary.Write(&buf, binary.LittleEndian, r.buffer); err != nil {
4037
return nil, err
4138
}
4239

lemur.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,17 @@ func (s *LeMURService) PurgeRequestData(ctx context.Context, requestID string) (
115115

116116
return response, nil
117117
}
118+
119+
// Retrieve a previously generated LeMUR response.
120+
func (s *LeMURService) GetResponseData(ctx context.Context, requestID string, response interface{}) error {
121+
req, err := s.client.newJSONRequest(ctx, "GET", "/lemur/v3/"+requestID, nil)
122+
if err != nil {
123+
return err
124+
}
125+
126+
if _, err := s.client.do(req, response); err != nil {
127+
return err
128+
}
129+
130+
return nil
131+
}

lemur_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,25 @@ func TestLeMUR_PurgeRequestData(t *testing.T) {
235235

236236
require.True(t, ToBool(response.Deleted))
237237
}
238+
239+
func TestLeMUR_GetResponseData(t *testing.T) {
240+
t.Parallel()
241+
242+
client, handler, teardown := setup()
243+
defer teardown()
244+
245+
handler.HandleFunc("/lemur/v3/23f1485d-b3ba-4bba-8910-c16085e1afa5", func(w http.ResponseWriter, r *http.Request) {
246+
require.Equal(t, "GET", r.Method)
247+
248+
writeFileResponse(t, w, "testdata/lemur/task.json")
249+
})
250+
251+
ctx := context.Background()
252+
253+
var response LeMURTaskResponse
254+
255+
err := client.LeMUR.GetResponseData(ctx, "23f1485d-b3ba-4bba-8910-c16085e1afa5", &response)
256+
require.NoError(t, err)
257+
258+
require.NotEmpty(t, response.Response)
259+
}

types.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ type LeMURBaseParams struct {
159159
type LeMURBaseResponse struct {
160160
// The ID of the LeMUR request
161161
RequestID *string `json:"request_id,omitempty"`
162+
163+
// The usage numbers for the LeMUR request
164+
Usage LeMURUsage `json:"usage,omitempty"`
162165
}
163166

164167
// The model that is used for the final prompt after compression is performed.
@@ -225,6 +228,15 @@ type LeMURTaskResponse struct {
225228
LeMURBaseResponse
226229
}
227230

231+
// The usage numbers for the LeMUR request
232+
type LeMURUsage struct {
233+
// The number of input tokens used by the model
234+
InputTokens *int64 `json:"input_tokens,omitempty"`
235+
236+
// The number of output tokens generated by the model
237+
OutputTokens *int64 `json:"output_tokens,omitempty"`
238+
}
239+
228240
type ListTranscriptParams struct {
229241
// Get transcripts that were created after this transcript ID
230242
AfterID *string `url:"after_id,omitempty"`
@@ -247,8 +259,10 @@ type ListTranscriptParams struct {
247259

248260
// Details of the transcript page. Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.
249261
type PageDetails struct {
262+
// The URL used to retrieve the current page of transcripts
250263
CurrentURL *string `json:"current_url,omitempty"`
251264

265+
// The number of results this page is limited to
252266
Limit *int64 `json:"limit,omitempty"`
253267

254268
// The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
@@ -257,6 +271,7 @@ type PageDetails struct {
257271
// The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
258272
PrevURL *string `json:"prev_url,omitempty"`
259273

274+
// The actual number of results in the page
260275
ResultCount *int64 `json:"result_count,omitempty"`
261276
}
262277

@@ -270,6 +285,7 @@ type ParagraphsResponse struct {
270285
Paragraphs []TranscriptParagraph `json:"paragraphs,omitempty"`
271286
}
272287

288+
// The type of PII to redact
273289
type PIIPolicy string
274290

275291
type PurgeLeMURRequestDataResponse struct {
@@ -314,7 +330,7 @@ type SentencesResponse struct {
314330

315331
type Sentiment string
316332

317-
// The result of the sentiment analysis model
333+
// The result of the Sentiment Analysis model
318334
type SentimentAnalysisResult struct {
319335
// The confidence score for the detected sentiment of the sentence, from 0 to 1
320336
Confidence *float64 `json:"confidence,omitempty"`
@@ -420,7 +436,7 @@ type Transcript struct {
420436
AutoHighlights *bool `json:"auto_highlights,omitempty"`
421437

422438
// An array of results for the Key Phrases model, if it is enabled.
423-
// See [Key phrases](https://www.assemblyai.com/docs/models/key-phrases) for more information.
439+
// See [Key Phrases](https://www.assemblyai.com/docs/models/key-phrases) for more information.
424440
AutoHighlightsResult AutoHighlightsResult `json:"auto_highlights_result,omitempty"`
425441

426442
// The word boost parameter value
@@ -513,7 +529,7 @@ type Transcript struct {
513529
SentimentAnalysis *bool `json:"sentiment_analysis,omitempty"`
514530

515531
// An array of results for the Sentiment Analysis model, if it is enabled.
516-
// See [Sentiment analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) for more information.
532+
// See [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis) for more information.
517533
SentimentAnalysisResults []SentimentAnalysisResult `json:"sentiment_analysis_results,omitempty"`
518534

519535
// Whether [Speaker diarization](https://www.assemblyai.com/docs/models/speaker-diarization) is enabled, can be true or false
@@ -570,7 +586,7 @@ type Transcript struct {
570586
// The status code we received from your server when delivering your webhook, if a webhook URL was provided
571587
WebhookStatusCode *int64 `json:"webhook_status_code,omitempty"`
572588

573-
// The URL to which we send webhooks upon trancription completion
589+
// The URL to which we send webhooks upon transcription completion
574590
WebhookURL *string `json:"webhook_url,omitempty"`
575591

576592
// The list of custom vocabulary to boost transcription probability for
@@ -632,7 +648,7 @@ type TranscriptOptionalParams struct {
632648
// Enable [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters), can be true or false
633649
AutoChapters *bool `json:"auto_chapters,omitempty"`
634650

635-
// Whether Key Phrases is enabled, either true or false
651+
// Enable Key Phrases, either true or false
636652
AutoHighlights *bool `json:"auto_highlights,omitempty"`
637653

638654
// The word boost parameter value
@@ -641,13 +657,13 @@ type TranscriptOptionalParams struct {
641657
// Enable [Content Moderation](https://www.assemblyai.com/docs/models/content-moderation), can be true or false
642658
ContentSafety *bool `json:"content_safety,omitempty"`
643659

644-
// The confidence threshold for content moderation. Values must be between 25 and 100.
660+
// The confidence threshold for the Content Moderation model. Values must be between 25 and 100.
645661
ContentSafetyConfidence *int64 `json:"content_safety_confidence,omitempty"`
646662

647663
// Customize how words are spelled and formatted using to and from values
648664
CustomSpelling []TranscriptCustomSpelling `json:"custom_spelling,omitempty"`
649665

650-
// Whether custom topics is enabled, either true or false
666+
// Enable custom topics, either true or false
651667
CustomTopics *bool `json:"custom_topics,omitempty"`
652668

653669
// Transcribe Filler Words, like "umm", in your media file; can be true or false
@@ -672,7 +688,7 @@ type TranscriptOptionalParams struct {
672688
// The default value is 'en_us'.
673689
LanguageCode TranscriptLanguageCode `json:"language_code,omitempty"`
674690

675-
// Whether [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection) was enabled in the transcription request, either true or false.
691+
// Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.
676692
LanguageDetection *bool `json:"language_detection,omitempty"`
677693

678694
// Enable Automatic Punctuation, can be true or false
@@ -718,7 +734,7 @@ type TranscriptOptionalParams struct {
718734
// The type of summary
719735
SummaryType SummaryType `json:"summary_type,omitempty"`
720736

721-
// The list of custom topics provided, if custom topics is enabled
737+
// The list of custom topics
722738
Topics []string `json:"topics,omitempty"`
723739

724740
// The header name which should be sent back with webhook calls
@@ -727,7 +743,7 @@ type TranscriptOptionalParams struct {
727743
// Specify a header name and value to send back with a webhook call for added security
728744
WebhookAuthHeaderValue *string `json:"webhook_auth_header_value,omitempty"`
729745

730-
// The URL to which AssemblyAI send webhooks upon trancription completion
746+
// The URL to which AssemblyAI send webhooks upon transcription completion
731747
WebhookURL *string `json:"webhook_url,omitempty"`
732748

733749
// The list of custom vocabulary to boost transcription probability for

0 commit comments

Comments
 (0)