Skip to content

Commit e6e69dd

Browse files
committed
wip
1 parent 8a29399 commit e6e69dd

File tree

8 files changed

+36
-10
lines changed

8 files changed

+36
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ settings.gradle.kts
1313
*.data
1414
*.parsed.json
1515
package-lock.json
16+
.kotlin/

core/src/main/kotlin/com/simiacryptus/skyenet/core/actors/ImageActor.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ open class ImageActor(
2222
temperature: Double = 0.3,
2323
val width: Int = 1024,
2424
val height: Int = 1024,
25+
var openAI: OpenAIClient? = null,
2526
) : BaseActor<List<String>, ImageResponse>(
2627
prompt = prompt,
2728
name = name,
@@ -78,7 +79,7 @@ open class ImageActor(
7879
api = api
7980
).choices.first().message?.content ?: throw RuntimeException("No response")
8081
}
81-
return ImageResponseImpl(text, api = this.openAI!!)
82+
return ImageResponseImpl(text, api = this.openAI ?: throw RuntimeException("No API"))
8283
}
8384

8485
override fun withModel(model: ChatModel): ImageActor = ImageActor(
@@ -89,9 +90,9 @@ open class ImageActor(
8990
temperature = temperature,
9091
width = width,
9192
height = height,
93+
openAI = openAI
9294
)
9395

94-
var openAI: OpenAIClient? = null
9596
fun setImageAPI(openAI: OpenAIClient): ImageActor {
9697
this.openAI = openAI
9798
return this
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
| Task Type | Description | Key Features | Input | Output | Special Considerations |
2+
|-----------------------|--------------------------------------|---------------------------------------------------------------------------------|----------------------------------------------------|-----------------------------------------------------|------------------------------------------|
3+
| AbstractTask | Base class for task execution | - State management<br>- Code file handling<br>- Dependency tracking | - PlanSettings<br>- TaskConfigBase | - Task execution results<br>- State updates | Must implement promptSegment() and run() |
4+
| CommandAutoFixTask | Executes commands with auto-fixing | - Auto-fix capability<br>- Command resolution<br>- Working directory management | - Command list<br>- Working directory | - Command execution results<br>- Fix attempts | Max 5 retry attempts |
5+
| CommandSessionTask | Manages interactive command sessions | - Session persistence<br>- Multiple command execution<br>- State maintenance | - Command list<br>- Session ID<br>- Timeout | - Command outputs<br>- Session state | Max 10 concurrent sessions |
6+
| ForeachTask | Executes tasks on multiple items | - Sequential iteration<br>- Subtask management<br>- Progress tracking | - Item list<br>- Subtask definitions | - Per-item results<br>- Overall status | Maintains dependencies per iteration |
7+
| GitHubSearchTask | Searches GitHub content | - Multi-type search<br>- Result formatting<br>- Sorting options | - Search query<br>- Search type<br>- Result count | - Formatted results<br>- Metadata | Requires GitHub API token |
8+
| GoogleSearchTask | Performs Google searches | - Web search<br>- Result formatting<br>- Metadata inclusion | - Search query<br>- Result count | - Formatted results<br>- Pagemap data | Requires Google API credentials |
9+
| FileModificationTask | Modifies code files | - File creation/modification<br>- Code quality maintenance<br>- Diff generation | - Input files<br>- Modifications | - Modified files<br>- Change documentation | Supports auto-fix mode |
10+
| DocumentationTask | Generates code documentation | - Documentation generation<br>- Format handling<br>- Change management | - Source files<br>- Topics | - Documentation files<br>- Inline comments | Supports manual/auto approval |
11+
| SecurityAuditTask | Performs security analysis | - Vulnerability detection<br>- Standards compliance<br>- Fix suggestions | - Source files<br>- Focus areas | - Audit report<br>- Fix recommendations | Security-focused analysis |
12+
| TestGenerationTask | Creates test suites | - Test case generation<br>- Framework integration<br>- Coverage optimization | - Source files<br>- References | - Test files<br>- Test documentation | Language-specific output |
13+
| EmbeddingSearchTask | Semantic search functionality | - Embedding-based search<br>- Query filtering<br>- Distance metrics | - Positive/negative queries<br>- Search parameters | - Ranked results<br>- Context summaries | Requires indexed content |
14+
| KnowledgeIndexingTask | Indexes content for search | - Content processing<br>- Chunk generation<br>- Parallel processing | - File paths<br>- Parsing type | - Indexed content<br>- Progress reports | Uses thread pool |
15+
| WebSearchAndIndexTask | Search and index web content | - Web search<br>- Content download<br>- Indexing | - Search query<br>- Result count | - Downloaded content<br>- Index files | Max 10 search results |
16+
| CodeOptimizationTask | Optimizes code performance | - Performance analysis<br>- Code optimization<br>- Impact assessment | - Files to optimize<br>- Optimization focus | - Optimization suggestions<br>- Performance metrics | Maintains code readability |
17+
| RefactorTask | Refactors code structure | - Code restructuring<br>- Pattern application<br>- Quality improvement | - Files to refactor<br>- Refactoring focus | - Refactored code<br>- Change documentation | Preserves functionality |
18+
| InquiryTask | Analyzes code and answers questions | - Code analysis<br>- Question answering<br>- Context awareness | - Input files<br>- Questions<br>- Inquiry goal | - Detailed answers<br>- Analysis report | Supports interactive mode |

webui/src/main/kotlin/com/simiacryptus/skyenet/apps/general/SingleTaskApp.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ open class SingleTaskApp(
8383
val describer = planSettings.describer()
8484
val taskConfig = ParsedActor(
8585
name = "SingleTaskChooser",
86-
resultClass = TaskConfigBase::class.java,
86+
resultClass = taskType.taskDataClass,
8787
prompt = """
8888
Given the following input, choose ONE task to execute. Do not create a full plan, just select the most appropriate task types for the given input.
8989
Available task types:

webui/src/main/kotlin/com/simiacryptus/skyenet/apps/general/WebDevApp.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.simiacryptus.skyenet.apps.general
33
import com.simiacryptus.diff.addApplyFileDiffLinks
44
import com.simiacryptus.jopenai.API
55
import com.simiacryptus.jopenai.ChatClient
6+
import com.simiacryptus.jopenai.OpenAIClient
67
import com.simiacryptus.jopenai.describe.Description
78
import com.simiacryptus.jopenai.models.ApiModel
89
import com.simiacryptus.jopenai.models.ApiModel.Role
@@ -36,6 +37,7 @@ open class WebDevApp(
3637
applicationName: String = "Web Dev Assistant v1.2",
3738
open val symbols: Map<String, Any> = mapOf(),
3839
val temperature: Double = 0.1,
40+
val api2: OpenAIClient,
3941
) : ApplicationServer(
4042
applicationName = applicationName,
4143
path = "/webdev",
@@ -59,6 +61,7 @@ open class WebDevApp(
5961
model = settings.model,
6062
parsingModel = settings.parsingModel,
6163
root = root,
64+
api2 = api2,
6265
).start(
6366
userMessage = userMessage,
6467
)
@@ -79,6 +82,7 @@ open class WebDevApp(
7982

8083
class WebDevAgent(
8184
val api: API,
85+
val api2: OpenAIClient,
8286
dataStorage: StorageInterface,
8387
session: Session,
8488
user: User?,
@@ -174,7 +178,9 @@ class WebDevAgent(
174178
""".trimMargin(),
175179
textModel = model,
176180
imageModel = ImageModels.DallE3,
177-
),
181+
).apply {
182+
setImageAPI(api2)
183+
},
178184
),
179185
val root: File,
180186
) : ActorSystem<WebDevAgent.ActorTypes>(actorMap.map { it.key.name to it.value }.toMap(), dataStorage, user, session) {

webui/src/main/kotlin/com/simiacryptus/skyenet/apps/plan/TaskConfigBase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.simiacryptus.jopenai.describe.Description
99

1010
@JsonTypeIdResolver(TaskConfigBase.PlanTaskTypeIdResolver::class)
1111
@JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "task_type")
12-
abstract class TaskConfigBase(
12+
open class TaskConfigBase(
1313
@Description("An enumeration indicating the type of task to be executed. Must be a single value from the TaskType enum.")
1414
val task_type: String? = null,
1515
@Description("A detailed description of the specific task to be performed, including its role in the overall plan and its dependencies on other tasks.")

webui/src/main/kotlin/com/simiacryptus/skyenet/webui/test/ImageActorTestApp.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import org.slf4j.LoggerFactory
1313
open class ImageActorTestApp(
1414
private val actor: ImageActor,
1515
applicationName: String = "ImageActorTest_" + actor.javaClass.simpleName,
16-
temperature: Double = 0.3,
1716
) : ApplicationServer(
1817
applicationName = applicationName,
1918
path = "/imageActorTest",

webui/src/test/kotlin/com/simiacryptus/skyenet/webui/ActorTestAppServer.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ object ActorTestAppServer : com.simiacryptus.skyenet.webui.application.Applicati
7171
)
7272
)
7373
),
74-
ChildWebApp("/images", ImageActorTestApp(ImageActor(textModel = OpenAIModels.GPT4oMini))),
74+
ChildWebApp("/images", ImageActorTestApp(ImageActor(textModel = OpenAIModels.GPT4oMini).apply {
75+
openAI = OpenAIClient()
76+
})),
7577
ChildWebApp(
7678
"/test_coding_scala",
7779
CodingActorTestApp(CodingActor(ScalaLocalInterpreter::class, model = OpenAIModels.GPT4oMini))
@@ -95,21 +97,20 @@ object ActorTestAppServer : com.simiacryptus.skyenet.webui.application.Applicati
9597
temperature = 0.2,
9698
budget = 2.0,
9799
autoFix = true,
98-
commandAutoFixCommands = listOf(
99-
"C:\\Program Files\\nodejs\\npx.cmd", "C:\\Program Files\\nodejs\\npm.cmd"
100-
),
101100
env = mapOf(),
102101
workingDir = ".",
103102
language = if (isWindows) "powershell" else "bash",
104103
).apply {
105104
setTaskSettings(
106105
TaskType.TaskPlanning, TaskSettingsBase(
106+
TaskType.TaskPlanning.name,
107107
enabled = true,
108108
model = OpenAIModels.GPT4o,
109109
)
110110
)
111111
setTaskSettings(
112112
TaskType.RunShellCommand, TaskSettingsBase(
113+
TaskType.RunShellCommand.name,
113114
enabled = false,
114115
model = OpenAIModels.GPT4o,
115116
)

0 commit comments

Comments
 (0)