diff --git a/.golangci.yml b/.golangci.yml index 7fd7dfd..ae49b45 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,3 +20,7 @@ linters-settings: - github.com/google - github.com/stretchr/testify - github.com/cenkalti/backoff + revive: + rules: + - name: var-naming + disabled: true diff --git a/assemblyai.go b/assemblyai.go index 9f23e23..3699c22 100644 --- a/assemblyai.go +++ b/assemblyai.go @@ -12,7 +12,7 @@ import ( ) const ( - version = "1.6.0" + version = "1.7.0" defaultBaseURLScheme = "https" defaultBaseURLHost = "api.assemblyai.com" ) diff --git a/lemur.go b/lemur.go index fb602f2..5b53b94 100644 --- a/lemur.go +++ b/lemur.go @@ -5,23 +5,44 @@ import ( ) const ( - // LeMUR Default is best at complex reasoning. It offers more nuanced - // responses and improved contextual comprehension. + // Claude 3.5 Sonnet is the most intelligent model to date, outperforming + // Claude 3 Opus on a wide range of evaluations, with the speed and cost of + // Claude 3 Sonnet. + LeMURModelAnthropicClaude3_5_Sonnet LeMURModel = "anthropic/claude-3-5-sonnet" + + // Claude 3 Opus is good at handling complex analysis, longer tasks with + // many steps, and higher-order math and coding tasks. + LeMURModelAnthropicClaude3_Opus LeMURModel = "anthropic/claude-3-opus" + + // Claude 3 Haiku is the fastest model that can execute lightweight actions. + LeMURModelAnthropicClaude3_Haiku LeMURModel = "anthropic/claude-3-haiku" + + // Claude 3 Sonnet is a legacy model with a balanced combination of + // performance and speed for efficient, high-throughput tasks. + LeMURModelAnthropicClaude3_Sonnet LeMURModel = "anthropic/claude-3-sonnet" + + // Claude 2.1 is a legacy model similar to Claude 2.0. The key difference is + // that it minimizes model hallucination and system prompts, has a larger + // context window, and performs better in citations. + LeMURModelAnthropicClaude2_1 LeMURModel = "anthropic/claude-2-1" + + // Claude 2.0 is a legacy model that has good complex reasoning. It offers + // more nuanced responses and improved contextual comprehension. + LeMURModelAnthropicClaude2 LeMURModel = "anthropic/claude-2" + + // Legacy model. The same as [LeMURModelAnthropicClaude2]. LeMURModelDefault LeMURModel = "default" - // LeMUR Basic is a simplified model optimized for speed and cost. LeMUR - // Basic can complete requests up to 20% faster than Default. + // Claude Instant is a legacy model that is optimized for speed and cost. + // Claude Instant can complete requests up to 20% faster than Claude 2.0. + LeMURModelAnthropicClaudeInstant1_2 LeMURModel = "anthropic/claude-instant-1-2" + + // Legacy model. The same as [LeMURModelAnthropicClaudeInstant1_2]. LeMURModelBasic LeMURModel = "basic" - // Claude 2.1 is similar to Default, with key improvements: it minimizes - // model hallucination and system prompts, has a larger context window, and - // performs better in citations. + // Mistral 7B is an open source model that works well for summarization and + // answering questions. LeMURModelAssemblyAIMistral7B LeMURModel = "assemblyai/mistral-7b" - - // LeMUR Mistral 7B is an LLM self-hosted by AssemblyAI. It's the fastest - // and cheapest of the LLM options. We recommend it for use cases like basic - // summaries and factual Q&A. - LeMURModelAnthropicClaude2_1 LeMURModel = "anthropic/claude-2-1" ) // LeMURService groups the operations related to LeMUR. diff --git a/types.go b/types.go index ecbb225..155026c 100644 --- a/types.go +++ b/types.go @@ -136,7 +136,6 @@ type LeMURBaseParams struct { Context interface{} `json:"context,omitempty"` // The model that is used for the final prompt after compression is performed. - // Defaults to "default". FinalModel LeMURModel `json:"final_model,omitempty"` // 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 { // 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. type RedactPIIAudioQuality string +// The notification when the redacted audio is ready. +type RedactedAudioNotification struct { + RedactedAudioResponse +} + type RedactedAudioResponse struct { // The URL of the redacted audio file RedactedAudioURL *string `json:"redacted_audio_url,omitempty"` @@ -580,13 +584,15 @@ type Transcript struct { // Whether webhook authentication details were provided WebhookAuth *bool `json:"webhook_auth,omitempty"` - // The header name which should be sent back with webhook calls + // The header name to be sent with the transcript completed or failed webhook requests WebhookAuthHeaderName *string `json:"webhook_auth_header_name,omitempty"` - // The status code we received from your server when delivering your webhook, if a webhook URL was provided + // The status code we received from your server when delivering the transcript completed or failed webhook request, if a webhook URL was provided WebhookStatusCode *int64 `json:"webhook_status_code,omitempty"` - // The URL to which we send webhooks upon transcription completion + // 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. WebhookURL *string `json:"webhook_url,omitempty"` // The list of custom vocabulary to boost transcription probability for @@ -737,13 +743,13 @@ type TranscriptOptionalParams struct { // The list of custom topics Topics []string `json:"topics,omitempty"` - // The header name which should be sent back with webhook calls + // The header name to be sent with the transcript completed or failed webhook requests WebhookAuthHeaderName *string `json:"webhook_auth_header_name,omitempty"` - // Specify a header name and value to send back with a webhook call for added security + // The header value to send back with the transcript completed or failed webhook requests for added security WebhookAuthHeaderValue *string `json:"webhook_auth_header_value,omitempty"` - // The URL to which AssemblyAI send webhooks upon transcription completion + // 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. WebhookURL *string `json:"webhook_url,omitempty"` // The list of custom vocabulary to boost transcription probability for @@ -823,6 +829,9 @@ type TranscriptUtterance struct { Words []TranscriptWord `json:"words,omitempty"` } +// The notifications sent to the webhook URL. +type TranscriptWebhookNotification struct{} + type TranscriptWord struct { Confidence *float64 `json:"confidence,omitempty"`