1048 Commits

Author SHA1 Message Date
Rankin Zheng
9ea7edab61
Merge pull request #327 from devchat-ai/fix_regeneration_message
Remove line popping items from messages array in ChatStore
2023-10-18 15:47:34 +08:00
Rankin Zheng
3ee87fd061 Remove line popping items from messages array in ChatStore
- Removed the self.messages.pop() call in the process of sending a 'regeneration' command.
2023-10-18 15:44:22 +08:00
bobo.yang
9e55dcbfa5 update default llm model 2023-10-18 11:56:39 +08:00
boob.yang
950a5f817d
Merge pull request #326 from devchat-ai/update_devchat_ask_version2
update devchat-ask version to 0.1.3
2023-10-14 07:21:51 +08:00
bobo.yang
3adf655540 update devchat-ask version to 0.1.3 2023-10-14 07:19:50 +08:00
boob.yang
6dfc208cf6
Merge pull request #325 from devchat-ai/check_devchat_ask_command
Check devchat ask command
2023-10-12 21:24:27 +08:00
bobo.yang
18e58c53ae remove ask-code icon from status bar 2023-10-12 21:17:41 +08:00
Rankin Zheng
6ea2f00258 Update RegenerationButton and StopButton styles
- Update the background color to "#ED6A45"
- Update the font family and font size
- Update the button and icon colors to "#fff"
- Add hover and focus styles
2023-10-12 20:49:59 +08:00
Rankin Zheng
db5dc53dc6 Update ChatStore to remove unnecessary lines
- Remove lines disabling the chat and clearing the error message in the devchatAsk function.
2023-10-12 18:53:00 +08:00
Rankin Zheng
7b670ba96f Update MessageList and MessageMarkdown components
- In MessageList component, update the description text to include the cost per question in bold.
- In MessageMarkdown component, update the explanation text for '/ask-code' command.
- Add sample questions for reference in the MessageMarkdown component.
2023-10-12 18:51:09 +08:00
bobo.yang
82307f74e9 don't show error while stop ask-code command 2023-10-12 18:16:32 +08:00
Rankin Zheng
062fd44c13 Disable input and buttons when chat is generating or disabled
- Disable input field and buttons when chat is in the generating state or
  disabled state.
- Add a 'disabled' property to the ChatStore model to keep track of the
  disabled state.
- Set the disabled state to true before starting the devchatAsk flow and
  set it back to false after the flow completes.
- Update cancelDevchatAsk function to also set the disabled state back to
  false.
- Set the disabled state to true before sending a common message and set
  it back to false after sending the message.
2023-10-12 18:07:14 +08:00
Rankin Zheng
bb3a964ad3 Update message text in MessageList component
- Update the text to reflect that GPT-4 usage is required instead of
  mentioning /ask-code.
- Provide clearer information about the cost and analysis of up to
  ten source files.
2023-10-12 17:53:14 +08:00
Rankin Zheng
85191d8051 Refactor devchatAsk function and add isDevChatInstalled check
- Refactor the devchatAsk function to use MobX flow and handle message
  creation differently.
- Add an isDevChatInstalled check before pushing bot messages to decide
  whether to display an install prompt or not.
2023-10-12 17:47:33 +08:00
bobo.yang
bbe29996b6 don't install devchat-ask in ask-code command 2023-10-12 10:00:09 +08:00
boob.yang
95dc3eb8d7
Merge pull request #324 from devchat-ai/update_devchat_ask_version
update devchat-ask version
2023-10-12 08:54:33 +08:00
bobo.yang
17003cbc3c fix style error 2023-10-12 08:52:33 +08:00
bobo.yang
64bc3b7a26 update devchat-ask version 2023-10-12 08:45:57 +08:00
boob.yang
31d9dd1a9a
Merge pull request #322 from devchat-ai/workflow-message-step
Workflow message step
2023-10-12 00:18:24 +08:00
bobo.yang
b0dcd1b32a add pre-release flag 2023-10-12 00:13:17 +08:00
bobo.yang
ce25ef98a9 update topic after ask-code response 2023-10-11 23:51:58 +08:00
bobo.yang
9964a1891e fix timestampt while insert log 2023-10-11 23:51:58 +08:00
bobo.yang
3ede604e4e update devchat version 2023-10-11 23:51:57 +08:00
Rankin Zheng
b00da5eec5 Update commandManager.ts and MessageList/index.tsx
- Update the description for the 'ask-code' command in commandManager.ts
- Update the text in MessageList/index.tsx to promote the '/ask-code' command and provide additional information about the AI agent and pricing
2023-10-11 23:51:57 +08:00
Rankin Zheng
d74757b544 Refactor MessageList component
- Add a condition to render the 'Card' component only when 'confirm' is true.
- This change ensures that the 'Card' component is only displayed for bot messages when the 'confirm' prop is true.
2023-10-11 23:51:57 +08:00
bobo.yang
c9f01f7373 Insert ask-code result to devchat 2023-10-11 23:51:57 +08:00
Rankin Zheng
c51c8189d0 Refactor MessageList component
- Updated the styles in the MessageList component including the button font family and font size.
- Modified the Card component to always be displayed for 'bot' messages.
- Updated the text description of the cost range to approximately $0.1 - $0.5.
- Modified the size and color of the buttons for user interaction.
2023-10-11 23:51:57 +08:00
Rankin Zheng
96b811fc3f Update cost range in MessageList component
- Updated the cost range displayed in the MessageList component from approximately $1.2 - $2.2 to approximately $0.1 - $0.5.
2023-10-11 23:51:57 +08:00
Rankin Zheng
6c07272bf2 Update bot message in ChatStore.ts
- Updated the message in the ChatStore.ts file to improve clarity and provide assistance to the user.
2023-10-11 23:51:57 +08:00
Rankin Zheng
386ab58631 Update MessageList component
- Add conditional rendering for confirm button based on 'confirm' prop value
- Update onClick event handlers for 'Yes' and 'No' buttons to call appropriate functions
2023-10-11 23:51:57 +08:00
Rankin Zheng
7c8da398ae Refactor message generation and handling in CurrentMessage and InputMessage components
- Remove the useEffect hook in CurrentMessage that creates a bot message when `generating` is true. This logic is now handled elsewhere.
- Update the onSubmit handler in InputMessage to distinguish between different types of user input and call the appropriate methods in the ChatStore.
- Add the `startGenerating`, `commonMessage`, `goScrollBottom`, `sendLastUserMessage`, `cancelDevchatAsk` methods to the ChatStore to handle message generation and display.
- Extract the `contextInfo` function to convert chat contexts to the required format for sending to the extension.
2023-10-11 23:51:57 +08:00
Rankin Zheng
230f7cc872 Add confirm property to Message model and devchatAsk method
- Add a `confirm` property to the `Message` model in the `ChatStore.ts` file.
- Add a `devchatAsk` method to create a user message followed by a bot message with the `confirm` property set to `true`.
2023-10-11 23:51:57 +08:00
Rankin Zheng
d509382538 Refactor MessageMarkdown, MessageBody, CurrentMessage, and MessageList components
MessageMarkdown:
- Removed unused imports.
- Modified useEffect() to analyze steps using mdast-util-from-markdown instead of splitting children directly.
- Modified code component to set the 'index' property based on the order of 'code' nodes in the tree.

MessageBody:
- Removed the messageText prop and replaced it with children prop to allow more flexibility in passing content.
- Updated the usage of MessageMarkdown to pass the temp prop as needed.

CurrentMessage:
- Removed unused import for 'mdast'.
- Modified marginTop value to always be '1em' instead of conditionally set based on chat.responsed.

MessageList:
- Updated the usage of MessageBody to pass the messageText as children prop.

MessageMarkdown:
- Updated the code component to determine the 'done' prop based on the index and the presence of 'code' nodes.

Note: The changes in the components involve refactoring and improving the code structure and functionality.
2023-10-11 23:51:57 +08:00
Rankin Zheng
46e3e1edfc Add mdast-related dependencies and update code to use mdast
- Update package.json to include mdast dependencies
- Import necessary functions and types from mdast-util
- Update logic to use mdast functions and types
- Update rendering logic to work with new mdast structure
2023-10-11 23:51:57 +08:00
Rankin Zheng
b214ddfc71 Refactor Step component in MessageMarkdown
- Removed unnecessary empty fragment tags (<></>) surrounding the Accordion component.
- Updated the return statement to directly return the Accordion component.
- Removed unnecessary closing tag (</>) at the end of the return statement.
- Removed unused imports.
2023-10-11 23:51:57 +08:00
Rankin Zheng
962f8ca161 Refactor query function in askcode_index_query.py
- Updated the query function in askcode_index_query.py to include additional parameters for controlling the DFS algorithm.
- Changed the verbose parameter to False in the call to smart_qa.run() to reduce console output.
2023-10-11 23:51:57 +08:00
bobo.yang
822ea8f18a support stop while ask-code 2023-10-11 23:51:57 +08:00
bobo.yang
0886826da7 call smartqa 2023-10-11 23:51:57 +08:00
Rankin Zheng
cb2ea1deb6 Add step component for tutorial content
- Split markdown content by ```step blocks
- Pass step content to Step component
- Step component handles collapsing and highlighting
- Support Step and step case insensitive
- Extract first line starting with # as step title
- Use last line with # Done to show step completed
2023-10-11 23:51:57 +08:00
Rankin Zheng
b35ee9ef8c Display check icon for completed step
- Check if last line is '# Done' to determine step completion
- Extract step contents, omitting first and last line
- Show check icon if step is completed, else show loader
- Remove closed prop which is no longer needed
2023-10-11 23:51:57 +08:00
Rankin Zheng
960b0294bc Add collapsible section for each step
- Add Accordion component from Mantine to wrap each step content
- Extract first line starting with '#' as section title
- Show chevron icon when section is collapsed
- Show check icon when code block is expanded
- Style Accordion to match VSCode theme
- Remove original toggle button and collapse component
2023-10-11 23:51:57 +08:00
Rankin Zheng
3afd42c9d6 Add collapsible code step component
- Create Step component to wrap code snippets in collapsible box
- Render Step instead of default code block for 'step' language
- Pass code snippet as children prop to Step
- Step renders language tag and toggle button
2023-10-11 23:51:57 +08:00
Rankin Zheng
950a1328a0 Add language tag component
- Create LanguageCorner component to display language tag
- Update MessageMarkdown to render LanguageCorner
- Pass language prop from Message to LanguageCorner
2023-10-11 23:51:57 +08:00
bobo.yang
e6d5e410fc remove pre-release flag 2023-10-11 23:51:57 +08:00
boob.yang
29c092c1b6
Merge pull request #323 from devchat-ai/code_llama_support
Code llama support
2023-10-11 23:50:56 +08:00
bobo.yang
a9500ba30f handle code block without language flag 2023-10-11 12:43:12 +08:00
bobo.yang
b4e3f24fdb support code llama model 2023-10-09 08:42:55 +08:00
bobo.yang
f0abddb55c ignore settings.json 2023-10-09 08:42:55 +08:00
bobo.yang
d26a446547 support code llama model and starcoder model 2023-10-09 08:42:55 +08:00
boob.yang
727d534458
Merge pull request #321 from devchat-ai/fix_key_not_found_issue
Fix key not found issue
2023-10-09 08:14:33 +08:00