-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d9d003
commit badec5a
Showing
9 changed files
with
186 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
// Copyright 2024 Deepgram SDK contributors. All Rights Reserved. | ||
// Use of this source code is governed by a MIT license that can be found in the LICENSE file. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package listen | ||
|
||
import ( | ||
"context" | ||
|
||
msginterfaces "github.com/deepgram/deepgram-go-sdk/pkg/api/listen/v1/websocket/interfaces" | ||
interfaces "github.com/deepgram/deepgram-go-sdk/pkg/client/interfaces" | ||
listenv1rest "github.com/deepgram/deepgram-go-sdk/pkg/client/listen/v1/rest" | ||
listenv1ws "github.com/deepgram/deepgram-go-sdk/pkg/client/listen/v1/websocket" | ||
) | ||
|
||
/***********************************/ | ||
// Deprecated (THESE WILL STILL WORK, | ||
// BUT WILL BE REMOVED IN A FUTURE RELEASE) | ||
/***********************************/ | ||
/* | ||
NewWebSocketForDemo creates a new websocket connection with all default options | ||
Please see NewWebSocketUsingCallbackForDemo for more information. | ||
TODO: Deprecate this function later | ||
*/ | ||
func NewWebSocketForDemo(ctx context.Context, options *interfaces.LiveTranscriptionOptions) (*listenv1ws.Client, error) { | ||
return NewWSUsingCallbackForDemo(ctx, options) | ||
} | ||
|
||
/* | ||
NewWebSocketWithDefaults creates a new websocket connection with all default options | ||
Please see NewWebSocketUsingCallbackWithDefaults for more information. | ||
TODO: Deprecate this function later | ||
*/ | ||
func NewWebSocketWithDefaults(ctx context.Context, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.Client, error) { | ||
return NewWSUsingCallbackWithDefaults(ctx, tOptions, callback) | ||
} | ||
|
||
/* | ||
NewWebSocket creates a new websocket connection with the specified options | ||
Please see NewWebSocketUsingCallback for more information. | ||
TODO: Deprecate this function later | ||
*/ | ||
func NewWebSocket(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.Client, error) { | ||
return NewWSUsingCallback(ctx, apiKey, cOptions, tOptions, callback) | ||
} | ||
|
||
/* | ||
NewWebSocketWithCancel creates a new websocket connection but has facilities to BYOC (Bring Your Own Cancel) | ||
Please see NewWebSocketUsingCallbackWithCancel for more information. | ||
TODO: Deprecate this function later | ||
*/ | ||
func NewWebSocketWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.Client, error) { | ||
return NewWSUsingCallbackWithCancel(ctx, ctxCancel, apiKey, cOptions, tOptions, callback) | ||
} | ||
|
||
/***********************************/ | ||
// REST Client | ||
/***********************************/ | ||
// PreRecordedClient is an alias for listenv1rest.Client | ||
// | ||
// Deprecated: This package is deprecated. Use RestClient instead. This will be removed in a future release. | ||
type PreRecordedClient = listenv1rest.RESTClient | ||
|
||
// NewPreRecordedWithDefaults is an alias for NewRESTWithDefaults | ||
// | ||
// Deprecated: This package is deprecated. Use NewRESTWithDefaults instead. This will be removed in a future release. | ||
func NewPreRecordedWithDefaults() *listenv1rest.RESTClient { | ||
return NewRESTWithDefaults() | ||
} | ||
|
||
// NewPreRecorded is an alias for NewREST | ||
// | ||
// Deprecated: This package is deprecated. Use NewREST instead. This will be removed in a future release. | ||
func NewPreRecorded(apiKey string, options *interfaces.ClientOptions) *listenv1rest.RESTClient { | ||
return NewREST(apiKey, options) | ||
} | ||
|
||
/***********************************/ | ||
// WebSocket / Streaming / Live | ||
/***********************************/ | ||
// LiveClient is an alias for listenv1rest.Client | ||
// | ||
// Deprecated: This alias is deprecated. Use WSCallback instead. This will be removed in a future release. | ||
type LiveClient = listenv1ws.Client | ||
|
||
/* | ||
Older "Live" functions | ||
*/ | ||
// NewLiveForDemo is an alias for NewWebSocketForDemo | ||
// | ||
// Deprecated: This package is deprecated. Use NewWebSocketForDemo instead. This will be removed in a future release. | ||
func NewLiveForDemo(ctx context.Context, options *interfaces.LiveTranscriptionOptions) (*listenv1ws.WSCallback, error) { | ||
return NewWebSocketForDemo(ctx, options) | ||
} | ||
|
||
// NewLiveWithDefaults is an alias for NewWebSocketWithDefaults | ||
// | ||
// Deprecated: This package is deprecated. Use NewWebSocketWithDefaults instead. This will be removed in a future release. | ||
func NewLiveWithDefaults(ctx context.Context, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.WSCallback, error) { | ||
return NewWebSocketWithDefaults(ctx, tOptions, callback) | ||
} | ||
|
||
// NewLive is an alias for NewWebSocket | ||
// | ||
// Deprecated: This package is deprecated. Use NewWebSocket instead. This will be removed in a future release. | ||
func NewLive(ctx context.Context, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.WSCallback, error) { | ||
return NewWebSocket(ctx, apiKey, cOptions, tOptions, callback) | ||
} | ||
|
||
// NewLiveWithCancel is an alias for NewWebSocketWithCancel | ||
// | ||
// Deprecated: This package is deprecated. Use NewWebSocketWithCancel instead. This will be removed in a future release. | ||
func NewLiveWithCancel(ctx context.Context, ctxCancel context.CancelFunc, apiKey string, cOptions *interfaces.ClientOptions, tOptions *interfaces.LiveTranscriptionOptions, callback msginterfaces.LiveMessageCallback) (*listenv1ws.WSCallback, error) { | ||
return NewWebSocketWithCancel(ctx, ctxCancel, apiKey, cOptions, tOptions, callback) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2024 Deepgram SDK contributors. All Rights Reserved. | ||
// Use of this source code is governed by a MIT license that can be found in the LICENSE file. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package speak | ||
|
||
import ( | ||
interfaces "github.com/deepgram/deepgram-go-sdk/pkg/client/interfaces/v1" | ||
speakv1rest "github.com/deepgram/deepgram-go-sdk/pkg/client/speak/v1/rest" | ||
) | ||
|
||
/***********************************/ | ||
// Deprecated (THESE WILL STILL WORK, | ||
// BUT WILL BE REMOVED IN A FUTURE RELEASE) | ||
/***********************************/ | ||
/* | ||
Legacy Client Name | ||
Deprecated: This struct is deprecated. Please use RestClient struct. This will be removed in a future release. | ||
*/ | ||
type Client = speakv1rest.RESTClient | ||
|
||
/* | ||
NewWithDefaults creates a new speak client with all default options | ||
Deprecated: This function is deprecated. Please use NewREST(). This will be removed in a future release. | ||
*/ | ||
func NewWithDefaults() *speakv1rest.RESTClient { | ||
return speakv1rest.NewWithDefaults() | ||
} | ||
|
||
/* | ||
New creates a new speak client with the specified options | ||
Input parameters: | ||
- ctx: context.Context object | ||
- apiKey: string containing the Deepgram API key | ||
- options: ClientOptions which allows overriding things like hostname, version of the API, etc. | ||
Deprecated: This function is deprecated. Please use NewREST(). This will be removed in a future release. | ||
*/ | ||
func New(apiKey string, options *interfaces.ClientOptions) *speakv1rest.RESTClient { | ||
return speakv1rest.New(apiKey, options) | ||
} |