184 Commits

Author SHA1 Message Date
bobo.yang
8ceb8308d9 Add updateSetting handler to loadHandlers
- Imported updateSetting from './updateConfig' in loadHandlers.ts.
- Registered updateSetting in messageHandler.
- Created a new file updateConfig.ts to handle the updateSetting function.
- The updateSetting function updates the configuration based on the provided keys and value.
2023-08-23 22:12:17 +08:00
Rankin Zheng
bf459d0efa Add API key setting buttons and handle their actions
- Added buttons for setting OpenAI and DevChat keys in apiKeyMissedMessage function in historyMessagesBase.ts.
- Updated handleButton function in MessageMarkdown component to handle the new buttons' actions.
- Cleaned up formatting and removed unused code in historyMessagesBase.ts.
2023-08-22 17:41:24 +08:00
bobo.yang
b837365427 Add PythonVirtualEnv configuration and improve error handling
- Added PythonVirtualEnv configuration to customAction.ts.
- Improved error handling in doCommand.ts by using logger instead of console.error.
- Updated sendMessage.ts to handle askCode command and improved error handling.
- Added environment variables for OPENAI_API_KEY and OPENAI_API_BASE in commonUtil.ts.
- Created new action 'query_data' in _setting_.json and its handler in handler.py.
2023-08-21 11:52:00 +08:00
bobo.yang
df679ea613 Implement function to execute VSCode commands
- Added a new function 'doCommand' in 'doCommand.ts' to execute VSCode commands.
- The function takes a message and a panel as arguments, and uses the 'executeCommand' method from the 'vscode' module.
- Updated 'commandManager.ts' to return an empty string instead of undefined.
- Registered the new 'doCommand' handler in 'loadHandlers.ts'.
2023-08-21 11:52:00 +08:00
bobo.yang
1f7bd4ac03 Implemented AskCode Indexing Commands
- Added new functions to register AskCode Index start and stop commands in commands.ts.
- Implemented functions to install AskCode and index code.
- Added function to get configuration settings for Python virtual environment and supported file types.
- Updated sendMessage.ts to handle 'askCode' command and execute AskCode query.
2023-08-21 11:52:00 +08:00
bobo.yang
fd011ee265 Added AskCode functionality to DevChat
- Added new settings for Python virtual environment and supported file types in package.json.
- Added new commands for starting and stopping AskCode Index in package.json.
- Registered new 'ask-code' command in CommandManager.
- Registered AskCode Index start and stop commands in extension.ts.
- Added 'askCode' handler in loadHandlers.ts and messageHandler.ts.
- Updated messageHandler to check for '/ask-code' in message text and call 'askCode' command.
2023-08-21 11:52:00 +08:00
bobo.yang
1f5cf7ebbe Clear contextInfo in sendMessage
- Modified the sendMessage function in the sendMessage.ts file.
- Added code to clear the message.contextInfo property before sending the message.
2023-08-21 08:31:52 +08:00
bobo.yang
e2e761fd16 Separate handling for OpenAI and DevChat API keys
- Renamed and split the API key settings in package.json into DevChat and OpenAI specific keys.
- Updated the commands for setting API keys to handle OpenAI and DevChat keys separately.
- Modified the ApiKeyManager to handle and validate OpenAI and DevChat keys separately.
- Updated the status bar view to use the DevChat access key command.
- Adjusted the tests to reflect the new handling of API keys.
2023-08-03 15:09:34 +08:00
bobo.yang
63fa9b1bd2 Add tracking and deletion of temporary files in sendMessage function
- Added a new array `tempFiles` to store the names of temporary files created during the execution of the `sendMessage` function.
- When a new temporary file is created, its name is added to the `tempFiles` array.
- After the message is sent, the function iterates over the `tempFiles` array and deletes each file.
- This ensures that only the temporary files created during the execution of the function are deleted.
2023-07-27 12:47:56 +08:00
bobo.yang
716895045a Add temporary file handling for contextInfo in sendMessage
- Added createTempFile and deleteTempFiles functions in sendMessage.ts.
- Modified sendMessage function to handle contextInfo field in the message.
- If the file name is not present in the context, a temporary file is created.
- The file name is inserted into the text field of the message.
- All temporary files created are deleted after the message is sent.
- Modified handleSendClick function in InputMessage.tsx to process and send the message to the extension.
- Modified startGenerating reducer in chatSlice.ts to send the message with contextInfo.
2023-07-27 08:11:40 +08:00
bobo.yang
45e4af7efd Update DevChat version and refactor log handling
- Updated expected DevChat version to 0.2.0.
- Refactored log handling to accommodate changes in DevChat's log structure.
- Added TopicEntry interface to handle new topic entries from DevChat.
- Updated topics function to return TopicEntry array.
- Adjusted topic creation to use new TopicEntry structure.
2023-07-24 08:20:26 +08:00
bobo.yang
e6c7d4c73b Fix variable naming inconsistency
- Corrected the variable name from 'WaitCreateTopic' to 'waitCreateTopic' for consistency.
2023-07-24 08:18:48 +08:00
bobo.yang
4daca83d6b Refactor action application and error handling
- Refactored applyAction to include parentHash in the message.
- Simplified codeFileApply function by removing redundant error handling.
- Enhanced error handling in MessageHandler to include parentHash.
- Added condition to regenerate message only if autox is true.
2023-07-24 08:17:58 +08:00
bobo.yang
dbdf67d19f Implement auto execution of commands in MessageHandler
- Added a global variable 'autox' to control automatic execution of commands.
- Updated the 'sendMessage' function to handle '/autox' in the message text.
- If 'autox' is true and the message contains a command, the command is automatically executed.
- This feature will help in automating tasks and improving efficiency.
2023-07-24 00:11:56 +08:00
bobo.yang
035952e688 Remove function_call handling from sendMessageBase.ts
- Removed the specific handling for chatResponse.finish_reason === "function_call" in handlerResponseText and sendMessageBase functions.
- This specific handling was unnecessary and was causing confusion.
2023-07-24 00:11:56 +08:00
bobo.yang
cda646f830 Support GPT-4-0613 function calls 2023-07-24 00:11:56 +08:00
bobo.yang
3462248cb8 update unit test 2023-07-24 00:11:56 +08:00
bobo.yang
1a75347bd1 Refactor variable names and improve condition checks
- Rename WaitCreateTopic to waitCreateTopic for consistency.
- Update condition check to use parsedMessage.instruction.
2023-07-24 00:11:56 +08:00
bobo.yang
78d1db75f5 Improve applyAction function and add error handling
- Add compressText function to truncate long text.
- Wrap applyAction in try-catch block for error handling.
- Send error message to devchat if codeBlock type is 'command'.
2023-07-24 00:11:56 +08:00
bobo.yang
77493db13f Add symbol references and definitions contexts
- Created two new contexts for symbol references and definitions.
- Updated the handler in ChatContext interface to return an array of strings.
- Updated the processText method in ChatContextManager to return an array of strings.
- Registered the new contexts in loadContexts.ts.
- Updated the addContext function to handle multiple context strings.
2023-07-24 00:11:56 +08:00
bobo.yang
c1b8ee2f88 Update message deletion and topic management
- Added a check in deleteChatMessageBase to remove the message from the current topic if deletion is successful.
- Modified updateFirstMessageHashAndName in Topic class to accept undefined values.
- Added a new method deleteMessage in TopicManager to update the topic when a message is deleted.
2023-07-21 17:17:43 +08:00
bobo.yang
0ceab66eb6 Fix deleteChatMessage functionality
- Changed the deleteChatMessageBase function call to be awaited.
- Adjusted the condition to send a 'deletedChatMessage' command only when the message is successfully deleted.
2023-07-18 22:54:08 +08:00
bobo.yang
3819d7679c Refactor parent hash handling in sendMessageBase.ts
- Replaced the getParentHash function with direct access to message.parent_hash.
- Updated the handleTopic function to accept undefined parentHash.
- This simplifies the code and makes the parent hash handling more straightforward.
2023-07-17 20:31:01 +08:00
bobo.yang
1957ddd280 Add delete chat message functionality
- Removed 'Cancel' option from topicDeleteCallback in commands.ts.
- Imported deleteChatMessage in loadHandlers.ts and registered it as a handler.
- Added deleteChatMessage function in sendMessage.ts to prompt user for confirmation before deleting a message.
- Added deleteChatMessageBase function in sendMessageBase.ts to delete a message from messageHistory and by devchat.
- Added delete function in devchat.ts to delete a message by hash.
- Added delete function in messageHistory.ts to remove a message from history by hash.
2023-07-17 18:56:56 +08:00
bobo.yang
1feb9ddd9a Refactor historyMessagesBase to accept topicId as parameter
- Modify loadTopicHistoryLogs to accept topicId as a parameter.
- Update updateCurrentMessageHistory to accept topicId as a parameter.
- Pass topicId to loadTopicHistoryLogs and updateCurrentMessageHistory in historyMessagesBase.
- Add a check for topicId change before updating message history.
2023-06-15 21:00:01 +08:00
bobo.yang
3fc21b920e update log text 2023-06-13 10:45:11 +08:00
bobo.yang
01c2fc545b let userStop to false before sendMessage 2023-06-09 12:09:18 +08:00
bobo.yang
f510d1de62 Explicitly define array types in sendMessageBase.ts
- Change contextPaths, instructionPaths, and referencePaths to explicitly define string[] type.
2023-06-09 10:45:17 +08:00
bobo.yang
3b35a8e03c Update historyMessagesBase.ts to use firstMessageHash
- Added check for topic existence and firstMessageHash.
- Replaced topicId with topic.firstMessageHash in logOptions.
2023-06-07 21:58:33 +08:00
bobo.yang
3ec578c7be load topic from DevChat 2023-06-06 17:52:31 +08:00
bobo.yang
568c7d1255 Refactor handlerResponseText condition check
- Remove unnecessary empty string check in sendMessageBase.ts.
- Simplify condition to only check for chatResponse.isError.
2023-06-06 11:14:36 +08:00
bobo.yang
af3038dbd1 Add parseDateStringToTimestamp function
- Update sendMessageBase.ts with the new function.
- Replace Date.parse with parseDateStringToTimestamp.
- Fix string comparison with strict equality.
2023-06-06 10:51:38 +08:00
bobo.yang
06afafb937 Fix message header assignment condition
- Changed condition in parseMessageAndSetOptions function.
- Now correctly assigns chatOptions.header based on message.text.
2023-06-05 11:37:14 +08:00
bobo.yang
9546cfb7ba Add wait flag for topic creation and update UI
- Added WaitCreateTopic flag to prevent UI updates during topic creation.
- Updated DevChatViewProvider to check for WaitCreateTopic flag.
- Added onSelectChanged method in TopicTreeDataProvider.
- Enabled setCurrentTopic in TopicManager.
2023-06-05 11:36:45 +08:00
bobo.yang
3c63fb4c61 Fix history message repeat 2023-06-05 11:25:04 +08:00
bobo.yang
2aca2d3db5 don't append partial response before error 2023-06-05 09:17:58 +08:00
bobo.yang
f91abd1002 fix log miss in history messages 2023-06-02 14:07:20 +08:00
bobo.yang
1c6e002373 Add args property to Command interface and update regCommandList
- Added args property to Command interface in commandManager.ts and customCommand.ts.
- Updated regCommandList handler to convert command patterns with args.
- Replaced {{prompt}} with an array of empty strings based on the args count.
2023-06-02 13:45:12 +08:00
boob.yang
5c4e13d6ac
Merge pull request #141 from covespace/devchat_extension
Devchat extension
2023-06-02 12:55:41 +08:00
bobo.yang
cd6c091d68 Refactor historyMessages and historyMessagesBase
- Updated historyMessages to handle pagination with skip and maxCount.
- Exported LoadHistoryMessages interface from historyMessagesBase.
- Added setTopic and getTopic methods to messageHistory class.
- Implemented loadTopicHistoryFromCurrentMessageHistory function.
2023-06-02 11:15:04 +08:00
bobo.yang
3c5e44273a Implement ActionManager and CustomActions classes
- Added ActionManager class to manage and apply actions.
- Implemented CustomActions class to parse and handle custom actions.
- Created applyAction and regActionList handlers for action execution and registration.
2023-06-02 09:58:44 +08:00
bobo.yang
cbd3b8fc77 Update unspecified changes
- This commit message is a placeholder for unspecified changes.
- Please provide more context or specific changes to create a more accurate commit message.
2023-06-02 09:58:44 +08:00
bobo.yang
c46d29bf20 Improve history message handling and topic view
- Add check for current topic change during history load.
- Return undefined if no log entries found.
- Add check/uncheck icons for topic view items.
- Update TopicTreeDataProvider to handle item selection.
2023-05-31 16:10:53 +08:00
bobo.yang
ba097eab26 add unit tests for src 2023-05-31 16:10:53 +08:00
bobo.yang
7a72ebcabe append error to response text 2023-05-31 16:10:53 +08:00
bobo.yang
82faf14eb6 Separate VSCode from core logic for ISSUE #125
- Extract VSCode-related code from core logic.
- Improve modularity for easier unit testing.
2023-05-31 16:10:53 +08:00
bobo.yang
562a125902 handle vscode 2023-05-31 16:10:53 +08:00
bobo.yang
c2feaccc58 Improve handling of partial chat responses and topic creation
- Store partial chat response data in a separate variable.
- Concatenate partial data with responseText when chatResponse.isError is true.
- Comment out setCurrentTopic call in topicManager.ts.
2023-05-29 08:51:53 +08:00
bobo.yang
15230c80a3 Refactor messageHandler to check OpenAI API key
- Import checkOpenaiApiKey function from contributes/commands.
- Update sendMessage condition to include checkOpenaiApiKey.
2023-05-28 13:12:05 +08:00
Jinglei Ren
50b8ae8185 Unify naming convension ('openai'/'Openai', no 'openAi'/'openAI') 2023-05-28 08:32:12 +08:00