File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/main/kotlin/cc/unitmesh/devti Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ class XingHuoProvider(val project: Project) : LLMProvider {
33
33
get() = when (this ) {
34
34
XingHuoApiVersion .V1 -> " "
35
35
XingHuoApiVersion .V2 -> " v2"
36
+ XingHuoApiVersion .V3_5 -> " v3.5"
36
37
else -> " v3"
37
38
}
38
39
@@ -128,7 +129,7 @@ class XingHuoProvider(val project: Project) : LLMProvider {
128
129
val header = """
129
130
|host: spark-api.xf-yun.com
130
131
|date: $date
131
- |GET /v${apiVersion.value} .1 /chat HTTP/1.1
132
+ |GET /v${apiVersion.value} /chat HTTP/1.1
132
133
""" .trimMargin()
133
134
val signature = hmacsha256.doFinal(header.toByteArray()).encodeBase64()
134
135
val authorization =
@@ -139,7 +140,7 @@ class XingHuoProvider(val project: Project) : LLMProvider {
139
140
" date" to date,
140
141
" host" to " spark-api.xf-yun.com"
141
142
)
142
- val urlBuilder = " https://spark-api.xf-yun.com/v${apiVersion.value} .1 /chat" .toHttpUrl().newBuilder()
143
+ val urlBuilder = " https://spark-api.xf-yun.com/v${apiVersion.value} /chat" .toHttpUrl().newBuilder()
143
144
params.forEach {
144
145
urlBuilder.addQueryParameter(it.key, it.value)
145
146
}
Original file line number Diff line number Diff line change @@ -9,14 +9,15 @@ enum class AIEngines {
9
9
10
10
val GIT_TYPE = arrayOf(" Github" , " Gitlab" )
11
11
val DEFAULT_GIT_TYPE = GIT_TYPE [0 ]
12
- enum class XingHuoApiVersion (val value : Int ) {
13
- V1 (1 ), V2 (2 ), V3 (3 );
12
+ enum class XingHuoApiVersion (val value : Double ) {
13
+ V1 (1.1 ), V2 (2.1 ), V3 (3.1 ), V3_5 ( 3.5 );
14
14
15
15
companion object {
16
16
fun of (str : String ): XingHuoApiVersion = when (str) {
17
17
" V1" -> V1
18
18
" V2" -> V2
19
19
" V3" -> V3
20
+ " V3_5" -> V3_5
20
21
else -> V3
21
22
}
22
23
}
You can’t perform that action at this time.
0 commit comments