fix: model-catalog field mapping and legacy flags, global-option placement, and whoami source label - #108
Open
darrenapfel wants to merge 3 commits into
Open
fix: model-catalog field mapping and legacy flags, global-option placement, and whoami source label#108darrenapfel wants to merge 3 commits into
darrenapfel wants to merge 3 commits into
Conversation
…nalai, and warn loudly on an empty catalog half The catalog rendered every row with an empty ID and empty language column because the SDK's generated response classes rename the API's uuid field to uuid_ and report languages as a list, while the command read uuid and language. The canonical_name and architecture fields — canonical_name is the value a request's model parameter takes — were dropped entirely. The legacy conversationalai / 2-conversationalai entries are now flagged deprecated with a note steering to nova-3 and stating plainly that no nova-3-conversational model exists (paying accounts have requested that nonexistent composition). A category that comes back empty (zero speech-to-text or zero text-to-speech models) now produces a stderr warning instead of silently presenting half a catalog as the whole one, and an explicit null category no longer crashes the command. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… on misplaced globals Click parses group options only before the subcommand name, so 'dg models -o json' failed with "No such option '-o'" while 'dg -o json models' worked — and the error gave no hint that the option exists. Two changes: 1. Every generated command now carries pass-through copies of -o/--output, -q/--quiet and -v/--verbose that apply the same global effect from the subcommand position. A copy is only added when the command does not define the option itself (dg speak --output names an audio file and keeps its own meaning). 2. When a remaining global option (for example --api-key or --timing) is placed after the subcommand, the error now carries a hint naming the working placement. The published exit-code contract (1 = error) is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… pure in json mode Config merges DEEPGRAM_API_KEY into the profile at load time, so whoami's profile check claimed "config file" for a key that actually came from the environment. The label now reports the environment variable when the profile key matches it, which is also the key auth actually uses in that state. whoami also printed its human-readable block unconditionally, corrupting 'dg -o json whoami' for scripts that pipe stdout — the block is now guarded by the default output format, the same pattern the deepgram#97 sweep applied to the other account commands. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change was built by a coding agent working from a developer-experience review, and was validated as described at the end. It contains three independent fixes; they are separate commits and can be reviewed or split independently.
1. The models catalog rendered empty IDs and languages, dropped the canonical name, and presented legacy models without warning.
dg modelsread the API'suuidandlanguagefields, but the Deepgram Python software development kit renamesuuidtouuid_in its generated response classes, and the API reportslanguagesas a list — so every row displayed a blank ID and a blank language. The command also droppedcanonical_name, which is the exact value a request'smodelparameter takes (the catalog showed "agathe" but a request needs "aura-2-agathe-fr"). This change reads both field spellings, joins the language list, and adds canonical name and architecture to the table and the JSON output.Two related additions:
conversationalaiand2-conversationalaiare now flagged deprecated, with a note steering users tonova-3and stating that no model namednova-3-conversationalexists. Support data shows paying customers composing that nonexistent name; the legacy entry in the catalog is the plausible source of the composition. The API sends no deprecation field, so the flag is a small map inside the command — if the platform later adds deprecation metadata toGET /v1/models, the map should be replaced by it.2. Global output options silently failed after the subcommand.
dg models -o jsonfailed with "No such option '-o'" whiledg -o json modelsworked, because the parser reads group-level options only before the subcommand name. Every generated command now carries pass-through copies of-o/--output,-q/--quiet, and-v/--verbosethat apply the same effect from the subcommand position. A copy is added only when the command does not define that option itself —dg speak --outputnames an audio file and keeps its own meaning. For the global options that cannot safely pass through (--api-key,--profile,--timing, and the rest), the error now includes a hint naming the working placement. The published exit-code contract (1 = error, 2 = user interrupt) is unchanged and remains covered by the existing tests.3.
whoamilabeled an environment-sourced key "config file", and corrupted JSON output.The configuration loader copies DEEPGRAM_API_KEY into the active profile at load time, so
whoamisaw a profile key and reported "config file" for a key that came from the environment. The label now reports "DEEPGRAM_API_KEY (env)" when the profile key matches the environment value — which is also the key the authentication path actually uses in that state. Separately,whoamiprinted its human-readable block even in JSON output mode, breakingdg -o json whoamifor scripts; the block is now guarded by the default output format, the same pattern pull request #97 applied to the other account commands.Validation. The full test suite passes (1,109 passed, 6 skipped; the one failure, a file-timestamp test in deepctl-shared-utils, fails identically on unmodified main). Seventeen new unit tests cover the field mapping, the deprecation flags, the empty-category warning, the pass-through options and their collision rule, the placement hint, and the whoami label.
ruff check,ruff format --check, andmypypass on all 115 source files. Every changed behavior was also run live against api.deepgram.com on a test account: the catalog lists 441 speech-to-text and 102 text-to-speech models with IDs, languages, canonical names, and 7 deprecated-flagged entries;dg models -o jsonanddg models -t tts -o jsonparse cleanly;dg speak --helpkeeps its own--output; the misplaced-global hint renders; anddg whoamireports the environment source with clean JSON.🤖 Generated with Claude Code