mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-13 16:53:24 +00:00
doc: Runtime readme.md
This commit is contained in:
16
runtime/READMD.md
Normal file
16
runtime/READMD.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Runtime
|
||||||
|
一台VM運行時,用於隔離租戶環境與服務器環境,提供腿本用於調用模型流。
|
||||||
|
# 語法
|
||||||
|
```
|
||||||
|
// 使用//註解
|
||||||
|
// "雙引號字符串"
|
||||||
|
let s = "hello"
|
||||||
|
// 整數
|
||||||
|
let i = 10
|
||||||
|
// 浮點數
|
||||||
|
let f = 1.2
|
||||||
|
// 動態類型
|
||||||
|
s = i
|
||||||
|
// 返回值
|
||||||
|
return s
|
||||||
|
```
|
||||||
@ -60,14 +60,7 @@ class Runtime:
|
|||||||
def variable_declaration(self, ast):
|
def variable_declaration(self, ast):
|
||||||
id = ast.get("identifier").get("name")
|
id = ast.get("identifier").get("name")
|
||||||
v = ast.get("value")
|
v = ast.get("value")
|
||||||
if self._is_literal(v):
|
self.records[id] = self.unquote(v)
|
||||||
l = self.literal(v)
|
|
||||||
if l != None:
|
|
||||||
self.records[id] = l
|
|
||||||
else:
|
|
||||||
raise Exception("Unknown literal type: " + v.get("type"))
|
|
||||||
if self._is_identifier(v):
|
|
||||||
self.records[id] = self.records.get(v.get("name"))
|
|
||||||
|
|
||||||
def literal(self, ast):
|
def literal(self, ast):
|
||||||
if ast.get("type") == "StringLiteral":
|
if ast.get("type") == "StringLiteral":
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
import io
|
import io
|
||||||
from typing import Any, Coroutine
|
|
||||||
|
|
||||||
from fastapi import Request, Response, status
|
from fastapi import Request, Response, status
|
||||||
from fastapi.responses import JSONResponse
|
from fastapi.responses import JSONResponse
|
||||||
from .blackbox import Blackbox
|
from .blackbox import Blackbox
|
||||||
from tts.tts_service import TTService
|
from tts.tts_service import TTService
|
||||||
import time
|
|
||||||
|
|
||||||
class TTS(Blackbox):
|
class TTS(Blackbox):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user