feat: use new ui bubbletea
This commit is contained in:
@@ -230,8 +230,9 @@ func (a *DeepgramAdapter) buildURL() (string, error) {
|
||||
q.Set("punctuate", "true")
|
||||
|
||||
// add language if specified
|
||||
if a.language != "" {
|
||||
q.Set("language", a.language)
|
||||
lang := normalizeDeepgramLanguage(a.language)
|
||||
if lang != "" {
|
||||
q.Set("language", lang)
|
||||
}
|
||||
|
||||
if len(a.keywords) > 0 {
|
||||
|
||||
@@ -118,8 +118,9 @@ func (a *DeepgramBatchAdapter) buildURL() (string, error) {
|
||||
q.Set("punctuate", "true")
|
||||
|
||||
// add language if specified
|
||||
if a.language != "" {
|
||||
q.Set("language", a.language)
|
||||
lang := normalizeDeepgramLanguage(a.language)
|
||||
if lang != "" {
|
||||
q.Set("language", lang)
|
||||
}
|
||||
|
||||
if len(a.keywords) > 0 {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package transcriber
|
||||
|
||||
import "strings"
|
||||
|
||||
func normalizeDeepgramLanguage(code string) string {
|
||||
if code == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
if strings.EqualFold(code, "en") || strings.EqualFold(code, "en-us") || strings.EqualFold(code, "en_us") {
|
||||
return "en-US"
|
||||
}
|
||||
|
||||
return code
|
||||
}
|
||||
Reference in New Issue
Block a user