Skip to content

Releases: AssemblyAI/assemblyai-go-sdk

v1.10.0

30 Jan 14:11
464d357
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.9.0...v1.10.0

v1.9.0

06 Nov 08:28
52add84
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.8.1...v1.9.0

v1.8.1

25 Sep 23:37
878ef53
Compare
Choose a tag to compare

This release resolves panic on Disconnect() due to nil pointer dereference.

What's Changed

  • patch(sdk/go): add nil check for c.conn on disconnect & return error by @he-james in #30

New Contributors

Full Changelog: v1.8.0...v1.8.1

v1.8.0

26 Aug 14:55
e00d1ad
Compare
Choose a tag to compare

This release adds new types for Automatic Language Detection (ALD).

What's Changed

Full Changelog: v1.7.0...v1.8.0

v1.7.0

10 Jul 15:04
ca89af9
Compare
Choose a tag to compare

This release adds a set of new LeMUR models along with minor fixes and docs improvements.

What's Changed

Full Changelog: v1.6.0...v1.7.0

v1.6.0

17 Jun 12:52
6c797fc
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.5.1...v1.6.0

New Features

You can now retrieve previously generated LeMUR responses using the request ID.

var response aai.LeMURTaskResponse
err := client.LeMUR.GetResponseData(ctx, requestID, &response)

If you don't know the response type in advance, you can also decode the response into a map (or json.RawMessage):

var response map[string]interface{}
err := client.LeMUR.GetResponseData(ctx, requestID, &response)

This release also adds information about the token usage for each LeMUR call. Available from the Usage field in the LeMUR response.

// The usage numbers for the LeMUR request
type LeMURUsage struct {
	// The number of input tokens used by the model
	InputTokens *int64 `json:"input_tokens,omitempty"`

	// The number of output tokens generated by the model
	OutputTokens *int64 `json:"output_tokens,omitempty"`
}

Improvements

This release also adds some minor improvements to documentation and example code.

v1.5.1

17 May 21:15
32ea176
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.5.0...v1.5.1

v1.5.0

16 Apr 09:48
56d6173
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.1...v1.5.0

New real-time transcriber

This release introduces a new RealTimeTranscriber type along with the WithRealTimeTranscript option. RealTimeTranscriber replaces the RealTimeHandler interface. While this deprecates RealTimeHandler, no action is required for this release.

The new RealTimeTranscriber allows you to only define callbacks for the events you care about.

transcriber := &aai.RealTimeTranscriber{
	OnSessionBegins: func(event aai.SessionBegins) {
		// ...
	},

	OnSessionTerminated: func(event aai.SessionTerminated) {
		// ...
	},

	OnPartialTranscript: func(event aai.PartialTranscript) {
		// ...
	},

	OnFinalTranscript: func(event aai.FinalTranscript) {
		// ...
	},

	OnSessionInformation: func(event aai.SessionInformation) {
		// ...
	},

	OnError: func(err error) {
		// ...
	},
}

client := aai.NewRealTimeClientWithOptions(
	aai.WithRealTimeAPIKey("YOUR_API_KEY"),
	aai.WithRealTimeTranscriber(transcriber),
)

Extra session information

You can now receive extra session information by defining the OnSessionInformation callback with the new recently introduced RealTimeTranscriber.

client := aai.NewRealTimeClientWithOptions(
	aai.WithRealTimeAPIKey("YOUR_API_KEY"),
	aai.WithRealTimeTranscriber(&aai.RealTimeTranscriber{
		OnSessionInformation: func(event aai.SessionInformation) {
			// ...
		},
	}),
)

Performance improvements

The server now only sends partial transcripts if you've defined the OnPartialTranscript. This reduces network traffic when you're only interested in final transcripts.

transcriber := &aai.RealTimeTranscriber{
	OnFinalTranscript: func(event aai.FinalTranscript) {
		// ...
	},
}

Note: If you're using the now deprecated RealTimeHandler, you need to migrate to RealTimeTranscriber to benefit from this.

v1.4.1

28 Mar 11:06
1c156e7
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.4.0...v1.4.1

Bug fixes

This release fixes an issue where the API key wouldn't be used for the real-time client.

Enhancements

This release adds an enum for the default speech model.

v1.4.0

18 Mar 17:07
4f91eb8
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.3.0...v1.4.0

New Features

Temporary auth tokens for Real-Time Transcription

You can now issue temporary auth tokens for real-time transcription.

To create a new temporary token, use CreateTemporaryToken:

client := assemblyai.NewClient("YOUR_API_KEY")

resp, _ := client.RealTime.CreateTemporaryToken(ctx, 480)

fmt.Println(assemblyai.ToString(resp.Token))

To create an authenticated real-time client, configure the temporary token with the WithRealTimeAuthToken option:

realtimeClient := assemblyai.NewRealTimeClientWithOptions(
	assemblyai.WithRealTimeAuthToken(token),
	assemblyai.WithHandler(&handler),
)

realtimeClient.Connect(ctx)

Enhancements

This release also adds enums for LeMUR models and speech models:

LeMUR models

const (
	// LeMUR Default is best at complex reasoning. It offers more nuanced
	// responses and improved contextual comprehension.
	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.
	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.
	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"
)

Speech models

const (
	// The Nano tier is a lightweight model that is optimized for speed and cost.
	SpeechModelNano SpeechModel = "nano"

	// Conformer-2 is a heavy-duty model optimized for accuracy.
	SpeechModelConformer2 SpeechModel = "conformer-2"
)