From d6ce17746813793a86d715a187fb7a465d78a353 Mon Sep 17 00:00:00 2001 From: Andrew Charneski Date: Fri, 3 Nov 2023 20:28:45 -0400 Subject: [PATCH] Fuck me life, and fuck yours too --- build.gradle.kts | 6 +++--- settings.gradle.kts | 4 ++-- .../aicoder/actions/generic/AnalogueFileAction.groovy | 2 +- .../aicoder/actions/generic/CreateFileAction.groovy | 2 +- .../simiacryptus/aicoder/actions/dev/CodeChatServer.kt | 8 +------- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ac9a3e3a..3e201d24 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,11 +24,11 @@ repositories { val kotlin_version = "1.7.22" val jetty_version = "11.0.15" -val slf4j_version = "2.0.5" -val skyenet_version = "1.0.18" +val slf4j_version = "2.0.9" +val skyenet_version = "1.0.20" dependencies { - implementation(group = "com.simiacryptus", name = "joe-penai", version = "1.0.20") + implementation(group = "com.simiacryptus", name = "joe-penai", version = "1.0.23") implementation(group = "com.simiacryptus.skyenet", name = "util", version = skyenet_version) implementation(group = "com.simiacryptus.skyenet", name = "core", version = skyenet_version) diff --git a/settings.gradle.kts b/settings.gradle.kts index 2e0bd7c1..d95a93bd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,8 +4,8 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version ("0.4.0") } -//includeBuild("../joe-penai/") -//includeBuild("../SkyeNet/") +includeBuild("../joe-penai/") +includeBuild("../SkyeNet/") //includeBuild("../AwsAgent/") diff --git a/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.groovy b/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.groovy index 018d714e..0b7e9da7 100644 --- a/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.groovy +++ b/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/AnalogueFileAction.groovy @@ -79,7 +79,7 @@ class AnalogueFileAction extends FileContextAction } private ProjectFile generateFile(ProjectFile baseFile, String directive) { - def chatRequest = new ChatRequest() + def chatRequest = new com.simiacryptus.openai.OpenAIClient.ChatRequest.ChatRequest() def model = AppSettingsState.instance.defaultChatModel() chatRequest.model = model.modelName chatRequest.max_tokens = model.maxTokens diff --git a/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/CreateFileAction.groovy b/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/CreateFileAction.groovy index 29a259b7..21462860 100644 --- a/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/CreateFileAction.groovy +++ b/src/main/groovy/com/github/simiacryptus/aicoder/actions/generic/CreateFileAction.groovy @@ -81,7 +81,7 @@ class CreateFileAction extends FileContextAction { String basePath, String directive ) { - def chatRequest = new ChatRequest() + def chatRequest = new com.simiacryptus.openai.OpenAIClient.ChatRequest.ChatRequest() def model = AppSettingsState.instance.defaultChatModel() chatRequest.model = model.modelName chatRequest.max_tokens = model.maxTokens diff --git a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/dev/CodeChatServer.kt b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/dev/CodeChatServer.kt index ef6aaa0b..0efd1f2d 100644 --- a/src/main/kotlin/com/github/simiacryptus/aicoder/actions/dev/CodeChatServer.kt +++ b/src/main/kotlin/com/github/simiacryptus/aicoder/actions/dev/CodeChatServer.kt @@ -1,16 +1,10 @@ package com.github.simiacryptus.aicoder.actions.dev import com.github.simiacryptus.aicoder.config.AppSettingsState -import com.github.simiacryptus.aicoder.util.UITools import com.intellij.openapi.project.Project import com.simiacryptus.openai.OpenAIClient -import com.simiacryptus.skyenet.Heart import com.simiacryptus.skyenet.body.* -import com.simiacryptus.skyenet.heart.WeakGroovyInterpreter import org.eclipse.jetty.util.resource.Resource -import java.util.HashMap -import java.util.Map -import java.util.function.Supplier class CodeChatServer( val project: Project, @@ -45,7 +39,7 @@ rootMessageTrail = ) { override fun run(userMessage: String) { var messageTrail = ChatSession.divInitializer() - send("""$messageTrail
$userMessage
$spinner
""") + send("""$messageTrail
$userMessage
${SkyenetSessionServerBase.spinner}
""") messages += OpenAIClient.ChatMessage(OpenAIClient.ChatMessage.Role.user, userMessage) val response = api.chat(chatRequest, model).choices.first()?.message?.content.orEmpty() messages += OpenAIClient.ChatMessage(OpenAIClient.ChatMessage.Role.assistant, response)