-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates Examples With New Package Names, Adds Warning, Fix Thread Panic #252
Updates Examples With New Package Names, Adds Warning, Fix Thread Panic #252
Conversation
Important Review skippedReview was skipped due to path filters Files ignored due to path filters (48)
You can disable this status message by setting the WalkthroughThe recent updates to the Deepgram Go SDK involve various import path changes, package refactoring, function deprecations, and updates to logging and error handling. Key modifications include reorganizing client packages for better consistency, adding recovery mechanisms for panic situations, adjusting SDK versioning, and refining the instantiation processes across different API interfaces including Changes
Sequence Diagram(s)The changes do not include specific new features or modifications to the control flow that would necessitate sequence diagrams for better understanding. The updates largely revolve around refactoring and error-handling improvements without altering the primary interactions between components in a manner that significantly changes the overall behavior or architecture. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
530dd67
to
65d6392
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/speech-to-text/rest/file-new-RENAME/Bueller-Life-moves-pretty-fast.mp3
is excluded by!**/*.mp3
Files selected for processing (31)
- examples/manage/balances/main.go (1 hunks)
- examples/manage/invitations/main.go (1 hunks)
- examples/manage/keys/main.go (1 hunks)
- examples/manage/members/main.go (1 hunks)
- examples/manage/projects/main.go (1 hunks)
- examples/manage/scopes/main.go (1 hunks)
- examples/manage/usage/main.go (1 hunks)
- examples/speech-to-text/rest/callback/callback/main.go (2 hunks)
- examples/speech-to-text/rest/callback/endpoint/main.go (1 hunks)
- examples/speech-to-text/rest/file/main.go (2 hunks)
- examples/speech-to-text/rest/intent/main.go (2 hunks)
- examples/speech-to-text/rest/sentiment/main.go (2 hunks)
- examples/speech-to-text/rest/stream/main.go (2 hunks)
- examples/speech-to-text/rest/summary/main.go (2 hunks)
- examples/speech-to-text/rest/topic/main.go (2 hunks)
- examples/speech-to-text/rest/url/main.go (2 hunks)
- examples/speech-to-text/websocket/http/main.go (2 hunks)
- examples/speech-to-text/websocket/microphone/main.go (2 hunks)
- examples/speech-to-text/websocket/replay/main.go (2 hunks)
- examples/speech-to-text/websocket/test/main.go (2 hunks)
- examples/text-to-speech/rest/file/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/file/woodchuck/main.go (2 hunks)
- examples/text-to-speech/rest/stream/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/stream/woodchuck/main.go (2 hunks)
- examples/text-to-speech/rest/writer/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/writer/woodchuck/main.go (2 hunks)
- pkg/client/listen/client.go (7 hunks)
- pkg/client/listen/v1/websocket/client.go (7 hunks)
- pkg/client/listen/v1/websocket/constants.go (1 hunks)
- pkg/client/speak/v1/websocket/client.go (21 hunks)
- pkg/client/speak/v1/websocket/constants.go (1 hunks)
Files skipped from review due to trivial changes (7)
- examples/manage/balances/main.go
- examples/manage/invitations/main.go
- examples/manage/keys/main.go
- examples/manage/members/main.go
- examples/manage/projects/main.go
- examples/speech-to-text/rest/callback/endpoint/main.go
- pkg/client/listen/v1/websocket/constants.go
Additional comments not posted (36)
pkg/client/speak/v1/websocket/constants.go (1)
53-53
: Addition ofErrFatalPanicRecovered
is appropriate for enhanced error handling.The addition of this constant helps in better managing fatal errors that are caught and recovered, aligning with the PR's objective to handle panics more gracefully. This is a good practice in robust error management.
examples/text-to-speech/rest/file/hello-world/main.go (1)
15-15
: Updated API usage and client instantiation in example.The changes correctly reflect the migration from the old
speak
package to the newapi
package underspeak/v1/rest
, ensuring the example is up-to-date with the latest package structure. This is crucial for maintaining consistency and clarity in the SDK's documentation and examples.Also applies to: 41-41
examples/speech-to-text/rest/callback/callback/main.go (1)
15-15
: Updated API usage and client instantiation in example.The changes correctly reflect the migration from the old
prerecorded
package to the newlisten/v1/rest
package, ensuring the example is up-to-date with the latest package structure. This is crucial for maintaining consistency and clarity in the SDK's documentation and examples.Also applies to: 17-17, 33-34
examples/speech-to-text/rest/intent/main.go (1)
15-15
: Updated API usage and client instantiation in example.The changes correctly reflect the migration from the old
prerecorded
package to the newlisten/v1/rest
package, ensuring the example is up-to-date with the latest package structure. This is crucial for maintaining consistency and clarity in the SDK's documentation and examples.Also applies to: 17-17, 43-44
examples/speech-to-text/rest/sentiment/main.go (1)
15-15
: Updated API usage and client instantiation in example.The changes correctly reflect the migration from the old
prerecorded
package to the newlisten/v1/rest
package, ensuring the example is up-to-date with the latest package structure. This is crucial for maintaining consistency and clarity in the SDK's documentation and examples.Also applies to: 17-17, 43-44
examples/speech-to-text/rest/summary/main.go (2)
15-17
: Updated import paths to reflect new package structure.The changes in the import paths from
prerecorded
tolisten
reflect the updated package structure which seems aligned with the PR's objectives to update deprecated package names.
43-44
: Client instantiation updated to new API conventions.The client instantiation now uses
NewRESTWithDefaults
andNew
from theapi
package, which is consistent with the updated package structure and naming conventions.examples/speech-to-text/rest/topic/main.go (2)
15-17
: Consistent update of import paths across examples.Similar to other files, the update of import paths here ensures consistency across the examples, aligning with the new package structure.
43-44
: Consistency in client instantiation across examples.The client instantiation methods are consistently updated across examples, which is crucial for maintaining uniformity in API usage.
examples/text-to-speech/rest/writer/hello-world/main.go (2)
15-15
: Updated import path for TTS API.The import path update from
speak
tospeak/v1/rest
reflects the new API structure, making it clearer and more specific.
39-39
: Correct instantiation of TTS client using new API methods.The instantiation of the TTS client using
New
from the updated API package is correct and aligns with the new naming conventions.examples/text-to-speech/rest/file/woodchuck/main.go (2)
15-15
: Updated import path and client instantiation for TTS.The changes in import paths and client instantiation methods are consistent with the new API structure and naming conventions.
41-41
: Consistent client instantiation method used.The use of
New
for client instantiation is consistent across the updated examples, ensuring uniformity in the API's usage.examples/speech-to-text/rest/url/main.go (2)
15-17
: Import paths updated to align with new API structure.The updates to the import paths are consistent with the changes across other examples, reflecting the new API structure.
41-42
: Proper instantiation of client using updated API methods.The instantiation of the client using
NewRESTWithDefaults
andNew
is correct and aligns with the updated API conventions.examples/speech-to-text/rest/stream/main.go (2)
15-17
: Updated import paths match the new structure.The changes in import paths align with the PR's objectives to update to new package names. This helps in maintaining consistency across the codebase.
42-43
: Correct instantiation of new client objects.The instantiation of client objects using the new API paths is correct and reflects the updates mentioned in the PR objectives.
examples/text-to-speech/rest/writer/woodchuck/main.go (2)
15-15
: Updated import paths are consistent with new package structure.The import paths have been updated to reflect the new package names, which is in line with the PR's objectives.
39-39
: Client instantiation uses the updated API.The new client instantiation method
api.New
is used correctly here, reflecting the package updates intended by the PR.examples/speech-to-text/websocket/http/main.go (2)
16-16
: Updated import paths align with the new client structure.The updated import path for the client package is correct and reflects the intended changes in the PR.
40-40
: Correct instantiation of WebSocket client for demo purposes.The new method
NewWebSocketForDemo
is used properly for client instantiation, aligning with the updates to the WebSocket API in the PR.examples/text-to-speech/rest/stream/hello-world/main.go (2)
15-15
: Updated import paths correctly reflect the new API structure.The import paths have been updated appropriately, consistent with the PR's objectives to use the new package names.
39-39
: Proper use of new client instantiation method.The instantiation of the client using the new
api.New
method is correct and reflects the intended package updates by the PR.examples/speech-to-text/websocket/replay/main.go (2)
17-17
: Updated import path for the client package is correct.The import path has been updated to align with the new structure, which is consistent with the PR's objectives.
40-40
: Correct instantiation of WebSocket client for demo purposes.The use of
NewWebSocketForDemo
for client instantiation is correct and aligns with the updates to the WebSocket API as intended in the PR.examples/text-to-speech/rest/stream/woodchuck/main.go (1)
39-39
: Client instantiation updated to new API.The instantiation of the
api
client usingapi.New(c)
correctly follows the updated import paths and is consistent with the new package structure.examples/speech-to-text/rest/file/main.go (2)
44-47
: Client instantiation updated to new API.The instantiation of the
api
client usingapi.New(c)
correctly follows the updated import paths and is consistent with the new package structure.
15-17
: Updated import paths to reflect package renaming.The changes in the import paths from
prerecorded
tolisten/v1/rest
correctly reflect the new package structure. This should be verified across the project for consistency.Verification successful
Updated import paths to reflect package renaming.
The changes in the import paths from
prerecorded
tolisten/v1/rest
correctly reflect the new package structure. The new package paths are consistently used across the project, confirming the renaming is correctly implemented.
- All instances of the new package
github.com/deepgram/deepgram-go-sdk/pkg/api/listen/v1/rest
are found in various files, including tests and examples.- The new client package
github.com/deepgram/deepgram-go-sdk/pkg/client/listen
is also consistently used across multiple files.- The interfaces package
github.com/deepgram/deepgram-go-sdk/pkg/client/interfaces
is widely used across the project.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistency of package name changes across the project. # Test: Search for the old package name usage. Expect: No occurrences. rg --type go $'github.com/deepgram/deepgram-go-sdk/pkg/api/prerecorded/v1'Length of output: 73
Script:
#!/bin/bash # Description: Verify the new package name usage across the project. # Test: Search for the new package name usage. rg --type go $'github.com/deepgram/deepgram-go-sdk/pkg/api/listen/v1/rest' # Test: Search for the new client package name usage. rg --type go $'github.com/deepgram/deepgram-go-sdk/pkg/client/listen' # Test: Search for the new interfaces package name usage. rg --type go $'github.com/deepgram/deepgram-go-sdk/pkg/client/interfaces'Length of output: 12183
examples/speech-to-text/websocket/test/main.go (2)
58-58
: Client instantiation updated to new API.The instantiation of the
client
usingclient.NewWebSocket
correctly follows the updated import paths and is consistent with the new package structure.
17-17
: Updated import paths to reflect package renaming.The change in the import path from
live
tolisten
under thewebsocket
directory is part of the package renaming efforts. This should be verified across the project for consistency.Verification successful
Verified the consistency of package name changes across the project.
The new package name
listen
has been correctly and consistently integrated across the project.
pkg/client/prerecorded/legacy.go
pkg/client/live/legacy.go
pkg/client/listen/client.go
tests/unit_test/prerecorded_test.go
pkg/api/listen/v1/rest/rest.go
tests/daily_test/prerecorded_test.go
tests/edge_cases/keepalive/main.go
docs.go
tests/edge_cases/cancel/main.go
tests/edge_cases/timeout/main.go
tests/edge_cases/reconnect_client/main.go
tests/edge_cases/failed_retry/main.go
examples/speech-to-text/websocket/test/main.go
examples/speech-to-text/rest/summary/main.go
examples/speech-to-text/rest/topic/main.go
examples/speech-to-text/rest/stream/main.go
examples/speech-to-text/rest/url/main.go
examples/speech-to-text/websocket/microphone/main.go
examples/speech-to-text/websocket/replay/main.go
examples/speech-to-text/rest/file/main.go
examples/speech-to-text/websocket/http/main.go
examples/speech-to-text/rest/sentiment/main.go
examples/speech-to-text/rest/intent/main.go
examples/speech-to-text/rest/callback/callback/main.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistency of package name changes across the project. # Test: Search for the old package name usage. Expect: No occurrences. rg --type go $'github.com/deepgram/deepgram-go-sdk/pkg/client/live'Length of output: 66
Script:
#!/bin/bash # Description: Verify consistency of new package name usage across the project. # Test: Search for the new package name usage. Expect: Occurrences in relevant files. rg --type go $'github.com/deepgram/deepgram-go-sdk/pkg/client/listen'Length of output: 2711
examples/speech-to-text/websocket/microphone/main.go (1)
15-18
: Updated import paths and client instantiation approved.The changes to the import paths and the
client
package instantiation align with the new package structure as described in the PR summary and the AI-generated summary. This is a necessary update to ensure the example uses the latest SDK packages.pkg/client/listen/client.go (1)
26-33
: Review of deprecation notices and alias updates.All deprecation notices and alias updates are consistent with the changes described in the AI-generated summary. These changes help guide developers towards the newer API methods and maintain backward compatibility for now.
[APROVED]However, ensure that the deprecated methods are removed in future releases as indicated.
Also applies to: 44-48, 60-64, 75-79, 90-94, 111-115, 135-139, 159-162
pkg/client/speak/v1/websocket/client.go (1)
Line range hint
90-124
: Review of updated logging and error handling.The changes in logging and error handling are extensive and improve the clarity and traceability of the client's operations. The use of structured logging and detailed error messages will aid in debugging and maintaining the client.
However, consider adding more comments explaining the logic behind some complex operations, especially in the error handling and connection management areas, to improve maintainability.
+ // This block handles the reconnection logic in case the initial connection fails. + // It attempts to reconnect a specified number of times before giving up.Also applies to: 163-193, 254-287, 299-416, 453-479, 486-513, 523-556, 563-574, 581-592, 597-614, 620-647, 663-696
pkg/client/listen/v1/websocket/client.go (3)
295-316
: Improved error handling and thread safety in thelisten
function.The addition of panic recovery in the
listen
function is a crucial improvement for enhancing the robustness of the websocket client. This change ensures that unexpected panics do not cause the entire application to crash, instead allowing for a controlled closure of the websocket connection. This is particularly important in a multi-threaded environment where such panics can lead to unpredictable behavior or deadlocks.The implementation logs the panic occurrence, attempts to send an error callback, and ensures the websocket is closed properly. This approach not only handles the immediate error but also maintains the integrity of the application by preventing further complications.
+ defer func() { + if r := recover(); r != nil { + klog.V(1).Infof("Panic triggered\n") + err := ErrFatalPanicRecovered + sendErr := c.sendError(err) + if sendErr != nil { + klog.V(1).Infof("listen: Fatal socket error. Err: %v\n", sendErr) + } + c.closeWs(true) + klog.V(6).Infof("live.listen() LEAVE\n") + return + } + }()This pattern of error handling should be consistently applied across all functions that involve similar risks, ensuring that the application can gracefully handle failures and continue operation. It's advisable to review all other similar functions to ensure they follow a similar pattern for error handling and resource cleanup.
743-760
: Consistent error handling and recovery in theping
thread.The changes in the
ping
function mirror those in thelisten
function, providing a consistent approach to handling panics across different parts of the application. This is essential for maintaining a stable and reliable system, especially when dealing with external systems or services that might behave unpredictably.+ defer func() { + if r := recover(); r != nil { + klog.V(1).Infof("Panic triggered\n") + err := ErrFatalPanicRecovered + sendErr := c.sendError(err) + if sendErr != nil { + klog.V(1).Infof("listen: Fatal socket error. Err: %v\n", sendErr) + } + c.closeWs(true) + klog.V(6).Infof("live.ping() LEAVE\n") + return + } + }()This implementation ensures that the application can recover from unexpected errors during the keepalive process, which is critical for maintaining a live connection with external services. It's recommended to ensure that all network-related threads in the application utilize a similar pattern to enhance overall error resilience.
[APROVED]
793-810
: Robust error handling in theflush
function.Implementing panic recovery in the
flush
function is another step towards making the websocket client more resilient. This ensures that even if an unexpected error occurs during the flushing process, the application can recover gracefully without affecting the overall stability.+ defer func() { + if r := recover(); r != nil { + klog.V(1).Infof("Panic triggered\n") + err := ErrFatalPanicRecovered + sendErr := c.sendError(err) + if sendErr != nil { + klog.V(1).Infof("listen: Fatal socket error. Err: %v\n", sendErr) + } + c.closeWs(true) + klog.V(6).Infof("live.flush() LEAVE\n") + return + } + }()This change not only prevents the application from crashing but also ensures that resources are properly cleaned up, maintaining the integrity and performance of the system. Consistent error handling across all components that interact with external systems or services is crucial for building a reliable and maintainable application.
0403a63
to
43b1b20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/speech-to-text/rest/file-new-RENAME/Bueller-Life-moves-pretty-fast.mp3
is excluded by!**/*.mp3
Files selected for processing (33)
- examples/manage/balances/main.go (1 hunks)
- examples/manage/invitations/main.go (1 hunks)
- examples/manage/keys/main.go (1 hunks)
- examples/manage/members/main.go (1 hunks)
- examples/manage/projects/main.go (1 hunks)
- examples/manage/scopes/main.go (1 hunks)
- examples/manage/usage/main.go (1 hunks)
- examples/speech-to-text/rest/callback/callback/main.go (2 hunks)
- examples/speech-to-text/rest/callback/endpoint/main.go (1 hunks)
- examples/speech-to-text/rest/file/main.go (2 hunks)
- examples/speech-to-text/rest/intent/main.go (2 hunks)
- examples/speech-to-text/rest/sentiment/main.go (2 hunks)
- examples/speech-to-text/rest/stream/main.go (2 hunks)
- examples/speech-to-text/rest/summary/main.go (2 hunks)
- examples/speech-to-text/rest/topic/main.go (2 hunks)
- examples/speech-to-text/rest/url/main.go (2 hunks)
- examples/speech-to-text/websocket/http/main.go (2 hunks)
- examples/speech-to-text/websocket/microphone/main.go (2 hunks)
- examples/speech-to-text/websocket/replay/main.go (2 hunks)
- examples/speech-to-text/websocket/test/main.go (2 hunks)
- examples/text-to-speech/rest/file/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/file/woodchuck/main.go (2 hunks)
- examples/text-to-speech/rest/stream/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/stream/woodchuck/main.go (2 hunks)
- examples/text-to-speech/rest/writer/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/writer/woodchuck/main.go (2 hunks)
- pkg/client/interfaces/v1/utils.go (1 hunks)
- pkg/client/listen/client.go (7 hunks)
- pkg/client/listen/v1/websocket/client.go (7 hunks)
- pkg/client/listen/v1/websocket/constants.go (1 hunks)
- pkg/client/speak/client.go (2 hunks)
- pkg/client/speak/v1/websocket/client.go (21 hunks)
- pkg/client/speak/v1/websocket/constants.go (1 hunks)
Files skipped from review as they are similar to previous changes (31)
- examples/manage/balances/main.go
- examples/manage/invitations/main.go
- examples/manage/keys/main.go
- examples/manage/members/main.go
- examples/manage/projects/main.go
- examples/manage/scopes/main.go
- examples/manage/usage/main.go
- examples/speech-to-text/rest/callback/callback/main.go
- examples/speech-to-text/rest/callback/endpoint/main.go
- examples/speech-to-text/rest/file/main.go
- examples/speech-to-text/rest/intent/main.go
- examples/speech-to-text/rest/sentiment/main.go
- examples/speech-to-text/rest/stream/main.go
- examples/speech-to-text/rest/summary/main.go
- examples/speech-to-text/rest/topic/main.go
- examples/speech-to-text/rest/url/main.go
- examples/speech-to-text/websocket/http/main.go
- examples/speech-to-text/websocket/microphone/main.go
- examples/speech-to-text/websocket/replay/main.go
- examples/speech-to-text/websocket/test/main.go
- examples/text-to-speech/rest/file/hello-world/main.go
- examples/text-to-speech/rest/file/woodchuck/main.go
- examples/text-to-speech/rest/stream/hello-world/main.go
- examples/text-to-speech/rest/stream/woodchuck/main.go
- examples/text-to-speech/rest/writer/hello-world/main.go
- examples/text-to-speech/rest/writer/woodchuck/main.go
- pkg/client/listen/client.go
- pkg/client/listen/v1/websocket/client.go
- pkg/client/listen/v1/websocket/constants.go
- pkg/client/speak/v1/websocket/client.go
- pkg/client/speak/v1/websocket/constants.go
Additional comments not posted (3)
pkg/client/interfaces/v1/utils.go (1)
18-18
: SDK version updated to v1.4.0.Ensure all references to
sdkVersion
across the project are updated to reflect this new version.Verification successful
SDK version updated to v1.4.0.
All references to
sdkVersion
have been updated correctly.
pkg/client/interfaces/v1/utils.go: sdkVersion string = "v1.4.0"
pkg/client/interfaces/v1/utils.go: var DgAgent string = "@deepgram/sdk/" + sdkVersion + " go/" + goVersion()
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all references to `sdkVersion` are updated. # Test: Search for outdated SDK version references. Expect: No occurrences of "v1.2.0". rg --type go $'v1.2.0'Length of output: 21
Script:
#!/bin/bash # Description: Verify that all references to `sdkVersion` are updated to "v1.4.0". # Test: Search for all occurrences of `sdkVersion` and verify the updated version "v1.4.0". rg --type go 'sdkVersion'Length of output: 197
pkg/client/speak/client.go (2)
39-40
: Deprecation ofNewWithDefaults
in favor ofNewREST
.Consider adding a more detailed explanation or migration guide in the deprecation notice to assist users in transitioning to the new method.
60-69
: General API updates and function introductions.Review all documentation and example code to ensure they reflect the new function names and API structure. Update any remaining references to deprecated functions.
43b1b20
to
845c737
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
examples/text-to-speech/websocket/simple/main.go (1)
Line range hint
109-123
: Review new error handling and method calls in main function.The addition of
SpeakWithText
andFlush
methods in the main function is a good change for clarity and modularity. However, the error messages for both methods are identical, which might be confusing during debugging. Consider differentiating these messages or handling them more gracefully.- fmt.Printf("Error sending text input: %v\n", err) + fmt.Printf("Error during SpeakWithText: %v\n", err) - fmt.Printf("Error sending text input: %v\n", err) + fmt.Printf("Error during Flush: %v\n", err)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
examples/speech-to-text/rest/file-new-RENAME/Bueller-Life-moves-pretty-fast.mp3
is excluded by!**/*.mp3
Files selected for processing (35)
- examples/manage/balances/main.go (1 hunks)
- examples/manage/invitations/main.go (1 hunks)
- examples/manage/keys/main.go (1 hunks)
- examples/manage/members/main.go (1 hunks)
- examples/manage/projects/main.go (1 hunks)
- examples/manage/scopes/main.go (1 hunks)
- examples/manage/usage/main.go (1 hunks)
- examples/speech-to-text/rest/callback/callback/main.go (2 hunks)
- examples/speech-to-text/rest/callback/endpoint/main.go (1 hunks)
- examples/speech-to-text/rest/file/main.go (2 hunks)
- examples/speech-to-text/rest/intent/main.go (2 hunks)
- examples/speech-to-text/rest/sentiment/main.go (2 hunks)
- examples/speech-to-text/rest/stream/main.go (2 hunks)
- examples/speech-to-text/rest/summary/main.go (2 hunks)
- examples/speech-to-text/rest/topic/main.go (2 hunks)
- examples/speech-to-text/rest/url/main.go (2 hunks)
- examples/speech-to-text/websocket/http/main.go (2 hunks)
- examples/speech-to-text/websocket/microphone/main.go (2 hunks)
- examples/speech-to-text/websocket/replay/main.go (2 hunks)
- examples/speech-to-text/websocket/test/main.go (2 hunks)
- examples/text-to-speech/rest/file/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/file/woodchuck/main.go (2 hunks)
- examples/text-to-speech/rest/stream/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/stream/woodchuck/main.go (2 hunks)
- examples/text-to-speech/rest/writer/hello-world/main.go (2 hunks)
- examples/text-to-speech/rest/writer/woodchuck/main.go (2 hunks)
- examples/text-to-speech/websocket/interactive/main.go (1 hunks)
- examples/text-to-speech/websocket/simple/main.go (1 hunks)
- pkg/client/interfaces/v1/utils.go (1 hunks)
- pkg/client/listen/client.go (7 hunks)
- pkg/client/listen/v1/websocket/client.go (7 hunks)
- pkg/client/listen/v1/websocket/constants.go (1 hunks)
- pkg/client/speak/client.go (2 hunks)
- pkg/client/speak/v1/websocket/client.go (21 hunks)
- pkg/client/speak/v1/websocket/constants.go (1 hunks)
Files skipped from review due to trivial changes (1)
- examples/text-to-speech/websocket/interactive/main.go
Files skipped from review as they are similar to previous changes (33)
- examples/manage/balances/main.go
- examples/manage/invitations/main.go
- examples/manage/keys/main.go
- examples/manage/members/main.go
- examples/manage/projects/main.go
- examples/manage/scopes/main.go
- examples/manage/usage/main.go
- examples/speech-to-text/rest/callback/callback/main.go
- examples/speech-to-text/rest/callback/endpoint/main.go
- examples/speech-to-text/rest/file/main.go
- examples/speech-to-text/rest/intent/main.go
- examples/speech-to-text/rest/sentiment/main.go
- examples/speech-to-text/rest/stream/main.go
- examples/speech-to-text/rest/summary/main.go
- examples/speech-to-text/rest/topic/main.go
- examples/speech-to-text/rest/url/main.go
- examples/speech-to-text/websocket/http/main.go
- examples/speech-to-text/websocket/microphone/main.go
- examples/speech-to-text/websocket/replay/main.go
- examples/speech-to-text/websocket/test/main.go
- examples/text-to-speech/rest/file/hello-world/main.go
- examples/text-to-speech/rest/file/woodchuck/main.go
- examples/text-to-speech/rest/stream/hello-world/main.go
- examples/text-to-speech/rest/stream/woodchuck/main.go
- examples/text-to-speech/rest/writer/hello-world/main.go
- examples/text-to-speech/rest/writer/woodchuck/main.go
- pkg/client/interfaces/v1/utils.go
- pkg/client/listen/client.go
- pkg/client/listen/v1/websocket/client.go
- pkg/client/listen/v1/websocket/constants.go
- pkg/client/speak/client.go
- pkg/client/speak/v1/websocket/client.go
- pkg/client/speak/v1/websocket/constants.go
Additional comments not posted (2)
examples/text-to-speech/websocket/simple/main.go (2)
Line range hint
10-16
: Check import paths for consistency.The import paths align with the new package structure as described in the PR. However, ensure all examples and documentation are updated consistently to reflect these changes.
Line range hint
21-47
: Ensure proper error handling in callback methods.The callback methods handle different types of WebSocket messages appropriately. Each method logs relevant information, which is good for debugging. However, consider enhancing the error logging with more context or additional details if available.
845c737
to
650c0b0
Compare
edd8f9e
to
3d1e5c0
Compare
3d1e5c0
to
2986e7e
Compare
Proposed changes
Addresses: #251
This PR does three things:
//lint:ignore
comment. We are no longer using deprecated package names.Tested on all examples.
Types of changes
What types of changes does your code introduce to the community Go SDK?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
NA
Summary by CodeRabbit
New Features
listen/v1/rest
andlisten/v1/websocket
API packages.Improvements
speak
andlisten
clients.v1.4.0
.Deprecations
Refactor