Skip to content

Commit 26a52fc

Browse files
committed
refactor(settings): remove XingHuo API related parameters
Remove XingHuo API related parameters from settings and associated code.
1 parent caa6b88 commit 26a52fc

File tree

6 files changed

+0
-58
lines changed

6 files changed

+0
-58
lines changed

docs/quick-start.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ ps: For OpenAI compatible, you can use `Open AI Model` to your custom OpenAI com
4646
4. fill `Custom Engine Server` and `Custom Engine Token` if needed.
4747
5. Apply and OK.
4848

49-
### Xunfei Xinghuo
50-
51-
1. open AutoDev Config in `Settings` -> `Tools` -> `AutoDev`.
52-
2. select `AI Engine` -> `Xinghuo`
53-
3. fill `AppId`, `AppKey`, `AppSecret` with your Xunfei Xinghuo API Key.
54-
4. Apply and OK.
55-
5649
### Custom Config / OpenAI compatible
5750

5851
Tested: 零一万物([#94](https://github.com/unit-mesh/auto-dev/issues/94)), 月之暗面(Moonshot

src/main/kotlin/cc/unitmesh/devti/settings/AutoDevSettingsState.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import com.intellij.openapi.application.ApplicationManager
44
import com.intellij.openapi.components.PersistentStateComponent
55
import com.intellij.openapi.components.State
66
import com.intellij.openapi.components.Storage
7-
import com.intellij.openapi.diagnostic.Logger
87
import com.intellij.util.xmlb.Converter
98
import com.intellij.util.xmlb.XmlSerializerUtil
109
import com.intellij.util.xmlb.annotations.OptionTag
1110
import java.time.ZonedDateTime
1211
import java.time.format.DateTimeFormatter
13-
import java.time.format.DateTimeParseException
1412

1513
@State(name = "cc.unitmesh.devti.settings.DevtiSettingsState", storages = [Storage("DevtiSettings.xml")])
1614
class AutoDevSettingsState : PersistentStateComponent<AutoDevSettingsState> {
@@ -29,15 +27,6 @@ class AutoDevSettingsState : PersistentStateComponent<AutoDevSettingsState> {
2927
var customPrompts = ""
3028
var customModel = ""
3129

32-
// 星火有三个版本 https://console.xfyun.cn/services/bm3
33-
var xingHuoApiVersion = XingHuoApiVersion.V3
34-
var xingHuoAppId = ""
35-
var xingHuoApiSecrect = ""
36-
var xingHuoApiKey = ""
37-
38-
/**
39-
* 自定义引擎返回的数据格式是否是 [SSE](https://www.ruanyifeng.com/blog/2017/05/server-sent_events.html) 格式
40-
*/
4130
var customEngineResponseType = ResponseType.SSE.name
4231
/**
4332
* should be a json path

src/main/kotlin/cc/unitmesh/devti/settings/Constants.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,6 @@ enum class AIEngines {
99

1010
val GIT_TYPE = arrayOf("Github" , "Gitlab")
1111
val DEFAULT_GIT_TYPE = GIT_TYPE[0]
12-
enum class XingHuoApiVersion(val value: Double) {
13-
V1(1.1), V2(2.1), V3(3.1), V3_5(3.5);
14-
15-
companion object {
16-
fun of(str: String): XingHuoApiVersion = when (str) {
17-
"V1" -> V1
18-
"V2" -> V2
19-
"V3" -> V3
20-
"V3_5" -> V3_5
21-
else -> V3
22-
}
23-
}
24-
}
2512

2613
enum class ResponseType {
2714
SSE, JSON;

src/main/kotlin/cc/unitmesh/devti/settings/LLMSettingComponent.kt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ class LLMSettingComponent(private val settings: AutoDevSettingsState) {
3333
private val customEngineServerParam by LLMParam.creating { Editable(settings.customEngineServer) }
3434
private val customEngineTokenParam by LLMParam.creating { Password(settings.customEngineToken) }
3535

36-
private val xingHuoApiVersionParam by LLMParam.creating {
37-
ComboBox("${settings.xingHuoApiVersion}", XingHuoApiVersion.values().toList().map { it.toString() })
38-
}
39-
private val xingHuoAppIDParam by LLMParam.creating { Editable(settings.xingHuoAppId) }
40-
private val xingHuoApiKeyParam by LLMParam.creating { Password(settings.xingHuoApiKey) }
41-
private val xingHuoApiSecretParam by LLMParam.creating { Password(settings.xingHuoApiSecrect) }
42-
4336
private val customEngineResponseTypeParam by LLMParam.creating { ComboBox(settings.customEngineResponseType, ResponseType.values().map { it.name }.toList()) }
4437
private val customEngineResponseFormatParam by LLMParam.creating { Editable(settings.customEngineResponseFormat) }
4538
private val customEngineRequestBodyFormatParam by LLMParam.creating { Editable(settings.customEngineRequestFormat) }
@@ -185,10 +178,6 @@ class LLMSettingComponent(private val settings: AutoDevSettingsState) {
185178
customEngineResponseTypeParam.value = customEngineResponseType
186179
customEngineTokenParam.value = customEngineToken
187180
openAIModelsParam.value = openAiModel
188-
xingHuoApiVersionParam.value = xingHuoApiVersion.toString()
189-
xingHuoAppIDParam.value = xingHuoAppId
190-
xingHuoApiKeyParam.value = xingHuoApiKey
191-
xingHuoApiSecretParam.value = xingHuoApiSecrect
192181
languageParam.value = language
193182
aiEngineParam.value = aiEngine
194183
customEnginePrompt.text = customPrompts
@@ -208,10 +197,6 @@ class LLMSettingComponent(private val settings: AutoDevSettingsState) {
208197
openAiKey = openAIKeyParam.value
209198
customModel = customModelParam.value
210199
customOpenAiHost = customOpenAIHostParam.value
211-
xingHuoApiSecrect = xingHuoApiSecretParam.value
212-
xingHuoApiVersion = XingHuoApiVersion.of(xingHuoApiVersionParam.value)
213-
xingHuoAppId = xingHuoAppIDParam.value
214-
xingHuoApiKey = xingHuoApiKeyParam.value
215200
aiEngine = aiEngineParam.value
216201
language = languageParam.value
217202
customEngineServer = customEngineServerParam.value
@@ -233,10 +218,6 @@ class LLMSettingComponent(private val settings: AutoDevSettingsState) {
233218
settings.gitlabToken != gitLabTokenParam.value ||
234219
settings.openAiKey != openAIKeyParam.value ||
235220
settings.customModel != customModelParam.value ||
236-
settings.xingHuoApiSecrect != xingHuoApiSecretParam.value ||
237-
settings.xingHuoApiVersion != XingHuoApiVersion.of(xingHuoApiVersionParam.value) ||
238-
settings.xingHuoAppId != xingHuoAppIDParam.value ||
239-
settings.xingHuoApiKey != xingHuoApiKeyParam.value ||
240221
settings.aiEngine != aiEngineParam.value ||
241222
settings.language != languageParam.value ||
242223
settings.customEngineServer != customEngineServerParam.value ||

src/main/resources/messages/AutoDevBundle_en.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ settings.maxTokenLengthParam=Max token length
6363
settings.customEngineServerParam=Custom Engine Server
6464
settings.customAIKeyParam=Custom AI Engine Key
6565
settings.aiEngineParam=AI Engine
66-
settings.xingHuoApiKeyParam=XingHuo API Key
67-
settings.xingHuoApiSecretParam=XingHuo API Secret
68-
settings.xingHuoAppIDParam=XingHuo App ID
69-
settings.xingHuoApiVersionParam=XingHuo API Version
7066
settings.customModelParam= Custom Model
7167

7268
settings.delaySecondsParam=Quest Delay Seconds

src/main/resources/messages/AutoDevBundle_zh.properties

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ settings.maxTokenLengthParam=最大 token 长度
6363
settings.customEngineServerParam=自定义 LLM 服务器
6464
settings.customAIKeyParam=自定义 LLM 服务器密钥
6565
settings.aiEngineParam=LLM 服务器
66-
settings.xingHuoApiKeyParam=星火 API 密钥
67-
settings.xingHuoApiSecretParam=星火 API 密钥
68-
settings.xingHuoAppIDParam=星火 App ID
69-
settings.xingHuoApiVersionParam=星火 API 版本
7066
settings.customModelParam=自定义模型
7167

7268
settings.delaySecondsParam=请求延迟秒数

0 commit comments

Comments
 (0)