-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
40 changed files
with
1,490 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Gradle Releases -> https://github.com/gradle/gradle/releases | ||
libraryGroup = com.simiacryptus.skyenet | ||
libraryVersion = 1.2.4 | ||
libraryVersion = 1.2.5 | ||
gradleVersion = 7.6.1 | ||
kotlin.daemon.jvmargs=-Xmx2g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
webui/src/main/kotlin/com/simiacryptus/skyenet/apps/meta/ActorDesigner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.simiacryptus.skyenet.apps.meta | ||
|
||
import com.simiacryptus.jopenai.models.ChatModels | ||
import com.simiacryptus.jopenai.models.OpenAIModels | ||
import com.simiacryptus.skyenet.core.actors.ParsedActor | ||
|
||
class ActorDesigner( | ||
model: ChatModels, | ||
temperature: Double | ||
) : ParsedActor<AgentActorDesign>( | ||
resultClass = AgentActorDesign::class.java, | ||
exampleInstance = AgentActorDesign( | ||
actors = listOf( | ||
ActorDesign( | ||
name = "Actor 1", | ||
description = "Actor 1 description", | ||
type = "Simple", | ||
resultClass = "String", | ||
) | ||
) | ||
), | ||
model = model, | ||
temperature = temperature, | ||
parsingModel = OpenAIModels.GPT4oMini, | ||
prompt = """ | ||
You are an AI actor designer. | ||
Your task is to expand on a high-level design with requirements for each actor. | ||
For each actor in the given design, detail: | ||
1. The purpose of the actor | ||
2. Actor Type, which can be one of: | ||
1. "Simple" actors work like a chatbot, and simply return the chat model's response to the system and user prompts | ||
2. "Parsed" actors produce complex data structures as output, which can be used in the application logic | ||
* **IMPORTANT**: If the output is a string, use a "simple" actor instead | ||
3. "Coding" actors are used to invoke tools via dynamically compiled scripts | ||
4. "Image" actors produce images from a user (and system) prompt. | ||
3. Required details for each actor type: | ||
1. Simple and Image actors | ||
1. System prompt | ||
2. Parsed actors | ||
1. system prompt | ||
2. output data structure | ||
1. java class name | ||
2. definition | ||
3. Coding actors | ||
1. defined symbols and functions | ||
2. libraries used | ||
""".trimIndent() | ||
) |
78 changes: 78 additions & 0 deletions
78
webui/src/main/kotlin/com/simiacryptus/skyenet/apps/meta/CodingActorDesigner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package com.simiacryptus.skyenet.apps.meta | ||
|
||
import com.simiacryptus.jopenai.models.ChatModels | ||
import com.simiacryptus.skyenet.apps.meta.FlowStepDesigner.Companion.fixups | ||
import com.simiacryptus.skyenet.core.actors.CodingActor | ||
import com.simiacryptus.skyenet.interpreter.Interpreter | ||
import kotlin.reflect.KClass | ||
|
||
class CodingActorDesigner( | ||
interpreterClass: KClass<out Interpreter>, | ||
symbols: Map<String, Any>, | ||
model: ChatModels, | ||
temperature: Double | ||
) : CodingActor( | ||
interpreterClass = interpreterClass, | ||
symbols = symbols, | ||
details = """ | ||
| | ||
|Your task is to design a system that uses gpt "actors" to form a "community" of actors interacting to solve problems. | ||
|Your task is to implement a "script" or "coding" actor that takes part in a larger system. | ||
|"Script" actors use a multi-stage process that combines an environment definition of predefined symbols/functions and a pluggable script compilation system using Scala, Kotlin, or Groovy. The actor will return a valid script with a convenient "execute" method. This can provide both simple function calling responses and complex code generation. | ||
| | ||
|For context, here is the constructor signature for CodingActor class: | ||
|```kotlin | ||
|package com.simiacryptus.skyenet.core.actors | ||
| | ||
|import com.simiacryptus.jopenai.models.OpenAIModels | ||
|import com.simiacryptus.jopenai.describe.AbbrevWhitelistYamlDescriber | ||
|import com.simiacryptus.jopenai.describe.TypeDescriber | ||
|import com.simiacryptus.skyenet.interpreter.Interpreter | ||
|import kotlin.reflect.KClass | ||
| | ||
|class CodingActor( | ||
| val interpreterClass: KClass<out Interpreter>, | ||
| val symbols: Map<String, Any> = mapOf(), | ||
| val describer: TypeDescriber = AbbrevWhitelistYamlDescriber( | ||
| "com.simiacryptus", | ||
| "com.github.simiacryptus" | ||
| ), | ||
| name: String? = interpreterClass.simpleName, | ||
| val details: String? = null, | ||
| model: OpenAITextModel = OpenAIModels.GPT4o, | ||
| val fallbackModel: ChatModels = OpenAIModels.GPT4o, | ||
| temperature: Double = 0.1, | ||
|) | ||
|``` | ||
| | ||
|In this code example an example actor is defined with a prompt, name, and a standard configuration: | ||
|```kotlin | ||
|import com.simiacryptus.skyenet.core.actors.CodingActor | ||
|import com.simiacryptus.skyenet.kotlin.KotlinInterpreter | ||
| | ||
|fun exampleCodingActor() = CodingActor( | ||
| interpreterClass = KotlinInterpreter::class, | ||
| details = ""${'"'} | ||
| |You are a software implementation assistant. | ||
| | | ||
| |Defined functions: | ||
| |* ... | ||
| | | ||
| |Expected code structure: | ||
| |* ... | ||
| ""${'"'}.trimMargin().trim(), | ||
|) | ||
|``` | ||
| | ||
|Respond to the request with an instantiation function of the requested actor, similar to the provided example. | ||
|DO NOT subclass the CodingActor class. Use the constructor directly within the function. | ||
| | ||
""".trimMargin().trim(), | ||
model = model, | ||
temperature = temperature, | ||
) { | ||
init { | ||
evalFormat = false | ||
codeInterceptor = { fixups(it) } | ||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
webui/src/main/kotlin/com/simiacryptus/skyenet/apps/meta/DetailDesigner.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.simiacryptus.skyenet.apps.meta | ||
|
||
import com.simiacryptus.jopenai.models.ChatModels | ||
import com.simiacryptus.jopenai.models.OpenAIModels | ||
import com.simiacryptus.skyenet.core.actors.ParsedActor | ||
|
||
class DetailDesigner( | ||
model: ChatModels, | ||
temperature: Double | ||
) : ParsedActor<AgentFlowDesign>( | ||
resultClass = AgentFlowDesign::class.java, | ||
exampleInstance = AgentFlowDesign( | ||
name = "TextAnalyzer", | ||
description = "Analyze input text for sentiment and key topics", | ||
mainInput = DataInfo( | ||
type = "String", | ||
description = "raw text" | ||
), | ||
logicFlow = LogicFlow( | ||
items = listOf( | ||
LogicFlowItem( | ||
name = "Preprocess text", | ||
description = "Preprocess text (remove noise, normalize)", | ||
actors = listOf( | ||
"TextPreprocessor" | ||
), | ||
inputs = listOf( | ||
DataInfo( | ||
type = "String", | ||
description = "raw text" | ||
) | ||
), | ||
output = DataInfo( | ||
type = "String", | ||
description = "preprocessed text" | ||
) | ||
), | ||
) | ||
) | ||
), | ||
model = model, | ||
temperature = temperature, | ||
parsingModel = OpenAIModels.GPT4o, | ||
prompt = """ | ||
You are an expert detailed software designer specializing in AI agent systems. | ||
Your task is to expand on the high-level architecture and design a detailed "agent" system that uses GPT "actors" to model a creative process. | ||
The system should have a procedural overall structure, with creative steps implemented by GPT actors. | ||
Consider the following system interactions: | ||
1. File storage and retrieval: Design a shared session folder accessible by both the user and the application. | ||
2. Concurrent operations: Plan for individual actors and actions to run in parallel using Java threading. | ||
Design user interactions including: | ||
1. Rich message display: HTML and image rendering in the web interface. | ||
2. User input mechanisms: Text input fields and clickable links with callback handling. | ||
Incorporate these important design patterns: | ||
1. Iterative Thinking: Implement user feedback loops and step-by-step processing using sequences of specialized actors. | ||
2. Parse-and-Expand: Use an initial actor to generate a base data structure, then expand it using various (potentially recursive) actors. | ||
3. File Builder: Design the main web interface for monitoring and control, with primary outputs written to files and displayed as links. | ||
Your detailed design output should include: | ||
1. Actor Specifications: For each actor, provide: | ||
* Purpose and description | ||
* Input and output formats | ||
* Key responsibilities and operations | ||
2. Logic Flow: Detailed pseudocode for the overall system flow | ||
3. Data Structures: Specifications for data structures used to pass and handle information between actors | ||
4. User Interface: Mockup or description of key UI components and their functionality | ||
5. File Management: Strategy for file storage, retrieval, and organization | ||
6. Concurrency Plan: Outline of how parallel operations will be managed | ||
Example Actor Specification: | ||
Actor: TextAnalyzer | ||
Purpose: Analyze input text for sentiment and key topics | ||
Inputs: String (raw text) | ||
Outputs: | ||
* Float (sentiment score from -1 to 1) | ||
* List<String> (key topics) | ||
Operations: | ||
1. Preprocess text (remove noise, normalize) | ||
2. Perform sentiment analysis | ||
3. Extract key topics using NLP techniques | ||
Ensure your design is comprehensive, clear, and ready for implementation. | ||
""".trimIndent() | ||
) |
Oops, something went wrong.