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

Commit ca89af9

Browse files
authored
Sync from internal repo (2024-07-10) (#24)
* feat(sdk/go): update types from spec (#5568) GitOrigin-RevId: d289aa1ef60f43e96683c58efde410181c4d6cc4 * chore(sdk): prepare for sdk releases (#5569) GitOrigin-RevId: bd60027b002ee11ac036c7dc6faaf70c317ef842
1 parent 6c797fc commit ca89af9

File tree

4 files changed

+54
-20
lines changed

4 files changed

+54
-20
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ linters-settings:
2020
- github.com/google
2121
- github.com/stretchr/testify
2222
- github.com/cenkalti/backoff
23+
revive:
24+
rules:
25+
- name: var-naming
26+
disabled: true

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.6.0"
15+
version = "1.7.0"
1616
defaultBaseURLScheme = "https"
1717
defaultBaseURLHost = "api.assemblyai.com"
1818
)

lemur.go

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,44 @@ import (
55
)
66

77
const (
8-
// LeMUR Default is best at complex reasoning. It offers more nuanced
9-
// responses and improved contextual comprehension.
8+
// Claude 3.5 Sonnet is the most intelligent model to date, outperforming
9+
// Claude 3 Opus on a wide range of evaluations, with the speed and cost of
10+
// Claude 3 Sonnet.
11+
LeMURModelAnthropicClaude3_5_Sonnet LeMURModel = "anthropic/claude-3-5-sonnet"
12+
13+
// Claude 3 Opus is good at handling complex analysis, longer tasks with
14+
// many steps, and higher-order math and coding tasks.
15+
LeMURModelAnthropicClaude3_Opus LeMURModel = "anthropic/claude-3-opus"
16+
17+
// Claude 3 Haiku is the fastest model that can execute lightweight actions.
18+
LeMURModelAnthropicClaude3_Haiku LeMURModel = "anthropic/claude-3-haiku"
19+
20+
// Claude 3 Sonnet is a legacy model with a balanced combination of
21+
// performance and speed for efficient, high-throughput tasks.
22+
LeMURModelAnthropicClaude3_Sonnet LeMURModel = "anthropic/claude-3-sonnet"
23+
24+
// Claude 2.1 is a legacy model similar to Claude 2.0. The key difference is
25+
// that it minimizes model hallucination and system prompts, has a larger
26+
// context window, and performs better in citations.
27+
LeMURModelAnthropicClaude2_1 LeMURModel = "anthropic/claude-2-1"
28+
29+
// Claude 2.0 is a legacy model that has good complex reasoning. It offers
30+
// more nuanced responses and improved contextual comprehension.
31+
LeMURModelAnthropicClaude2 LeMURModel = "anthropic/claude-2"
32+
33+
// Legacy model. The same as [LeMURModelAnthropicClaude2].
1034
LeMURModelDefault LeMURModel = "default"
1135

12-
// LeMUR Basic is a simplified model optimized for speed and cost. LeMUR
13-
// Basic can complete requests up to 20% faster than Default.
36+
// Claude Instant is a legacy model that is optimized for speed and cost.
37+
// Claude Instant can complete requests up to 20% faster than Claude 2.0.
38+
LeMURModelAnthropicClaudeInstant1_2 LeMURModel = "anthropic/claude-instant-1-2"
39+
40+
// Legacy model. The same as [LeMURModelAnthropicClaudeInstant1_2].
1441
LeMURModelBasic LeMURModel = "basic"
1542

16-
// Claude 2.1 is similar to Default, with key improvements: it minimizes
17-
// model hallucination and system prompts, has a larger context window, and
18-
// performs better in citations.
43+
// Mistral 7B is an open source model that works well for summarization and
44+
// answering questions.
1945
LeMURModelAssemblyAIMistral7B LeMURModel = "assemblyai/mistral-7b"
20-
21-
// LeMUR Mistral 7B is an LLM self-hosted by AssemblyAI. It's the fastest
22-
// and cheapest of the LLM options. We recommend it for use cases like basic
23-
// summaries and factual Q&A.
24-
LeMURModelAnthropicClaude2_1 LeMURModel = "anthropic/claude-2-1"
2546
)
2647

2748
// LeMURService groups the operations related to LeMUR.

types.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ type LeMURBaseParams struct {
136136
Context interface{} `json:"context,omitempty"`
137137

138138
// The model that is used for the final prompt after compression is performed.
139-
// Defaults to "default".
140139
FinalModel LeMURModel `json:"final_model,omitempty"`
141140

142141
// Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
@@ -307,6 +306,11 @@ type RealtimeTemporaryTokenResponse struct {
307306
// Controls the filetype of the audio created by redact_pii_audio. Currently supports mp3 (default) and wav. See [PII redaction](https://www.assemblyai.com/docs/models/pii-redaction) for more details.
308307
type RedactPIIAudioQuality string
309308

309+
// The notification when the redacted audio is ready.
310+
type RedactedAudioNotification struct {
311+
RedactedAudioResponse
312+
}
313+
310314
type RedactedAudioResponse struct {
311315
// The URL of the redacted audio file
312316
RedactedAudioURL *string `json:"redacted_audio_url,omitempty"`
@@ -580,13 +584,15 @@ type Transcript struct {
580584
// Whether webhook authentication details were provided
581585
WebhookAuth *bool `json:"webhook_auth,omitempty"`
582586

583-
// The header name which should be sent back with webhook calls
587+
// The header name to be sent with the transcript completed or failed webhook requests
584588
WebhookAuthHeaderName *string `json:"webhook_auth_header_name,omitempty"`
585589

586-
// The status code we received from your server when delivering your webhook, if a webhook URL was provided
590+
// The status code we received from your server when delivering the transcript completed or failed webhook request, if a webhook URL was provided
587591
WebhookStatusCode *int64 `json:"webhook_status_code,omitempty"`
588592

589-
// The URL to which we send webhooks upon transcription completion
593+
// The URL to which we send webhook requests.
594+
// We sends two different types of webhook requests.
595+
// One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
590596
WebhookURL *string `json:"webhook_url,omitempty"`
591597

592598
// The list of custom vocabulary to boost transcription probability for
@@ -737,13 +743,13 @@ type TranscriptOptionalParams struct {
737743
// The list of custom topics
738744
Topics []string `json:"topics,omitempty"`
739745

740-
// The header name which should be sent back with webhook calls
746+
// The header name to be sent with the transcript completed or failed webhook requests
741747
WebhookAuthHeaderName *string `json:"webhook_auth_header_name,omitempty"`
742748

743-
// Specify a header name and value to send back with a webhook call for added security
749+
// The header value to send back with the transcript completed or failed webhook requests for added security
744750
WebhookAuthHeaderValue *string `json:"webhook_auth_header_value,omitempty"`
745751

746-
// The URL to which AssemblyAI send webhooks upon transcription completion
752+
// The URL to which we send webhook requests. We sends two different types of webhook requests. One request when a transcript is completed or failed, and one request when the redacted audio is ready if redact_pii_audio is enabled.
747753
WebhookURL *string `json:"webhook_url,omitempty"`
748754

749755
// The list of custom vocabulary to boost transcription probability for
@@ -823,6 +829,9 @@ type TranscriptUtterance struct {
823829
Words []TranscriptWord `json:"words,omitempty"`
824830
}
825831

832+
// The notifications sent to the webhook URL.
833+
type TranscriptWebhookNotification struct{}
834+
826835
type TranscriptWord struct {
827836
Confidence *float64 `json:"confidence,omitempty"`
828837

0 commit comments

Comments
 (0)