Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ linters-settings:
- github.com/google
- github.com/stretchr/testify
- github.com/cenkalti/backoff
revive:
rules:
- name: var-naming
disabled: true
2 changes: 1 addition & 1 deletion assemblyai.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
version = "1.6.0"
version = "1.7.0"
defaultBaseURLScheme = "https"
defaultBaseURLHost = "api.assemblyai.com"
)
Expand Down
45 changes: 33 additions & 12 deletions lemur.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 16 additions & 7 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"`

Expand Down