Skip to content

Commit

Permalink
Merge pull request #178 from devchat-ai/clean-up
Browse files Browse the repository at this point in the history
Clean up
  • Loading branch information
pplam authored Jun 20, 2024
2 parents 46995e5 + 4ddbd08 commit 2ae1b49
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 228 deletions.
8 changes: 0 additions & 8 deletions src/main/kotlin/ai/devchat/core/ActionHandlerFactory.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,21 @@ class ActionHandlerFactory {
private val actionHandlerMap: Map<String, KClass<out ActionHandler>> = mapOf(
DevChatActions.SEND_MESSAGE_REQUEST to SendMessageRequestHandler::class,
DevChatActions.REGENERATION_REQUEST to SendMessageRequestHandler::class,
DevChatActions.SET_OR_UPDATE_KEY_REQUEST to SetOrUpdateKeyRequestHandler::class,
DevChatActions.LIST_COMMANDS_REQUEST to ListCommandsRequestHandler::class,
DevChatActions.LOAD_CONVERSATIONS_REQUEST to LoadConversationRequestHandler::class,
DevChatActions.LOAD_HISTORY_MESSAGES_REQUEST to LoadHistoryMessagesRequestHandler::class,
DevChatActions.UPDATE_LANGUAGE_REQUEST to UpdateLanguageRequestHandler::class,
DevChatActions.OPEN_LINK_REQUEST to OpenLinkRequestHandler::class,
DevChatActions.LIST_TOPICS_REQUEST to ListTopicsRequestHandler::class,
DevChatActions.INSERT_CODE_REQUEST to InsertCodeRequestHandler::class,
DevChatActions.NEW_SRC_FILE_REQUEST to NewSrcFile::class,
DevChatActions.REPLACE_FILE_CONTENT_REQUEST to ReplaceFileContentHandler::class,
DevChatActions.VIEW_DIFF_REQUEST to ViewDiffRequestHandler::class,
DevChatActions.LIST_CONTEXTS_REQUEST to ListContextsRequestHandler::class,
DevChatActions.LIST_MODELS_REQUEST to ListModelsRequestHandler::class,
DevChatActions.ADD_CONTEXT_REQUEST to AddContextRequestHandler::class,
DevChatActions.GET_KEY_REQUEST to GetKeyRequestHandler::class,
DevChatActions.COMMIT_CODE_REQUEST to CommitCodeRequestHandler::class,
DevChatActions.GET_IDE_SERVICE_PORT_REQUEST to GetIDEServicePortRequestHandler::class,
DevChatActions.GET_SETTING_REQUEST to GetSettingRequestHandler::class,
DevChatActions.UPDATE_SETTING_REQUEST to UpdateSettingRequestHandler::class,
DevChatActions.GET_SERVER_SETTINGS_REQUEST to GetServerSettingsRequestHandler::class,
DevChatActions.UPDATE_SERVER_SETTINGS_REQUEST to UpdateServerSettingsRequestHandler::class,
DevChatActions.INPUT_REQUEST to InputRequestHandler::class,
DevChatActions.SHOW_SETTING_DIALOG_REQUEST to ShowSettingDialogRequestHandler::class,
DevChatActions.DELETE_LAST_CONVERSATION_REQUEST to DeleteLastConversationRequestHandler::class,
DevChatActions.DELETE_TOPIC_REQUEST to DeleteTopicRequestHandler::class,
DevChatActions.STOP_GENERATION_REQUEST to StopGenerationRequestHandler::class,
Expand Down
15 changes: 0 additions & 15 deletions src/main/kotlin/ai/devchat/core/DevChatActions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ object DevChatActions {
const val SEND_USER_MESSAGE_RESPONSE = "sendUserMessage/response"
const val CODE_DIFF_APPLY_REQUEST = "codeDiffApply/request"
const val CODE_DIFF_APPLY_RESPONSE = "codeDiffApply/response"
const val SET_OR_UPDATE_KEY_REQUEST = "setOrUpdateKey/request"
const val SET_OR_UPDATE_KEY_RESPONSE = "setOrUpdateKey/response"
const val ADD_CONTEXT_REQUEST = "addContext/request"
const val ADD_CONTEXT_RESPONSE = "addContext/response"
const val ADD_CONTEXT_NOTIFY = "addContext/notify"
const val LIST_COMMANDS_REQUEST = "listCommands/request"
const val LIST_COMMANDS_RESPONSE = "listCommands/response"
const val LOAD_CONVERSATIONS_REQUEST = "loadConversations/request"
const val LOAD_CONVERSATIONS_RESPONSE = "loadConversations/response"
const val LOAD_HISTORY_MESSAGES_REQUEST = "loadHistoryMessages/request"
const val LOAD_HISTORY_MESSAGES_RESPONSE = "loadHistoryMessages/response"
const val UPDATE_LANGUAGE_REQUEST = "updateLanguage/request"
const val UPDATE_LANGUAGE_RESPONSE = "updateLanguage/response"
const val OPEN_LINK_REQUEST = "openLink/request"
const val OPEN_LINK_RESPONSE = "openLink/response"
const val LIST_TOPICS_REQUEST = "listTopics/request"
Expand All @@ -33,14 +27,6 @@ object DevChatActions {
const val REPLACE_FILE_CONTENT_RESPONSE = "replaceFileContent/response"
const val VIEW_DIFF_REQUEST = "viewDiff/request"
const val VIEW_DIFF_RESPONSE = "viewDiff/response"
const val LIST_CONTEXTS_REQUEST = "listContexts/request"
const val LIST_CONTEXTS_RESPONSE = "listContexts/response"
const val LIST_MODELS_REQUEST = "listModels/request"
const val LIST_MODELS_RESPONSE = "listModels/response"
const val GET_KEY_REQUEST = "getKey/request"
const val GET_KEY_RESPONSE = "getKey/response"
const val COMMIT_CODE_REQUEST = "commitCode/request"
const val COMMIT_CODE_RESPONSE = "commitCode/response"
const val GET_IDE_SERVICE_PORT_REQUEST = "getIDEServicePort/request"
const val GET_IDE_SERVICE_PORT_RESPONSE = "getIDEServicePort/response"
const val GET_SETTING_REQUEST = "getSetting/request"
Expand All @@ -55,7 +41,6 @@ object DevChatActions {
const val INPUT_RESPONSE = "input/response"
const val STOP_GENERATION_REQUEST = "stopGeneration/request"
const val STOP_GENERATION_RESPONSE = "stopGeneration/request"
const val SHOW_SETTING_DIALOG_REQUEST = "showSettingDialog/request"
const val DELETE_LAST_CONVERSATION_REQUEST = "deleteLastConversation/request"
const val DELETE_LAST_CONVERSATION_RESPONSE = "deleteLastConversation/response"
const val DELETE_TOPIC_REQUEST = "deleteTopic/request"
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/ai/devchat/core/DevChatWrapper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ class DevChatWrapper(
env["OPENAI_API_KEY"] = it
}
env["PYTHONPATH"] = PathUtils.pythonPath
(CONFIG["python_for_commands"] as? String)?.let {
env["command_python"] = it
}
env["DEVCHAT_IDE_SERVICE_URL"] = "http://localhost:${ideServerPort}"
env["DEVCHAT_IDE_SERVICE_PORT"] = ideServerPort.toString()
env["PYTHONUTF8"] = "1"
Expand Down

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/kotlin/ai/devchat/core/handlers/GetKeyRequestHandler.kt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/main/kotlin/ai/devchat/storage/DevChatConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class DevChatConfig(
"max_log_count" to oldSettings.maxLogCount,
"language" to oldSettings.language,
"python_for_chat" to oldSettings.pythonForChat,
"python_for_commands" to oldSettings.pythonForCommands,
"models" to supportedModels.associateBy({it}, { defaultModelConfig })
).forEach { (key, value) ->
if (this[key] == null) {
Expand Down

0 comments on commit 2ae1b49

Please sign in to comment.