Skip to content

Commit 067f8b8

Browse files
committed
refactor(counit): refactor CoUnit components and settings to support custom RAG #51
Refactored CoUnit components and settings to support a custom RAG system. The modifications include: - Changing imports and class names to reflect the new 'Custom RAG' branding.
1 parent 561e36a commit 067f8b8

File tree

9 files changed

+27
-18
lines changed

9 files changed

+27
-18
lines changed

src/233/main/resources/META-INF/autodev-core.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
id="cc.unitmesh.devti.settings.AutoDevSettingsConfigurable"
1313
displayName="AutoDev"/>
1414

15-
<projectConfigurable provider="cc.unitmesh.devti.settings.configurable.CoUnitToolConfigurableProvider"
15+
<projectConfigurable provider="cc.unitmesh.devti.counit.configurable.CoUnitToolConfigurableProvider"
1616
parentId="cc.unitmesh.devti.settings.AutoDevSettingsConfigurable"
1717
id="cc.unitmesh.counit"
1818
bundle="messages.AutoDevBundle" key="counit.name"/>

src/main/kotlin/cc/unitmesh/devti/counit/CoUnitPreProcessor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import cc.unitmesh.devti.gui.chat.ChatContext
88
import cc.unitmesh.devti.gui.chat.ChatRole
99
import cc.unitmesh.devti.llms.LlmFactory
1010
import cc.unitmesh.devti.provider.ContextPrompter
11-
import cc.unitmesh.devti.settings.configurable.coUnitSettings
11+
import cc.unitmesh.devti.counit.configurable.coUnitSettings
1212
import com.intellij.openapi.application.ApplicationManager
1313
import com.intellij.openapi.components.Service
1414
import com.intellij.openapi.diagnostic.logger
1515
import com.intellij.openapi.project.Project
1616
import kotlinx.coroutines.launch
17+
import kotlinx.serialization.decodeFromString
1718
import kotlinx.serialization.json.Json
1819

1920
const val CO_UNIT = "/counit"

src/main/kotlin/cc/unitmesh/devti/counit/CoUnitPromptGenerator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import cc.unitmesh.devti.counit.dto.ExplainQuery
55
import cc.unitmesh.devti.counit.dto.PayloadType
66
import cc.unitmesh.devti.counit.dto.QueryResponse
77
import cc.unitmesh.devti.counit.dto.QueryResult
8-
import cc.unitmesh.devti.settings.configurable.coUnitSettings
8+
import cc.unitmesh.devti.counit.configurable.coUnitSettings
99
import com.intellij.openapi.components.Service
1010
import com.intellij.openapi.project.Project
1111
import retrofit2.Retrofit

src/main/kotlin/cc/unitmesh/devti/settings/configurable/CoUnitSettingService.kt renamed to src/main/kotlin/cc/unitmesh/devti/counit/configurable/CoUnitSettingService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.settings.configurable
1+
package cc.unitmesh.devti.counit.configurable
22

33
import com.intellij.openapi.components.*
44
import com.intellij.openapi.project.Project

src/main/kotlin/cc/unitmesh/devti/settings/configurable/CoUnitToolConfigurable.kt renamed to src/main/kotlin/cc/unitmesh/devti/counit/configurable/CoUnitToolConfigurable.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.settings.configurable
1+
package cc.unitmesh.devti.counit.configurable
22

33
import cc.unitmesh.devti.AutoDevBundle
44
import cc.unitmesh.devti.fullWidthCell

src/main/kotlin/cc/unitmesh/devti/settings/configurable/CoUnitToolConfigurableProvider.kt renamed to src/main/kotlin/cc/unitmesh/devti/counit/configurable/CoUnitToolConfigurableProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cc.unitmesh.devti.settings.configurable
1+
package cc.unitmesh.devti.counit.configurable
22

33
import com.intellij.openapi.options.Configurable
44
import com.intellij.openapi.options.ConfigurableProvider

src/main/kotlin/cc/unitmesh/devti/counit/model/Tool.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package cc.unitmesh.devti.counit.model
2+
3+
/**
4+
* `Tooling` class represents a tooling configuration.
5+
*
6+
* @property name The name of the tooling.
7+
* @property description A short description of what the tooling is used for.
8+
* @property schema A JSON schema that defines the structure of the tooling configuration.
9+
* @property examples A list of example configurations that illustrate how to use the tooling.
10+
*/
11+
data class Tooling(
12+
val name: String,
13+
val description: String,
14+
val schema: String,
15+
val examples: List<String>
16+
)

src/main/resources/messages/AutoDevBundle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ settings.external.counit.location.label=CoUnit Location (TODO, with JSON RPC) :
6969
settings.external.counit.server.address.label=CoUnit Server address:
7070
devti.loading=Loading
7171

72-
counit.name=CoUnit
73-
counit.enable.label=Enable CoUnit (Experimental)
72+
counit.name=Custom RAG
73+
counit.enable.label=Enable Custom RAG (Experimental)
7474
counit.enable.label.comment=https://github.com/unit-mesh/co-unit
75-
counit.location.label=CoUnit Location (TODO, with JSON RPC) :
76-
counit.server.address.label=CoUnit Server address:
75+
counit.location.label=Custom RAG Location (TODO, with JSON RPC):
76+
counit.server.address.label=Custom RAG Server address:
7777

7878
group.DevOpsGenius.NewActions.text=SRE Genius (AutoDev)
7979
action.new.genius.dockerfile=Generate Dockerfile

0 commit comments

Comments
 (0)