Skip to content

Commit

Permalink
1.2.23 (#115)
Browse files Browse the repository at this point in the history
* 1.2.23

* wip

* jo-penai updates

* reorg
  • Loading branch information
acharneski authored Nov 22, 2023
1 parent e9faaa7 commit 17c427e
Show file tree
Hide file tree
Showing 57 changed files with 105 additions and 172 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ repositories {
val kotlin_version = "1.9.20"
val jetty_version = "11.0.18"
val slf4j_version = "2.0.9"
val skyenet_version = "1.0.35"
val skyenet_version = "1.0.37"
dependencies {

implementation(group = "com.simiacryptus", name = "joe-penai", version = "1.0.32")
implementation(group = "com.simiacryptus", name = "jo-penai", version = "1.0.34")

implementation(group = "com.simiacryptus.skyenet", name = "core", version = skyenet_version)
implementation(group = "com.simiacryptus.skyenet", name = "webui", version = skyenet_version)
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.22
pluginVersion=1.2.23
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
#pluginSinceBuild = 203
pluginSinceBuild=231
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.4.0")
}

//includeBuild("../joe-penai/")
//includeBuild("../SkyeNet/")
includeBuild("../jo-penai/")
includeBuild("../SkyeNet/")
//includeBuild("../AwsAgent/")


Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.github.simiacryptus.aicoder.actions.SelectionAction
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy
import org.jetbrains.annotations.Nullable

class CommentsAction extends SelectionAction<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.github.simiacryptus.aicoder.actions.SelectionAction
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy
import org.jetbrains.annotations.Nullable

import javax.swing.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.IndentedText
import com.github.simiacryptus.aicoder.util.TextBlockFactory
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.util.StringUtil
import com.simiacryptus.jopenai.proxy.ChatProxy
import com.simiacryptus.jopenai.util.StringUtil
import org.jetbrains.annotations.Nullable

class DescribeAction extends SelectionAction<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.github.simiacryptus.aicoder.util.IndentedText
import com.github.simiacryptus.aicoder.util.psi.PsiUtil
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy
import kotlin.Pair
import org.jetbrains.annotations.Nullable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.github.simiacryptus.aicoder.util.psi.PsiUtil
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.util.StringUtil
import com.simiacryptus.jopenai.proxy.ChatProxy
import com.simiacryptus.jopenai.util.StringUtil
import kotlin.Pair
import org.jetbrains.annotations.Nullable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.github.simiacryptus.aicoder.util.UITools
import com.github.simiacryptus.aicoder.util.psi.PsiClassContext
import com.github.simiacryptus.aicoder.util.psi.PsiUtil
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy
import kotlin.Pair
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package com.github.simiacryptus.aicoder.actions.code
import com.github.simiacryptus.aicoder.actions.SelectionAction
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy
import org.jetbrains.annotations.Nullable

import java.awt.Toolkit
import java.awt.*
import java.awt.datatransfer.DataFlavor

class PasteAction extends SelectionAction<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy
import org.jetbrains.annotations.Nullable

class RenameVariablesAction extends SelectionAction<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.config.Name
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.OpenAIClient.ChatMessage
import com.simiacryptus.openai.OpenAIClient.ChatRequest
import com.simiacryptus.jopenai.ApiModel.ChatMessage
import com.simiacryptus.jopenai.ApiModel.ChatRequest
import org.apache.commons.io.FileUtils
import org.apache.commons.io.IOUtils

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.github.simiacryptus.aicoder.actions.generic
import com.github.simiacryptus.aicoder.actions.SelectionAction
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.OpenAIClient
import org.jetbrains.annotations.Nullable

class AppendAction extends SelectionAction<String> {
Expand All @@ -18,12 +17,12 @@ class AppendAction extends SelectionAction<String> {
def request = settings.createChatRequest()
request.temperature = AppSettingsState.instance.temperature
request.messages = [
new OpenAIClient.ChatMessage(
OpenAIClient.Role.system,
new com.simiacryptus.jopenai.ApiModel.ChatMessage(
com.simiacryptus.jopenai.ApiModel.Role.system,
"Append text to the end of the user's prompt", null
),
new OpenAIClient.ChatMessage(
OpenAIClient.Role.user,
new com.simiacryptus.jopenai.ApiModel.ChatMessage(
com.simiacryptus.jopenai.ApiModel.Role.user,
state.selectedText.toString(), null
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.config.Name
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.OpenAIClient.ChatMessage
import com.simiacryptus.openai.OpenAIClient.ChatRequest
import com.simiacryptus.jopenai.ApiModel.ChatMessage
import com.simiacryptus.jopenai.ApiModel.ChatRequest

import javax.swing.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.util.StringUtil
import com.simiacryptus.jopenai.proxy.ChatProxy
import com.simiacryptus.jopenai.util.StringUtil
import org.jetbrains.annotations.NotNull
import org.jetbrains.annotations.Nullable

import static java.lang.Math.ceil
import static java.lang.Math.log
import static java.lang.Math.pow
import static java.lang.Math.*

class ReplaceOptionsAction extends SelectionAction<String> {
interface VirtualAPI {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.jopenai.proxy.ChatProxy

class MarkdownImplementActionGroup extends ActionGroup {
List<String> markdownLanguages = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.simiacryptus.aicoder.util;

import com.simiacryptus.util.StringUtil;
import com.simiacryptus.jopenai.util.StringUtil;

import java.util.Arrays;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.github.simiacryptus.aicoder.util.IdeaOpenAIClient
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.simiacryptus.openai.OpenAIClient
import com.simiacryptus.jopenai.OpenAIClient
import org.slf4j.LoggerFactory
import javax.swing.Icon

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.github.simiacryptus.aicoder.util.UITools
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.project.Project
import com.simiacryptus.skyenet.chat.ChatServer
import com.simiacryptus.skyenet.webui.chat.ChatServer
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.handler.ContextHandlerCollection
import org.eclipse.jetty.webapp.WebAppContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import com.github.simiacryptus.aicoder.actions.BaseAction
import com.github.simiacryptus.aicoder.actions.dev.AppServer
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.simiacryptus.skyenet.chat.CodeChatServer
import com.github.simiacryptus.aicoder.util.ComputerLanguage
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.simiacryptus.skyenet.webui.chat.CodeChatServer
import org.slf4j.LoggerFactory
import java.awt.Desktop
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.command.WriteCommandAction
import com.simiacryptus.util.audio.AudioRecorder
import com.simiacryptus.util.audio.LookbackLoudnessWindowBuffer
import com.simiacryptus.jopenai.audio.AudioRecorder
import com.simiacryptus.jopenai.audio.LookbackLoudnessWindowBuffer
import org.slf4j.LoggerFactory
import java.util.*
import java.util.concurrent.ConcurrentLinkedDeque
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import com.github.simiacryptus.aicoder.util.psi.PsiUtil.getSmallestIntersecting
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.application.ApplicationManager
import com.simiacryptus.openai.proxy.ChatProxy
import com.simiacryptus.util.StringUtil
import com.simiacryptus.jopenai.proxy.ChatProxy
import com.simiacryptus.jopenai.util.StringUtil

class MarkdownListAction : BaseAction() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.ui.components.JBCheckBox
import com.intellij.ui.components.JBPasswordField
import com.intellij.ui.components.JBTextField
import com.simiacryptus.openai.models.ChatModels
import com.simiacryptus.openai.OpenAIClientBase
import com.simiacryptus.jopenai.ClientUtil
import com.simiacryptus.jopenai.models.ChatModels

import org.slf4j.LoggerFactory
import java.awt.event.ActionEvent
import javax.swing.AbstractAction
Expand Down Expand Up @@ -57,7 +58,7 @@ class AppSettingsComponent {
@Suppress("unused")
val openApiLog = JButton(object : AbstractAction("Open API Log") {
override fun actionPerformed(e: ActionEvent) {
OpenAIClientBase.auxiliaryLog?.let {
ClientUtil.auxiliaryLog?.let {
val project = ApplicationManager.getApplication().runReadAction<Project> {
com.intellij.openapi.project.ProjectManager.getInstance().openProjects.firstOrNull()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import com.intellij.openapi.components.PersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.util.xmlb.XmlSerializerUtil
import com.simiacryptus.openai.models.OpenAIModel
import com.simiacryptus.openai.models.ChatModels
import com.simiacryptus.openai.OpenAIClient.ChatRequest
import com.simiacryptus.openai.models.OpenAITextModel
import com.simiacryptus.util.JsonUtil
import com.simiacryptus.jopenai.ApiModel.ChatRequest
import com.simiacryptus.jopenai.models.ChatModels
import com.simiacryptus.jopenai.models.OpenAIModel
import com.simiacryptus.jopenai.models.OpenAITextModel
import com.simiacryptus.jopenai.util.JsonUtil

class SimpleEnvelope(var value: String? = null)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.github.simiacryptus.aicoder.config

import java.util.ArrayList
import java.util.HashMap
import java.util.HashSet
import java.util.Map
import java.util.stream.Collectors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.intellij.openapi.wm.StatusBarWidgetFactory
import com.intellij.ui.CollectionListModel
import com.intellij.ui.SimpleListCellRenderer
import com.intellij.ui.popup.list.ComboBoxPopup
import com.simiacryptus.openai.models.ChatModels
import com.simiacryptus.jopenai.models.ChatModels
import kotlinx.coroutines.CoroutineScope
import javax.swing.JList
import javax.swing.ListCellRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import java.net.URI
import java.util.concurrent.Executors
import javax.swing.*
import javax.swing.Icon
import javax.swing.JPanel
import javax.swing.JSlider
import javax.swing.JTabbedPane
import javax.swing.event.ChangeEvent
import javax.swing.event.ChangeListener

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ import com.intellij.openapi.vfs.readText
import com.intellij.openapi.wm.StatusBar
import com.intellij.openapi.wm.StatusBarWidget
import com.intellij.openapi.wm.StatusBarWidgetFactory
import com.simiacryptus.openai.GPT4Tokenizer
import com.simiacryptus.jopenai.GPT4Tokenizer
import kotlinx.coroutines.CoroutineScope
import java.awt.event.MouseEvent
import java.util.concurrent.*
import java.util.concurrent.LinkedBlockingDeque
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit

class TokenCountWidgetFactory : StatusBarWidgetFactory {
companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package com.github.simiacryptus.aicoder.util

import com.simiacryptus.util.StringUtil
import com.simiacryptus.jopenai.util.StringUtil
import java.util.*
import java.util.stream.Collectors

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.github.simiacryptus.aicoder.util

import com.intellij.lang.Language
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package com.github.simiacryptus.aicoder.util

import com.github.simiacryptus.aicoder.config.ActionTable
import com.github.simiacryptus.aicoder.config.AppSettingsState
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.DialogWrapper
import com.intellij.ui.components.JBScrollPane
import com.intellij.util.ui.FormBuilder
import com.simiacryptus.openai.models.OpenAIModel
import com.simiacryptus.openai.OpenAIClient
import com.simiacryptus.openai.models.OpenAITextModel
import com.simiacryptus.util.JsonUtil
import com.simiacryptus.jopenai.ApiModel.*
import com.simiacryptus.jopenai.OpenAIClient
import com.simiacryptus.jopenai.models.OpenAIModel
import com.simiacryptus.jopenai.models.OpenAITextModel
import com.simiacryptus.jopenai.util.JsonUtil
import org.apache.hc.core5.http.HttpRequest
import org.slf4j.LoggerFactory
import java.util.concurrent.atomic.AtomicBoolean
Expand All @@ -34,6 +34,7 @@ class IdeaOpenAIClient : OpenAIClient(
super.authorize(request)
}

@Suppress("NAME_SHADOWING")
override fun chat(
chatRequest: ChatRequest,
model: OpenAITextModel
Expand All @@ -54,8 +55,7 @@ class IdeaOpenAIClient : OpenAIClient(
""".trimMargin().trim())
return response
}
return withJsonDialog(chatRequest, {
val chatRequest = it
return withJsonDialog(chatRequest, { chatRequest ->
UITools.run(
lastEvent!!.project, "OpenAI Request", true, suppressProgress = false
) {
Expand Down
Loading

0 comments on commit 17c427e

Please sign in to comment.