-
Notifications
You must be signed in to change notification settings - Fork 34
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
Implement Get Models #262
Implement Get Models #262
Conversation
WalkthroughThis update enhances the Deepgram Go SDK by introducing comprehensive model management functionalities. It includes a command-line application for interacting with models, new data structures for handling speech technologies, and API methods for retrieving and managing model data. Additionally, improvements to the documentation provide users with direct access to these new features, facilitating better understanding and utilization of model management capabilities. Changes
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 Configuration File (
|
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- README.md (1 hunks)
- examples/manage/models/main.go (1 hunks)
- pkg/api/manage/v1/interfaces/types.go (2 hunks)
- pkg/api/manage/v1/models.go (1 hunks)
- pkg/api/version/manage-version.go (1 hunks)
Files skipped from review due to trivial changes (1)
- README.md
Additional comments not posted (22)
pkg/api/version/manage-version.go (4)
33-33
: LGTM!The addition of
ModelsURI
is consistent with other URI patterns in the file.
34-34
: LGTM!The addition of
ModelsByIDURI
is consistent with other URI patterns in the file.
35-35
: LGTM!The addition of
ModelsProjectURI
is consistent with other URI patterns in the file.
36-36
: LGTM!The addition of
ModelsProjectByIDURI
is consistent with other URI patterns in the file.examples/manage/models/main.go (7)
1-14
: LGTM!The initial setup and imports are correct and follow standard practices.
16-25
: LGTM!The main function's initial setup is correct and follows standard practices.
27-41
: LGTM!The project listing logic and error handling are correct.
43-65
: LGTM!The model listing logic and error handling are correct.
67-74
: LGTM!The model retrieval logic and error handling are correct.
76-98
: LGTM!The project model listing logic and error handling are correct.
100-107
: LGTM!The project model retrieval logic and error handling are correct.
pkg/api/manage/v1/models.go (6)
20-23
: LGTM!The
ListModels
function correctly wraps theGetModels
function.
25-39
: LGTM!The
GetModels
function correctly retrieves models and uses appropriate logging levels.
41-55
: LGTM!The
GetModel
function correctly retrieves a model by ID and uses appropriate logging levels.
57-60
: LGTM!The
ListProjectModels
function correctly wraps theGetProjectModels
function.
62-75
: LGTM!The
GetProjectModels
function correctly retrieves models associated with a project and uses appropriate logging levels.
78-92
: LGTM!The
GetProjectModel
function correctly retrieves a project model by ID and uses appropriate logging levels.pkg/api/manage/v1/interfaces/types.go (5)
94-105
: LGTM!The
Stt
struct is well-defined and follows Go conventions.
107-114
: LGTM!The
Metadata
struct is well-defined and follows Go conventions.
116-125
: LGTM!The
Tts
struct is well-defined and follows Go conventions.
388-392
: LGTM!The
ModelsResult
struct is well-defined and follows Go conventions.
394-403
: LGTM!The
ModelResult
struct is well-defined and follows Go conventions.
4dbc6b9
to
b74eacb
Compare
b74eacb
to
9490990
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: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- README.md (1 hunks)
- examples/manage/models/main.go (1 hunks)
- pkg/api/manage/v1/interfaces/types.go (3 hunks)
- pkg/api/manage/v1/models.go (1 hunks)
- pkg/api/version/manage-version.go (1 hunks)
Files skipped from review due to trivial changes (1)
- README.md
Additional context used
GitHub Check: Go Tests
examples/manage/models/main.go
[failure] 44-44:
not enough arguments in call to mgClient.ListModels
[failure] 77-77:
not enough arguments in call to mgClient.ListProjectModels
Additional comments not posted (7)
pkg/api/version/manage-version.go (1)
32-36
: LGTM!The new URI constants for models are well-defined and enhance the API's capability to handle model-related operations.
pkg/api/manage/v1/interfaces/types.go (6)
94-105
: LGTM! TheStt
struct is well-defined.The struct captures essential attributes for speech-to-text functionalities.
107-114
: LGTM! TheMetadata
struct is straightforward and useful.This struct effectively encapsulates metadata details for models.
116-125
: LGTM! TheTts
struct is comprehensive.The struct includes necessary fields for text-to-speech functionalities and metadata.
276-279
: LGTM! TheModelRequest
struct is simple and effective.This struct is well-suited for handling model requests with the option to include outdated models.
393-397
: LGTM! TheModelsResult
struct is well-designed.The struct effectively encapsulates lists of STT and TTS models.
399-408
: LGTM! TheModelResult
struct is comprehensive and detailed.This struct includes all necessary fields to represent a model and its metadata.
9490990
to
f8d9e91
Compare
f8d9e91
to
5700744
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- README.md (1 hunks)
- examples/manage/models/main.go (1 hunks)
- pkg/api/manage/v1/interfaces/types.go (3 hunks)
- pkg/api/manage/v1/models.go (1 hunks)
- pkg/api/version/manage-version.go (1 hunks)
Files skipped from review due to trivial changes (1)
- README.md
Files skipped from review as they are similar to previous changes (2)
- examples/manage/models/main.go
- pkg/api/version/manage-version.go
Additional comments not posted (12)
pkg/api/manage/v1/models.go (6)
22-35
: LGTM!The
ListModels
function correctly wraps theGetModels
function, maintaining simplicity and clarity.
37-71
: Well-implemented function with robust error handling.The
GetModels
function is well-structured, with appropriate logging and error handling. The use ofjson.Marshal
and nil checks ensures reliability.
73-96
: FunctionGetModel
is correctly implemented.The function correctly retrieves a model by ID, with comprehensive logging for debugging purposes.
98-112
: LGTM!The
ListProjectModels
function correctly wraps theGetProjectModels
function, maintaining simplicity and clarity.
114-149
: Well-implemented function with robust error handling.The
GetProjectModels
function is well-structured, with appropriate logging and error handling. The use ofjson.Marshal
and nil checks ensures reliability.
151-175
: FunctionGetProjectModel
is correctly implemented.The function correctly retrieves a model by ID within a project, with comprehensive logging for debugging purposes.
pkg/api/manage/v1/interfaces/types.go (6)
94-105
: TypeStt
is well-defined.The
Stt
struct provides comprehensive fields for speech-to-text functionalities, with appropriate JSON tags.
107-114
: TypeMetadata
is well-defined.The
Metadata
struct provides additional metadata fields for models, with appropriate JSON tags.
116-125
: TypeTts
is well-defined.The
Tts
struct provides comprehensive fields for text-to-speech functionalities, with appropriate JSON tags.
276-279
: TypeModelRequest
is well-defined.The
ModelRequest
struct includes a boolean field for including outdated models, with appropriate JSON and URL tags.
393-397
: TypeModelsResult
is well-defined.The
ModelsResult
struct provides fields for lists of STT and TTS models, with appropriate JSON tags.
399-408
: TypeModelResult
is well-defined.The
ModelResult
struct provides comprehensive fields for a specific model, with appropriate JSON tags.
Proposed changes
This implements the Get Models API. Example can be found at
example/manage/models
.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
Documentation