Skip to content

Commit

Permalink
1.2.18 (#105)
Browse files Browse the repository at this point in the history
* Fixing errors on startup for sanctioned systems

* 1.2.18

* Update gradle.properties

* 1.2.18

* Update settings.gradle.kts

* 1.2.18

* 1.2.18

* wip

* wip

* wip

* wip

* wip

* Update build.gradle.kts

* wip

* Update build.gradle.kts

* 1.2.18
  • Loading branch information
acharneski authored Nov 12, 2023
1 parent 80a2622 commit 63572de
Show file tree
Hide file tree
Showing 61 changed files with 1,528 additions and 1,020 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
# Run tests
- name: Run Tests
run: ./gradlew check -x test
run: ./gradlew check -x test --stacktrace --info

# Collect Tests Result of failed tests
- name: Collect Tests Result
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.gradle
.idea
.qodana
.*
build
openai.key
.run
Expand All @@ -10,5 +11,5 @@ api.log.json
*.log.java
*.log
api.*
.skynet

.skynet.bak

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

## [Unreleased]

## [1.2.18]

### Improved
- Code Chat
- Various fixes
- Added GPT4 Turbo support

## [1.2.14]

### Improved
Expand Down
34 changes: 16 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ fun environment(key: String) = providers.environmentVariable(key).get()
plugins {
id("java") // Java support
id("groovy")
id("org.jetbrains.kotlin.jvm") version "1.7.22"
id("org.jetbrains.intellij") version "1.14.1"
id("org.jetbrains.changelog") version "2.0.0"
id("org.jetbrains.qodana") version "0.1.13"
id("org.jetbrains.kotlinx.kover") version "0.6.1"
id("org.jetbrains.kotlin.jvm") version "1.9.20"
id("org.jetbrains.intellij") version "1.16.0"
id("org.jetbrains.changelog") version "2.2.0"
id("org.jetbrains.qodana") version "2023.2.1"
id("org.jetbrains.kotlinx.kover") version "0.7.4"
}

group = "com.github.simiacryptus"
Expand All @@ -22,15 +22,14 @@ repositories {
maven(url = "https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
}

val kotlin_version = "1.7.22"
val kotlin_version = "1.9.20"
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.26"
dependencies {

implementation(group = "com.simiacryptus", name = "joe-penai", version = "1.0.20")
implementation(group = "com.simiacryptus", name = "joe-penai", version = "1.0.27")

implementation(group = "com.simiacryptus.skyenet", name = "util", version = skyenet_version)
implementation(group = "com.simiacryptus.skyenet", name = "core", version = skyenet_version)
implementation(group = "com.simiacryptus.skyenet", name = "webui", version = skyenet_version)

Expand Down Expand Up @@ -73,15 +72,14 @@ tasks.named("processResources") {
}

kotlin {
// jvmToolchain(11)
jvmToolchain(17)
}

tasks {
compileKotlin {
kotlinOptions {
javaParameters = true
jvmTarget = "1.8"
jvmTarget = "17"
}
}

Expand Down Expand Up @@ -167,12 +165,12 @@ changelog {

qodana {
cachePath.set(file(".qodana").canonicalPath)
reportPath.set(file("build/reports/inspections").canonicalPath)
saveReport.set(true)
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
// reportPath.set(file("build/reports/inspections").canonicalPath)
// saveReport.set(true)
// showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
}

kover.xmlReport {
onCheck.set(true)
}
//kover.xmlReport {
// onCheck.set(true)
//}

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.17
pluginVersion=1.2.18
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
#pluginSinceBuild = 203
pluginSinceBuild=231
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

33 changes: 19 additions & 14 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand All @@ -54,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -79,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -142,12 +140,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -192,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down Expand Up @@ -237,4 +243,3 @@ eval "set -- $(
)" '"$@"'

exec "$JAVACMD" "$@"

1 change: 1 addition & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import java.util.zip.ZipEntry
import java.util.zip.ZipOutputStream

class GenerateProjectAction extends FileContextAction<Settings> {
static Logger logger = LoggerFactory.getLogger(GenerateProjectAction.class)


GenerateProjectAction() {
super(false, true)
Expand Down Expand Up @@ -326,7 +324,7 @@ class GenerateProjectAction extends FileContextAction<Settings> {
)
// def progressVal = currentDraft.incrementAndGet().toDouble() / totalDrafts
// progress(progressVal)
// logger.info("Progress: $progressVal")
// log.info("Progress: $progressVal")
return new Pair(file.location, implement)
}
})
Expand Down Expand Up @@ -371,7 +369,7 @@ class GenerateProjectAction extends FileContextAction<Settings> {
)
// def progressVal = currentDraft.incrementAndGet().toDouble() / totalDrafts
// progress(progressVal)
// logger.info("Progress: $progressVal")
// log.info("Progress: $progressVal")
return new Pair(file.location, implement)
}
})
Expand Down Expand Up @@ -418,7 +416,7 @@ class GenerateProjectAction extends FileContextAction<Settings> {
)
// def progressVal = currentDraft.incrementAndGet().toDouble() / totalDrafts
// progress(progressVal)
// logger.info("Progress: $progressVal")
// log.info("Progress: $progressVal")
return new Pair(file.location, implement)
}
})
Expand Down Expand Up @@ -457,16 +455,17 @@ class GenerateProjectAction extends FileContextAction<Settings> {
return UITools.showDialog(project, SettingsUI.class, Settings.class, "Project Settings", { config -> })
}

SoftwareProjectAI projectAI = new ChatProxy<SoftwareProjectAI>(
clazz: SoftwareProjectAI.class,
api: api,
model: AppSettingsState.instance.defaultChatModel(),
temperature: AppSettingsState.instance.temperature,
deserializerRetries: 2,
).create()
SoftwareProjectAI projectAI = null

@Override
File[] processSelection(SelectionState state, Settings config) {
projectAI = new ChatProxy<SoftwareProjectAI>(
clazz: SoftwareProjectAI.class,
api: api,
model: AppSettingsState.instance.defaultChatModel(),
temperature: AppSettingsState.instance.temperature,
deserializerRetries: 2,
).create()
if (config == null) return new File[0]


Expand Down Expand Up @@ -521,20 +520,20 @@ class GenerateProjectAction extends FileContextAction<Settings> {
entries.each { file, sourceCode ->
def relative = trimStart(trimEnd(file.file, '/'), ['/', '.']) ?: ""
if (new File(relative).isAbsolute()) {
logger.warn("Invalid path: $relative")
log.warn("Invalid path: $relative")
} else {
def outFile = new File(outputDir, relative)
outFile.parentFile.mkdirs()
def best = sourceCode.max { it.code.length() }
outFile.text = best.code
logger.debug("Wrote ${outFile.canonicalPath} (Resolved from $relative)")
log.debug("Wrote ${outFile.canonicalPath} (Resolved from $relative)")
generatedFiles << outFile
if (config.saveAlternates)
sourceCode.findAll { it != best }.eachWithIndex { alternate, index ->
def outFileAlternate = new File(outputDir, relative + ".${index + 1}")
outFileAlternate.parentFile.mkdirs()
outFileAlternate.text = alternate.code
logger.debug("Wrote ${outFileAlternate.canonicalPath} (Resolved from $relative)")
log.debug("Wrote ${outFileAlternate.canonicalPath} (Resolved from $relative)")
generatedFiles << outFileAlternate
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class AnalogueFileAction extends FileContextAction<AnalogueFileAction.Settings>
def chatRequest = new ChatRequest()
def model = AppSettingsState.instance.defaultChatModel()
chatRequest.model = model.modelName
chatRequest.max_tokens = model.maxTokens
chatRequest.temperature = AppSettingsState.instance.temperature
chatRequest.messages = [
new ChatMessage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class CreateFileAction extends FileContextAction<CreateFileAction.Settings> {
def chatRequest = new ChatRequest()
def model = AppSettingsState.instance.defaultChatModel()
chatRequest.model = model.modelName
chatRequest.max_tokens = model.maxTokens
chatRequest.temperature = AppSettingsState.instance.temperature
chatRequest.messages = [
//language=TEXT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,18 @@ class GenerateStoryAction extends FileContextAction<GenerateStoryAction.Settings
return UITools.showDialog(project, SettingsUI.class, Settings.class, "Generate Story", {})
}

def proxy = new ChatProxy<AuthorAPI>(
clazz: AuthorAPI.class,
api: api,
model: AppSettingsState.instance.defaultChatModel(),
temperature: AppSettingsState.instance.temperature,
deserializerRetries: 2,
).create()
AuthorAPI proxy = null

@Override
File[] processSelection(SelectionState state, Settings config) {
proxy = new ChatProxy<AuthorAPI>(
clazz: AuthorAPI.class,
api: api,
model: AppSettingsState.instance.defaultChatModel(),
temperature: AppSettingsState.instance.temperature,
deserializerRetries: 2,
).create()

List<File> outputFiles = []

if (config) {
Expand Down
Loading

0 comments on commit 63572de

Please sign in to comment.