61 Commits

Author SHA1 Message Date
kagami
ef1c9ef3cb Replace the usage of services functions with IDEService client 2024-02-03 23:43:13 +08:00
bobo
4a3dfc848f Fix assert_value syntax error in generate_commit_message_base_diff function 2024-01-25 18:44:09 +08:00
bobo
340c8cbfa9 Fix error handling in generate_commit_message_base_diff function 2024-01-25 18:41:31 +08:00
kagami
847576f902
Merge pull request #51 from devchat-ai/hotfix/git-staged-deletion-flag-#197
Fix staged file deletion flag display in commit workflow
2024-01-25 17:52:44 +08:00
boob.yang
d0fc2a453e
Merge branch 'main' into hotfix/git-staged-deletion-flag-#197 2024-01-24 21:57:33 +08:00
bobo
9aa9c44934 assert response error 2024-01-24 18:03:45 +08:00
bobo
f0ed2a64ee Fix commit message length limit 2024-01-24 18:01:29 +08:00
bobo
b81624c764 fix: Improve error handling for context overflows
- Refactor error output for token limit issues to ensure clarity
- Update the error handling strategy to unify exception responses
- Remove redundant error handling blocks for streamlining
2024-01-24 17:34:27 +08:00
bobo
380e727e61 chore: Validate content length before sending to LLM
- Add validation for content length before sending to LLM
- Display an error message if the modified content exceeds the model's length limit
- Exit the program if the content length exceeds the limit
2024-01-24 17:34:27 +08:00
bobo
3d3241f282 chore: Correct lint errors
- Refactored language_prompt to handle Chinese characters
- Updated model_token_limit_error message formatting
- Modified function signature for chat_completion_stream
2024-01-24 17:34:27 +08:00
bobo
c805239183 fix: Resolve context overflow commit failure
- Updated commit/command.yml to use "en" language code
- Updated commit/commit.py to handle model's maximum context length error
- Updated commit/zh/command.yml to use "zh" language code
- Updated libs/llm_api/openai.py to ignore tokens limit error

Closes devchat-ai/devchat#189
2024-01-24 17:34:27 +08:00
bobo
af54106813 fix: Ensure lint error fix
- Fixed lint error in commit/commit.py file
- Updated unstaged_files_show assignment for lint compliance
- Updated subprocess.check_output call for lint adherence
2024-01-23 15:47:31 +08:00
bobo
164156bdc0 chore: Add a letter to indicate modification status
- Added a letter before each modified file to indicate the modification status
- Updated the workflow to display file deletion flag in 'Staged' files
- Fixed the issue where staged files did not display the git status
2024-01-23 15:42:58 +08:00
bobo
20a94c78f5 feat: Improve commit warning messages
- Change error message when no files to commit are found
- Update commit aborted message to be more explicit
- Improve user experience by providing helpful warnings
2024-01-23 14:39:26 +08:00
kagami
bca2507c2f Sort and format import blocks 2024-01-05 12:27:57 +08:00
bobo
21217d2bb7 feat: Add customizable button labels to forms and widgets
- Form and TextEditor classes now accept submit_button_name and cancel_button_name
- Widget's chatmark header updated with customizable submit and cancel labels
- Adjusted initialization of Checkbox and Radio classes with button label parameters
2024-01-05 12:01:01 +08:00
bobo
ae1a3bb400 fix: Prevent empty file list in commit prompt
- Ensure the commit prompt correctly handles when no files are staged
- Clean up excessive whitespace in code for readability
- Simplify the creation of the Form object by removing unnecessary newlines
2024-01-04 16:22:08 +08:00
bobo
d496d6b9de fix: Handle empty file selection list more gracefully
- Fix variable naming consistency in get_marked_files
- Ensure selections are stored even when unstaged file list is empty
- Combine staged and unstaged files correctly to avoid errors
2024-01-04 16:18:40 +08:00
bobo
005f1fae7b fix: Handle commit flow for empty file lists
- Omit displaying emptiness for staged and unstaged file sections
- Use conditional checks to append file lists and checkboxes
- Ensure selections are retrieved even if no files are staged/unstaged
2024-01-04 15:12:22 +08:00
bobo
8ac6fb3c6a fix: Update print statements in commit.py
- Update print statements for Step 1/2 and Step 2/2 in commit.py
- Modify the formatting for better readability in the code
- Ensure consistent use of escape characters for line breaks
2024-01-04 11:03:17 +08:00
bobo
36fc46212a refactor: Improve user experience and streamline commit workflow
- Simplify and clarify user prompts and output messages
- Remove unnecessary print statements and text
- Handle commit abort and errors more gracefully
- Improve error logging in OpenAI chat stream handler
2024-01-04 10:59:46 +08:00
bobo
f5b430e712 chore: Add function to extract markdown block
- Added function to extract the first Markdown code block from the given text
- Updated the get_current_branch function to include the current repo branch name in the user input
- Enhanced the commit message generation process by extracting the markdown block content
2024-01-03 15:38:46 +08:00
bobo
5d1ddda356 chore: Update commit message 2024-01-03 11:26:04 +08:00
bobo
d4e262dfd9 chore: Update commit message content 2024-01-03 11:20:56 +08:00
bobo
2ec603a944 feat: Update prompt_commit_message_by_diff_user_input_llm_config
- Updated the prompt_commit_message_by_diff_user_input_llm_config to use the "gpt-3.5-turbo-1106" model
- Refactored the print statement in the display_commit_message_and_commit function for better readability
2024-01-03 11:14:56 +08:00
bobo
98233481df chore: Update llm_api in commit.py
- Updated llm_api import to chat_completion_stream
- Updated llm_api config with environment variable
- Improved user prompt for file selection
- Revised user message for commit editing
- Enhanced user guidance in main function
2024-01-03 11:10:35 +08:00
bobo
b5ad6f25ea chore: Update Python script imports
- Updated import from `chat_completion_no_stream` to `chat_completion_stream`
- Updated requirements file name from `requirements.txt` to `requirements-test.txt`
- Renamed requirements file in `run.sh` from `requirements.txt` to `requirements-test.txt`
2024-01-03 11:10:00 +08:00
bobo
8b6767dc7d chore: Update commit message description
- Update commit message description to provide guidance on writing a well-formatted commit message for selected code changes and committing them via Git. Include an issue number if desired (e.g., input "/commit to close #12").
- Update commit message description in Chinese to provide guidance on generating a well-formatted submission message for the selected code changes and committing them via Git. If necessary, it can include the corresponding issue number (e.g., input "/commit to close #12").
2024-01-03 11:06:20 +08:00
bobo
446f80ebad type: refactor: Clean up import and improve readability
- Remove unused List import from typing module
- Reformat Checkbox and Form instantiation for clearer code structure
- Enhance step description in the commit process output
2024-01-02 22:17:05 +08:00
bobo
590b744dc9 type: refactor: Rework file selection and commit prompt UI
- Replace ui_utils with chatmark module for better UX in file selection
- Implement TextEditor class to handle commit message editing
- Switch from ui_checkbox_select to Checkbox and Form classes for file staging
2024-01-02 22:14:03 +08:00
bobo
74b933eecc type: feat: Add new script for test environment setup
- Add run.sh to configure and run test environment
- Ensure Node.js and Python 3 are installed before proceeding
- Install JavaScript and Python dependencies and run test cases
2024-01-02 21:37:02 +08:00
bobo
93178e521e type: style: Improve code readability
- Add blank lines for better code separation
- Consolidate header dict in requests.get call
- Remove unnecessary blank lines for consistency
2024-01-02 21:37:02 +08:00
bobo
51aa71a0cb fix: Remove placeholder from commit message content
- Remove the 'Closes #IssueNumber' placeholder in the commit message
- Ensure commit messages are generated without closing reference by default
- Implement code to strip the specific placeholder text
2024-01-02 21:37:02 +08:00
bobo
6af7ff68cc add commit prompt tests 2024-01-02 21:37:02 +08:00
bobo
86d087dd12 refactor: Improve readability and syntax in codebase
- Reformatted multiline strings for clarity in commit.py
- Applied consistent quotation marks for string literals in commit.py
- Introduced newlines between rpc_call decorator functions in services.py
2024-01-02 21:37:02 +08:00
bobo
ea809d8ac1 docs: Add docstring for read_prompt_from_file function
- Enhance read_prompt_from_file with a detailed docstring
- Specify parameters, return type, and possible raised exceptions
- Improve function's usability and maintainability with clear documentation
2024-01-02 21:37:02 +08:00
bobo
5891e22194 refactor: Update model configuration for diff prompt
- Change LLM model in commit prompt script from gpt-3.5-turbo to gpt-4
2024-01-02 21:37:02 +08:00
bobo
ce6fcddd82 feat: Added commit message prompt
- Added a new file `diffCommitMessagePrompt.txt` that provides guidelines for creating commit messages based on the provided diff.
- The guidelines include the structure of the commit message, summary of changes, and optional closing reference.
- The commit message should adhere to best practices, such as keeping the title under 50 characters and each summary line under 72 characters.
2024-01-02 21:37:02 +08:00
bobo
68b4258660 feat: Update commit.py to read prompt from file
- Removed unused imports and updated file reading functionality
- Set prompt from the diffCommitMessagePrompt.txt file
- Added error handling for file not found and reading exceptions
2024-01-02 21:37:02 +08:00
bobo
6de24f0d06 refactor: Refactor code to remove unused functions
- Removed unused functions `gpt_file_summary`, `gpt_file_group`, `get_file_summaries`, `get_file_summaries_and_groups`, `get_marked_files`, `generate_commit_message_base_file_summaries`
- Updated function `get_marked_files` to accept only `modified_files` and `staged_files`
- Updated function `generate_commit_message_base_diff` to provide a more descriptive start message for the commit workflow
2024-01-02 21:37:02 +08:00
bobo
960a8b9494 feat: Add progress indicators to commit script
- Implemented step-wise progress indicators in commit.py
- Enhanced user feedback during file modifications
- Improved commit message generation with feedback loops
2024-01-02 21:37:02 +08:00
bobo.yang
14dc3b2b52 Fix formatting in ask-code.py and commit.py 2023-12-27 15:42:51 +08:00
bobo.yang
8cf2208a7b Add decode_path function to handle encoded paths 2023-12-27 15:02:07 +08:00
bobo.yang
ce8091fd9e add limit to diff lenght 2023-12-27 14:41:05 +08:00
bobo.yang
868628ec6e Remove unnecessary progress message 2023-12-21 10:25:28 +08:00
bobo.yang
0336bca3b1 Add log_info function to ide_services.services.py 2023-12-20 21:13:05 +08:00
bobo.yang
ba647b967b Fix file path normalization in commit.py and handle API errors in openai.py 2023-12-20 19:14:36 +08:00
bobo.yang
bf0c67d526 Add flake8 ignore for import order 2023-12-20 14:47:20 +08:00
bobo.yang
f955f81a84 refactor: Update import paths in commit module
- Imported additional necessary modules for functionality
- Modified path handling to enhance module compatibility
- Adjusted imports for clarity and maintenance
2023-12-20 14:33:51 +08:00
bobo.yang
98d5b93594 Fix return statement in get_file_summaries function 2023-12-20 13:26:06 +08:00