Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.20 #109

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {
val kotlin_version = "1.9.20"
val jetty_version = "11.0.18"
val slf4j_version = "2.0.9"
val skyenet_version = "1.0.28"
val skyenet_version = "1.0.30"
dependencies {

implementation(group = "com.simiacryptus", name = "joe-penai", version = "1.0.28")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pluginName=intellij-aicoder
pluginRepositoryUrl=https://github.com/SimiaCryptus/intellij-aicoder
# SemVer format -> https://semver.org
pluginVersion=1.2.19
pluginVersion=1.2.20
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
#pluginSinceBuild = 203
pluginSinceBuild=231
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import org.apache.commons.io.IOUtils
import javax.swing.*
import java.nio.file.Path

class AnalogueFileAction extends FileContextAction<AnalogueFileAction.Settings> {
class AnalogueFileAction extends FileContextAction<Settings> {

private static class ProjectFile {
public String path = ""
Expand Down Expand Up @@ -91,7 +91,7 @@ class AnalogueFileAction extends FileContextAction<AnalogueFileAction.Settings>
Paths should be relative to the project root and should not exist.
Output the file path using the a line with the format "File: <path>".
Output the file code directly after the header line with no additional decoration.
""".stripIndent()
""".stripIndent(), null
),
new ChatMessage(
ChatMessage.Role.user, """
Expand All @@ -102,7 +102,7 @@ class AnalogueFileAction extends FileContextAction<AnalogueFileAction.Settings>
```
${baseFile.code}
```
""".stripIndent()
""".stripIndent(), null
)
]
String response = api.chat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class AppendAction extends SelectionAction<String> {
request.messages = [
new OpenAIClient.ChatMessage(
OpenAIClient.ChatMessage.Role.system,
"Append text to the end of the user's prompt"
"Append text to the end of the user's prompt", null
),
new OpenAIClient.ChatMessage(
OpenAIClient.ChatMessage.Role.user,
state.selectedText.toString()
state.selectedText.toString(), null
)
]
def chatResponse = api.chat(request, AppSettingsState.instance.defaultChatModel())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.simiacryptus.openai.OpenAIClient.ChatRequest

import javax.swing.*

class CreateFileAction extends FileContextAction<CreateFileAction.Settings> {
class CreateFileAction extends FileContextAction<Settings> {

CreateFileAction() {
super(false, true)
Expand Down Expand Up @@ -94,15 +94,15 @@ class CreateFileAction extends FileContextAction<CreateFileAction.Settings> {
Paths should be relative to the project root and should not exist.
Output the file path using the a line with the format "File: <path>".
Output the file code directly after the header line with no additional decoration.
""".stripIndent()
""".stripIndent(), null
),
//language=TEXT
new ChatMessage(
ChatMessage.Role.user, """
Create a new file based on the following directive: $directive

The file location should be based on the selected path `${basePath}`
""".stripIndent()
""".stripIndent(), null
)
]
def response = api.chat(
Expand All @@ -119,7 +119,7 @@ class CreateFileAction extends FileContextAction<CreateFileAction.Settings> {
def pathPattern = ~"""File(?:name)?: ['`"]?([^'`"]+)['`"]?"""
if (header =~ pathPattern) {
def match = (header =~ pathPattern)[0]
outputPath = match[1].trim()
outputPath = match[1].toString()
}
return new ProjectFile(
path: outputPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.apache.commons.io.FileUtils

import javax.swing.*

class GenerateStoryAction extends FileContextAction<GenerateStoryAction.Settings> {
class GenerateStoryAction extends FileContextAction<Settings> {

GenerateStoryAction() {
super(false, true)
Expand Down Expand Up @@ -239,7 +239,7 @@ class GenerateStoryAction extends FileContextAction<GenerateStoryAction.Settings
outputFiles << storyFile
}

return outputFiles.toArray()
return outputFiles.toArray(new File[0])
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import com.simiacryptus.openai.OpenAIClient
import com.simiacryptus.skyenet.chat.ChatServer
import com.simiacryptus.skyenet.chat.ChatSession
import com.simiacryptus.skyenet.util.ClasspathResource
import com.simiacryptus.util.JsonUtil
import jakarta.servlet.http.HttpServlet
import jakarta.servlet.http.HttpServletRequest
import jakarta.servlet.http.HttpServletResponse
import org.eclipse.jetty.servlet.ServletHolder
import org.eclipse.jetty.util.resource.Resource
import org.eclipse.jetty.webapp.WebAppContext
Expand All @@ -26,7 +22,7 @@ class CodeChatServer(
override val applicationName: String
get() = "Code Chat"

override fun newSession(sessionId: String) = object : ChatSession(
override fun newSession(userId: String?, sessionId: String) = object : ChatSession(
sessionId = sessionId,
parent = this@CodeChatServer,
model = AppSettingsState.instance.defaultChatModel(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.util.stream.Collectors
class ActionSettingsRegistry {

val actionSettings: MutableMap<String, ActionSettings> = HashMap()
private val version = 2.0001
private val version = 2.0002

fun edit(superChildren: Array<out AnAction>): Array<AnAction> {
val children = superChildren.toList().toMutableList()
Expand Down
Loading