Skip to content

Commit dfc3840

Browse files
committed
feat(llm): add simiple fix option to disable history auto-formatting in LLM stream creation #141
1 parent 270145c commit dfc3840

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/main/kotlin/cc/unitmesh/devti/custom/document/CustomLivingDocTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CustomLivingDocTask(
2626
logger.info("Prompt: $prompt")
2727

2828
val stream =
29-
LlmFactory().create(project).stream(prompt, "")
29+
LlmFactory().create(project).stream(prompt, "", false)
3030

3131
var result = ""
3232

src/main/kotlin/cc/unitmesh/devti/custom/tasks/FileGenerateTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class FileGenerateTask(@JvmField val project: Project, val messages: List<LlmMsg
2828
val systemPrompt = messages.filter { it.role == LlmMsg.ChatRole.System }.joinToString("\n") { it.content }
2929

3030
val stream =
31-
LlmFactory().create(project).stream(requestPrompt, systemPrompt)
31+
LlmFactory().create(project).stream(requestPrompt, systemPrompt, false)
3232

3333
var result = ""
3434
runBlocking {

src/main/kotlin/cc/unitmesh/devti/intentions/action/task/LivingDocumentationTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class LivingDocumentationTask(
3535

3636
logger.info("Prompt: $prompt")
3737

38-
val stream = LlmFactory().create(project).stream(prompt, "")
38+
val stream = LlmFactory().create(project).stream(prompt, "", false)
3939

4040
var result = ""
4141

src/main/kotlin/cc/unitmesh/devti/intentions/action/task/TestCodeGenTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class TestCodeGenTask(val request: TestCodeGenRequest) :
112112
indicator.text = AutoDevBundle.message("intentions.request.background.process.title")
113113

114114
val flow: Flow<String> = try {
115-
LlmFactory().create(request.project).stream(prompter, "")
115+
LlmFactory().create(request.project).stream(prompter, "", false)
116116
} catch (e: Exception) {
117117
AutoDevStatusService.notifyApplication(AutoDevStatus.Error)
118118
logger.error("Failed to create LLM for: $lang", e)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fun Panel.testLLMConnection(project: Project?) {
2020
// test custom engine
2121
LLMCoroutineScope.scope(project).launch {
2222
try {
23-
val flowString: Flow<String> = LlmFactory.instance.create(project).stream("hi", "")
23+
val flowString: Flow<String> = LlmFactory.instance.create(project).stream("hi", "", false)
2424
flowString.collect {
2525
result.text += it
2626
}

0 commit comments

Comments
 (0)