Skip to content

Commit

Permalink
bump(version): update plugin version to 1.8.14
Browse files Browse the repository at this point in the history
Updated the plugin version in `gradle.properties` and refactored `CustomSSEProcessor.kt` to return early when receiving "[DONE]" SSE data, improving readability and efficiency. Removed the duplicate condition check to streamline the processing loop.
  • Loading branch information
phodal committed Oct 23, 2024
1 parent e801132 commit 3ef2312
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@ open class CustomSSEProcessor(private val project: Project) {
close()
}
.blockingForEach { sse ->
if (sse.data == "[DONE]") {
return@blockingForEach
}

if (responseFormat.isNotEmpty()) {
// {"id":"cmpl-a22a0d78fcf845be98660628fe5d995b","object":"chat.completion.chunk","created":822330,"model":"moonshot-v1-8k","choices":[{"index":0,"delta":{},"finish_reason":"stop","usage":{"prompt_tokens":434,"completion_tokens":68,"total_tokens":502}}]}
// in some case, the response maybe not equal to our response format, so we need to ignore it
// {"id":"cmpl-ac26a17e","object":"chat.completion.chunk","created":1858403,"model":"yi-34b-chat","choices":[{"delta":{"role":"assistant"},"index":0}],"content":"","lastOne":false}
if (sse.data == "[DONE]") {
return@blockingForEach
}

val chunk: String? = JsonPath.parse(sse!!.data)?.read(responseFormat)

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pluginGroup = com.phodal.autodev
pluginName = AutoDev
pluginRepositoryUrl = https://github.com/unit-mesh/auto-dev
# SemVer format -> https://semver.org
pluginVersion = 1.8.13
pluginVersion = 1.8.14

# Supported IDEs: idea, pycharm
baseIDE=idea
Expand Down

0 comments on commit 3ef2312

Please sign in to comment.