PR-1014-Interactive config.yaml creation during model upload process #843
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.
Why
How
CLI User Interaction Enhancements:
Added new helper functions to
clarifai/utils/cli.pyfor prompting required,optional,integer, and yes/no fields, as well as for printing formatted sections and field help in the CLI. These functions improve the user experience when interactively creating model configurations duringclarifai model uploadprocess andconfig.yamlwas not present in the upload folder.This change also prompts user to select
clarifai contextduring upload process, effectively allows user to switch between different contexts.Constants Update:
CONFIG_GUIDE_URL,CLI_LOGIN_DOC_URL) inclarifai/utils/constants.pyto provide users with helpful links during CLI interactions.Type Hinting:
clarifai/utils/cli.pyto useOptionalfor improved clarity and type safety.Tests
Testing Improvements:
tests/cli/test_model_cli.pyto verify the creation ofconfig.yamlvia CLI prompts and to ensure file operations use UTF-8 encoding.Notes