From 464d357498893bb4b51a422e022827f25f9dd492 Mon Sep 17 00:00:00 2001 From: Marcus Olsson <8396880+marcusolsson@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:10:21 +0100 Subject: [PATCH] Sync from internal repo (2025-01-30) (#33) * test(sdk/go): add test for transcription errors (#7199) GitOrigin-RevId: 749d5058dd66ee32943ac6fb6dfea862922b8b9c * fix(spec, sdk): remove references of Claude 1 and Basic models (#7201) GitOrigin-RevId: ad669bfbc9b07a31d10cde02894e2b65010e4403 * fix(sdk): Bump versions for Python, Go, and Typescript (#7981) GitOrigin-RevId: 0c4b5b870ed3cb099c8f163d0acd839e6d6413a4 --- assemblyai.go | 2 +- integration_test.go | 20 ++++++++++++++++++++ lemur.go | 13 ++++++------- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/assemblyai.go b/assemblyai.go index a35e801..55d99f6 100644 --- a/assemblyai.go +++ b/assemblyai.go @@ -13,7 +13,7 @@ import ( ) const ( - version = "1.9.0" + version = "1.10.0" defaultBaseURLScheme = "https" defaultBaseURLHost = "api.assemblyai.com" ) diff --git a/integration_test.go b/integration_test.go index 4b390b6..b43274f 100644 --- a/integration_test.go +++ b/integration_test.go @@ -250,3 +250,23 @@ func TestIntegration_RealTime_WithExtraSessionInfo(t *testing.T) { require.True(t, sessionInformationInvoked) } + +// https://github.com/AssemblyAI/assemblyai-go-sdk/issues/32 +func TestIntegration_TranscriptionError(t *testing.T) { + apiKey := os.Getenv("ASSEMBLYAI_API_KEY") + if apiKey == "" { + t.Skip("ASSEMBLYAI_API_KEY not set") + } + + client := NewClient(apiKey) + + ctx := context.Background() + + transcript, err := client.Transcripts.TranscribeFromURL(ctx, "https://nonexisting.foo", nil) + // No error, because the transcript is returned with a 200 status code. + require.NoError(t, err) + + // Transcription errors are reported in the transcript.Error field. + require.NotNil(t, transcript.Error) + require.NotEmpty(t, ToString(transcript.Error)) +} diff --git a/lemur.go b/lemur.go index f850df9..22ba717 100644 --- a/lemur.go +++ b/lemur.go @@ -24,22 +24,21 @@ const ( // 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. + // + // Deprecated: Switch to Claude 3 by February 6th, 2025. 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. + // + // Deprecated: Switch to Claude 3 by February 6th, 2025. LeMURModelAnthropicClaude2 LeMURModel = "anthropic/claude-2" // Legacy model. The same as [LeMURModelAnthropicClaude2]. + // + // Deprecated: Switch to Claude 3 by February 6th, 2025. LeMURModelDefault LeMURModel = "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" - // Mistral 7B is an open source model that works well for summarization and // answering questions. LeMURModelAssemblyAIMistral7B LeMURModel = "assemblyai/mistral-7b"