Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unit-mesh/unit-runtime
Unit Runtime 是一个 ChatGPT 等 AI 代码的运行环境,可一键启动并实时交互,帮助您快速构建和测试 AI 代码。Unit Runtime is an efficient and user-friendly AI code execution environment that allows for one-click startup and real-time interaction, helping you quickly build and test AI code.
https://github.com/unit-mesh/unit-runtime
copilot repl
Last synced: 3 months ago
JSON representation
Unit Runtime 是一个 ChatGPT 等 AI 代码的运行环境,可一键启动并实时交互,帮助您快速构建和测试 AI 代码。Unit Runtime is an efficient and user-friendly AI code execution environment that allows for one-click startup and real-time interaction, helping you quickly build and test AI code.
- Host: GitHub
- URL: https://github.com/unit-mesh/unit-runtime
- Owner: unit-mesh
- License: mit
- Created: 2023-03-20T02:09:02.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-06T12:26:26.000Z (about 1 year ago)
- Last Synced: 2024-06-15T11:32:45.504Z (5 months ago)
- Topics: copilot, repl
- Language: Kotlin
- Homepage:
- Size: 843 KB
- Stars: 112
- Watchers: 10
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ChatGPT-repositories - unit-runtime - Unit Runtime 是一个 ChatGPT 等 AI 代码的运行环境,可一键启动并实时交互,帮助您快速构建和测试 AI 代码。Unit Runtime is an efficient and user-friendly AI code execution environment that allows for one-click startup and real-time interaction, helping you quickly build and test AI code. (CLIs)
README
# Unit Runtime
[![CI](https://github.com/prompt-engineering/unit-runtime/actions/workflows/ci.yaml/badge.svg)](https://github.com/prompt-engineering/unit-runtime/actions/workflows/ci.yaml)
> Unit Runtime is an efficient and user-friendly AI code execution environment that allows for one-click startup and real-time interaction, helping you quickly build and test AI code.
Workflow:
```mermaid
sequenceDiagram
participant Human
participant LLM/ChatGPT
participant Unit Runtime
participant Language REPLHuman->>+LLM/ChatGPT: Provide prompt for generated code
LLM/ChatGPT->>+Unit Runtime: Provide code snippets/units
Unit Runtime->>+Language REPL: Compile and return
Language REPL-->>-Unit Runtime: Output result
Unit Runtime-->>-LLM/ChatGPT: Display processing result
LLM/ChatGPT-->>-Human: Verify/modify code
```For examples:
1. generate a "Hello, world" and send to Kotlin Repl
```kotlin
@RestController
object Pages {
@GetMapping("/")
fun main() = "Hello World!"
}
```2. will start a server like: [http://localhost:10043](http://localhost:10043) , you can test and verify it.
## Websocket API
server: `ws://localhost:8080/repl`
input:
```kotlin
@Serializable
data class InterpreterRequest(
var id: Int = -1,
val code: String,
val language: String = "kotlin",
val framework: String = "spring",
val history: Boolean = false
)
```output:
```kotlin
@Serializable
data class Message(
var id: Int = -1,
var resultValue: String,
var className: String = "",
var msgType: MessageType = MessageType.NONE,
var content: MessageContent? = null,
)
```## Todos
- Backend
- [x] Kotlin
- [x] basic REPL
- [ ] Spring Boot framework based on [https://github.com/JetBrains/kotless](https://github.com/JetBrains/kotless)
- [x] Ktor framework based on [https://github.com/JetBrains/kotless](https://github.com/JetBrains/kotless)
- [x] TypeScript
- [x] basic REPL
- [x] Deno with Hono
- [ ] Java
- [ ] Python
- [x] Frontend
- [x] React with TypeScript and Babel
- [ ] Vue
- [ ]Angular## Development
1. git clone `https://github.com/prompt-engineering/unit-runtime`
2. `./gradlew bootRun`API:
## LICENSE
This code is distributed under the MIT license. See [LICENSE](./LICENSE) in this directory.