File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
core/src/main/kotlin/cc/unitmesh/devti/agent/custom Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,18 @@ class CustomAgentExecutor(val project: Project) : CustomSSEProcessor(project) {
34
34
this .responseFormat = agent.connector?.responseFormat ? : this .responseFormat
35
35
36
36
val customRequest = CustomRequest (listOf (Message (" user" , promptText)))
37
- val request = if (requestFormat.isNotEmpty()) {
37
+ var request = if (requestFormat.isNotEmpty()) {
38
38
customRequest.updateCustomFormat(requestFormat)
39
39
} else {
40
40
Json .encodeToString<CustomRequest >(customRequest)
41
41
}
42
42
43
+ // fix for custom fields in message replace \"content\": \"$content\" with \"$content\": promptText
44
+ val errorContent = " \" content\" :\" \$ content\" "
45
+ if (request.contains(errorContent)) {
46
+ request = request.replace(errorContent, " \" content\" : \" $promptText \" " )
47
+ }
48
+
43
49
val body = request.toRequestBody(" application/json" .toMediaTypeOrNull())
44
50
val builder = Request .Builder ()
45
51
You can’t perform that action at this time.
0 commit comments