-
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.
* recording * fixed prism, moved platform * added code chat * Input ui enhancements * Fixes for CodingActor
- Loading branch information
1 parent
0558081
commit aa1078b
Showing
62 changed files
with
1,219 additions
and
619 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
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
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
26 changes: 26 additions & 0 deletions
26
core/src/main/kotlin/com/simiacryptus/skyenet/actors/ActorSystem.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,26 @@ | ||
package com.simiacryptus.skyenet.actors | ||
|
||
import com.simiacryptus.skyenet.actors.record.* | ||
import com.simiacryptus.skyenet.platform.DataStorage | ||
import com.simiacryptus.skyenet.util.FunctionWrapper | ||
import com.simiacryptus.skyenet.util.JsonFunctionRecorder | ||
import java.io.File | ||
|
||
open class ActorSystem<T:Enum<*>>( | ||
private val actors: Map<T, BaseActor<*>>, | ||
private val dataStorage: DataStorage, | ||
val userId: String?, | ||
val sessionId: String | ||
) { | ||
val sessionDir = dataStorage.getSessionDir(userId, sessionId) | ||
fun getActor(actor: T): BaseActor<*> { | ||
val wrapper = FunctionWrapper(JsonFunctionRecorder(File(sessionDir, "${actor.name}.json"))) | ||
return when (val baseActor = actors[actor]) { | ||
null -> throw RuntimeException("No actor for $actor") | ||
is SimpleActor -> RecordingSimpleActor(baseActor, wrapper) | ||
is ParsedActor<*> -> RecordingParsedActor(baseActor, wrapper) | ||
is CodingActor -> RecordingCodingActor(baseActor, wrapper) | ||
else -> throw RuntimeException("Unknown actor type: ${baseActor.javaClass}") | ||
} | ||
} | ||
} |
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
7 changes: 4 additions & 3 deletions
7
core/src/main/kotlin/com/simiacryptus/skyenet/actors/ParsedResponse.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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package com.simiacryptus.skyenet.actors | ||
|
||
interface ParsedResponse<T> { | ||
fun getText(): String | ||
fun getObj(): T | ||
abstract class ParsedResponse<T>(val clazz: Class<T>) { | ||
abstract fun getText(): String | ||
abstract fun getObj(clazz: Class<T>): T | ||
fun getObj(): T = getObj(clazz) | ||
} |
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
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
Oops, something went wrong.