Skip to content

Commit

Permalink
1.0.44 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
acharneski authored Dec 22, 2023
1 parent 7e0869c commit 9ef93c5
Show file tree
Hide file tree
Showing 12 changed files with 313 additions and 227 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ Maven:
<dependency>
<groupId>com.simiacryptus</groupId>
<artifactId>skyenet-webui</artifactId>
<version>1.0.43</version>
<version>1.0.44</version>
</dependency>
```

Gradle:

```groovy
implementation group: 'com.simiacryptus', name: 'skyenet', version: '1.0.43'
implementation group: 'com.simiacryptus', name: 'skyenet', version: '1.0.44'
```

```kotlin
implementation("com.simiacryptus:skyenet:1.0.43")
implementation("com.simiacryptus:skyenet:1.0.44")
```

### 🌟 To Use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;

public class OutputInterceptor {
public final class OutputInterceptor {

private OutputInterceptor() {
// Prevent instantiation of the utility class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ open class CodingActor(
get() = interpreterClass.java.getConstructor(Map::class.java).newInstance(symbols + runtimeSymbols)

data class CodeRequest(
val messages: List<String>,
val messages: List<Pair<String, Role>>,
val codePrefix: String = "",
val autoEvaluate: Boolean = false,
val fixIterations: Int = 4,
Expand Down Expand Up @@ -99,8 +99,8 @@ open class CodingActor(
),
) + questions.messages.map {
ChatMessage(
role = Role.user,
content = it.toContentList()
role = it.second,
content = it.first.toContentList()
)
}
if (questions.codePrefix.isNotBlank()) {
Expand Down Expand Up @@ -170,8 +170,8 @@ open class CodingActor(
}
log.info("Result: $result")
//language=HTML
val executionResult = ExecutionResult(result.toString(), OutputInterceptor.getGlobalOutput())
OutputInterceptor.clearGlobalOutput()
val executionResult = ExecutionResult(result.toString(), OutputInterceptor.getThreadOutput())
OutputInterceptor.clearThreadOutput()
return executionResult
}

Expand Down Expand Up @@ -280,22 +280,22 @@ open class CodingActor(
ChatMessage(
Role.assistant,
"""
|```${language.lowercase()}
|${previousCode}
|```
|""".trimMargin().trim().toContentList()
|```${language.lowercase()}
|${previousCode}
|```
|""".trimMargin().trim().toContentList()
),
ChatMessage(
Role.system,
"""
|The previous code failed with the following error:
|
|```
|${error.message?.trim() ?: ""}
|```
|
|Correct the code and try again.
|""".trimMargin().trim().toContentList()
|The previous code failed with the following error:
|
|```
|${error.message?.trim() ?: ""}
|```
|
|Correct the code and try again.
|""".trimMargin().trim().toContentList()
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ interface UsageInterface {
fun getUserUsageSummary(user: User): Map<OpenAIModel, ApiModel.Usage>

fun getSessionUsageSummary(session: Session): Map<OpenAIModel, ApiModel.Usage>
fun clear()

data class UsageKey(
val session: Session,
Expand Down
Loading

0 comments on commit 9ef93c5

Please sign in to comment.