Releases: AssemblyAI/assemblyai-go-sdk
v1.10.0
What's Changed
- Sync from internal repo (2025-01-30) by @marcusolsson in #33
Full Changelog: v1.9.0...v1.10.0
v1.9.0
What's Changed
- Sync from internal repo (2024-10-21) by @marcusolsson in #31
Full Changelog: v1.8.1...v1.9.0
v1.8.1
v1.8.0
This release adds new types for Automatic Language Detection (ALD).
What's Changed
- Sync from internal repo (2024-08-26) by @marcusolsson in #26
Full Changelog: v1.7.0...v1.8.0
v1.7.0
This release adds a set of new LeMUR models along with minor fixes and docs improvements.
What's Changed
- Sync from internal repo (2024-07-10) by @marcusolsson in #24
Full Changelog: v1.6.0...v1.7.0
v1.6.0
What's Changed
- Sync from internal repo (2024-06-17) by @marcusolsson in #23
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
What's Changed
- Sync from internal repo (2024-05-17) by @marcusolsson in #21
Full Changelog: v1.5.0...v1.5.1
v1.5.0
What's Changed
- Sync from internal repo (2024-04-15) by @marcusolsson in #17
- Sync from internal repo (2024-04-15) by @marcusolsson in #18
- Sync from internal repo (2024-04-16) by @marcusolsson in #19
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
What's Changed
- Sync from internal repo (2024-03-28) by @marcusolsson in #16
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
What's Changed
- Sync from internal repo (2024-03-18) by @marcusolsson in #15
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"
)