docs: annotate Foundry source and deployment lifecycle in Chinese [skip ci]

This commit is contained in:
2026-11-16 17:52:11 +08:00
parent 30829eeb86
commit 1090591503
123 changed files with 1279 additions and 3 deletions
+6
View File
@@ -1,3 +1,4 @@
// AI 图片输出持久化与模型输入/输出模态能力检查。
package platform
import (
@@ -10,6 +11,8 @@ import (
"gitea.entroia.com/Zayden-Jung/foundry-core/internal/codex"
)
// persistCanvasImage 完整解码 worker 图片并核对 MIME,以 outputID 作为幂等键存原图。
// 先绑定 run 来源素材,使冲突输出在用户显式应用前仍能按原 run 权限读取。
func (s *service) persistCanvasImage(ctx context.Context, tx *sql.Tx, run canvasQueueRun, outputID string, image *codex.CanvasImage) (response, error) {
if image == nil || len(image.Data) == 0 || len(image.Data) > assetLimit {
return nil, errors.New("invalid_image_output")
@@ -32,6 +35,8 @@ func (s *service) persistCanvasImage(ctx context.Context, tx *sql.Tx, run canvas
}
return response{"output_id": outputID, "kind": "image", "assetId": id, "src": s.assetURL(run.Project, run.Workspace, id), "mime_type": mime, "bytes": len(image.Data), "width": width, "height": height}, nil
}
// canvasModelSupports 检查输出模态;支持图片输入并不意味着可生成图片。
func canvasModelSupports(model codex.CanvasModel, modality string) bool {
for _, value := range model.OutputModalities {
if value == modality {
@@ -41,6 +46,7 @@ func canvasModelSupports(model codex.CanvasModel, modality string) bool {
return false
}
// canvasModelAccepts 检查输入模态,准入阶段据此拒绝给纯文本输入模型喂图。
func canvasModelAccepts(model codex.CanvasModel, modality string) bool {
for _, value := range model.InputModalities {
if value == modality {