-
Notifications
You must be signed in to change notification settings - Fork 244
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
Enhanced Configuration and Development Workflow with Poetry, Markdown Prompts, and YAML Config #432
Open
use-the-fork
wants to merge
27
commits into
AbanteAI:main
Choose a base branch
from
use-the-fork:feature/markdown-prompts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Enhanced Configuration and Development Workflow with Poetry, Markdown Prompts, and YAML Config #432
use-the-fork
wants to merge
27
commits into
AbanteAI:main
from
use-the-fork:feature/markdown-prompts
Conversation
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
The dev-requirements.txt and requirements.txt files have been deleted and replaced with a poetry.lock file. This switch to using Poetry for dependency management will simplify dependencies' declaration and lock them for consistent installs across different environments. This update includes moving all previously listed dependencies to the newly generated Poetry lock file.
The setup.py file has been removed as part of this migration, with all necessary information and dependencies now defined in the updated pyproject.toml file. This change enables more modern, standardized Python packaging and dependency management.
The project has been updated to use Poetry for managing dependencies in lieu of pip. This applies to the build, lint, test, benchmark, and release workflows. All pyright, pytest, black, isort, and other tests now run with poetry instead of python and pip commands.
…intenance/poetry-dependency-management
Changed the package manager for installation from pip to poetry in the README file. This update reflects the switch to the more modern package manager, poetry.
The Github workflows for benchmarking, release, and linting/testing have been updated to include a step for installing poetry using pipx. This change ensures that poetry, a necessary dependency for this project, is properly installed during these workflow processes.
This change modifies the run command under the license checking script step of the GitHub Action workflow. Specifically, it alters the way we execute the license_check.py script, using 'poetry run python' instead of 'poetry run' alone.
The benchmark script has been updated to use 'poetry run' for executing pytest. This change ensures that pytest runs in the context of the poetry environment, appropriately respecting the project
This commit includes the addition of markdown formatted coding project prompts, as well as updating all file references in the Python files to reflect these changes. It also includes the installation of the "dataclasses-json" dependency. Lastly, the plain text prompt files were moved to a separate directory for better organization.
Updated default prompts for the coding project to a markdown file format and adjusted all related file references. New dependency, "dataclasses-json", was installed to handle potential future data classes with the JSON format. Moved previously existing plain text format prompts to a distinct directory for easier management.
The prompt type for each parser has been moved from hardcoded value within the parser to a centralized configuration through 'mentat.config.py'. This improves maintainability by centralizing configuration. Additionally, the use of 'rich' library has been expanded in 'session.py' and 'code_context.py' to improve readability and color-coding of messages.
…ature/markdown-prompts # Conflicts: # dev-requirements.txt # mentat/code_context.py # mentat/code_feature.py # mentat/config.py # mentat/conversation.py # mentat/feature_filters/llm_feature_filter.py # mentat/include_files.py # mentat/llm_api_handler.py # mentat/session.py # mentat/terminal/client.py # mentat/utils.py # requirements.txt # scripts/run_and_upload_benchmarks.sh
The code has been refactored to use a global configuration object instead of a local one. This change standardizes how the config is accessed across multiple modules and simplifies the code by reducing redundant variable assignments. Along with this, color print formatting has been updated to use the 'rich' module's syntax.
This commit removes 'config' import from 'mentat/session_context.py' and adds it directly in other files where it's used, refactoring relevant lines accordingly. This change cleans up the codebase and makes config usage more immediate and intuitive. Additionally, minor code adjustments were made in several other files for consistency and readability.
The debug function in mentat/utils.py has been replaced with the inspect function from the rich library. The inspect function provides a more detailed view of objects for easy debugging and visualization. The former custom debug function which uses pprint for pretty printing and handles exceptions has been commented out for reference.
Replaced Typer with Click for command line interface of terminal client, added Click to poetry dependencies, and rearranged and removed redundant code in terminal client for better optimization. Also, fixed asynchronous task in the client exit listener. This commit simplifies the command line interface code while enhancing the application's functionality and efficiency.
The rich module has been replaced with termcolor for text coloring and formatting in various Python files. The change improves consistency across the codebase and streamlines the process of sending colored text with the stream.send() function. The changes include updating function and method calls, adjusting import statements, and modifying line color settings.
The path for the configuration file in the Mentat project was updated to use the Git root, rather than the application root. This change also resulted in the removal of unnecessary code that previously loaded and merged the configuration.
The code has been updated to fetch configuration from user_session instead of importing it directly from mentat.config. Several test cases have been altered to reflect this change. The Dumper and Dumper functions in utils have been enhanced for handling possible exceptions. An utility function is added in __init__.py to expose user_session as part of the package's public API.
This commit refactors the way configuration is handled in the application. This includes implementing settings for parsers as well as AI models, and modifying how the configuration is retrieved throughout the app. Mid-session configuration changes are now more consistent and manageable, enhancing overall usability and code readability.
Various changes have been made to improve the readability and maintainability of the code. These changes include reformatting lists and function arguments for better visibility, updating syntax to meet PEP8 standards, and making sure all diffs are correctly formatted.
The main update to 'session.py' involves changing the message content sent via self.stream and altering its color. In 'config.py', the significant addition is a new function 'load_model' that is tasked with checking if a model is known and setting the value of maximum context appropriately. Also, code formatting has been improved in a few places to maintain readability.
The change ensures that the mentat command in the lint and test workflow runs in the correct directory. The previous command was not specifying the directory which may have caused some unexpected behaviors.
Added ability to disable and enable plugins / Commands based on YAML.
Thanks for your interest in the project. Some quick thoughts:
|
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.
Summary:
This pull request introduces significant enhancements to the development workflow and configuration management of our application. Key changes include the integration of Poetry for dependency handling, the introduction of Markdown-based prompts, and a comprehensive overhaul of the configuration system from JSON to YAML.
Key Changes:
Poetry Integration:
Markdown-based Prompts:
Configuration System Overhaul:
User Session Management:
UserSession
object, allowing developers greater flexibility in setting and retrieving values. This object supersedes the traditional context passed to commands.user_session.set
function to prevent accidental overwriting of the context.CLI and Testing Adjustments:
Quality Assurance: