Skip to content

Commit 468a5ce

Browse files
committed
fix: add lost messages for Azure
1 parent 2fcab1c commit 468a5ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/kotlin/cc/unitmesh/devti/llms/azure/AzureOpenAIProvider.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ class AzureOpenAIProvider(val project: Project) : LLMProvider {
173173
ObjectMapper().readValue(sse!!.data, ChatCompletionResult::class.java)
174174
val completion = result.choices[0].message
175175
if (completion != null && completion.content != null) {
176+
output += completion.content
176177
trySend(completion.content)
177178
}
178179
}

src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomLLMProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ class CustomLLMProvider(val project: Project) : LLMProvider {
5252

5353
private var client = OkHttpClient()
5454
private val timeout = Duration.ofSeconds(600)
55-
private val messages: MutableList<Message> = ArrayList()
56-
55+
private val messages: MutableList<Message> = mutableListOf()
5756
private val logger = logger<CustomLLMProvider>()
5857

5958
override fun clearMessage() {
@@ -139,6 +138,7 @@ class CustomLLMProvider(val project: Project) : LLMProvider {
139138
}
140139
}
141140
}
141+
142142
close()
143143
}
144144
awaitClose()

0 commit comments

Comments
 (0)