Skip to content

Commit

Permalink
Fix: isFinalChunk logic error
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hu <[email protected]>
  • Loading branch information
daniel-hutao committed Nov 13, 2023
1 parent 7bc2e38 commit a27220e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "ai.devchat"
version = "0.0.1"
version = "v0.0.1"

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ai/devchat/cli/DevChatWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private String execCommand(List<String> commands) {
}
if (apiKey != null) {
pb.environment().put("OPENAI_API_KEY", apiKey);
Log.info("api_key: " + apiKey.substring(0, 5) + "...");
Log.info("api_key: " + apiKey.substring(0, 5) + "..." + apiKey.substring(apiKey.length() - 4, apiKey.length()));
}

try {
Expand Down Expand Up @@ -66,7 +66,7 @@ private void execCommand(List<String> commands, Consumer<String> callback) {
}
if (apiKey != null) {
pb.environment().put("OPENAI_API_KEY", apiKey);
Log.info("api_key: " + apiKey.substring(0, 5) + "...");
Log.info("api_key: " + apiKey.substring(0, 5) + "..." + apiKey.substring(apiKey.length() - 4, apiKey.length()));
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private DevChatResponseConsumer getResponseConsumer(String responseFunc) {
devChatActionHandler.sendResponse(DevChatActions.SEND_MESSAGE_RESPONSE, responseFunc, (metadata, payload) -> {
currentChunkId += 1;
metadata.put("currentChunkId", currentChunkId);
metadata.put("isFinalChunk", response.getPromptHash() == null);
metadata.put("isFinalChunk", response.getPromptHash() != null);
metadata.put("finishReason", response.getPromptHash() != null ? "success" : "");
metadata.put("error", "");

Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
Guidelines: https://plugins.jetbrains.com/docs/marketplace/plugin-overview-page.html#plugin-description -->
<description><![CDATA[
<h1>DevChat is An Open Source AI Coding Copilot</h1>
<p>DevChat is an open-source platform that empowers developers to more effectively integrate AI into code generation and documentation.
DevChat aims to go beyond simple code auto-completion and limited operations on code snippets.
DevChat offers a highly practical and effective way for developers to interact and collaborate with large language models (LLMs).</p>
]]></description>

<!-- Product and plugin compatibility requirements.
Expand Down
24 changes: 15 additions & 9 deletions src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a27220e

Please sign in to comment.