From 1ed2f9af6857501149f50e796cd0b97ecaf25c8c Mon Sep 17 00:00:00 2001 From: LittleMouse Date: Mon, 31 Mar 2025 11:28:50 +0800 Subject: [PATCH] [update] update melotts doc --- .../llm_melotts_en.md | 37 +++++++++++++++++++ .../llm_melotts_zh.md | 36 ++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/doc/projects_llm_framework_doc/llm_melotts_en.md b/doc/projects_llm_framework_doc/llm_melotts_en.md index 66a705f..f45eb0e 100644 --- a/doc/projects_llm_framework_doc/llm_melotts_en.md +++ b/doc/projects_llm_framework_doc/llm_melotts_en.md @@ -53,6 +53,43 @@ Response JSON: - created: Message creation time, UNIX time. - work_id: Successfully created work_id unit. +## inference + +### streaming input + +```json +{ + "request_id": "2", + "work_id": "melotts.1003", + "action": "inference", + "object": "melotts.utf-8.stream", + "data": { + "delta": "What's ur name?", + "index": 0, + "finish": true + } +} +``` +- object: The data type transmitted is melotts.utf-8.stream, indicating a streaming input from the user's UTF-8. +- delta: Segment data of the streaming input. +- index: Index of the segment in the streaming input. +- finish: A flag indicating whether the streaming input has completed. + +### non-streaming input + +```json +{ + "request_id": "2", + "work_id": "melotts.1003", + "action": "inference", + "object": "melotts.utf-8", + "data": "What's ur name?" +} +``` + +- object: The data type transmitted is melotts.utf-8, indicating a non-streaming input from the user's UTF-8. +- data: Data for non-streaming input. + ## link Link the output of the upper-level unit. diff --git a/doc/projects_llm_framework_doc/llm_melotts_zh.md b/doc/projects_llm_framework_doc/llm_melotts_zh.md index 40d40c8..7d23b51 100644 --- a/doc/projects_llm_framework_doc/llm_melotts_zh.md +++ b/doc/projects_llm_framework_doc/llm_melotts_zh.md @@ -51,6 +51,42 @@ - created:消息创建时间,unix 时间。 - work_id:返回成功创建的 work_id 单元。 +## inference + +### 流式输入 + +```json +{ + "request_id": "2", + "work_id": "melotts.1003", + "action": "inference", + "object": "melotts.utf-8.stream", + "data": { + "delta": "今天天气真好!", + "index": 0, + "finish": true + } +} +``` +- object:传输的数据类型为 `melotts.utf-8.stream` 代表的是从用户 utf-8 的流式输入 +- delta:流式输入的分段数据 +- index:流式输入的分段索引 +- finish:流式输入是否完成的标志位 + +### 非流式输入 + +```json +{ + "request_id": "2", + "work_id": "melotts.1003", + "action": "inference", + "object": "melotts.utf-8", + "data": "今天天气真好!" +} +``` +- object:传输的数据类型为 `melotts.utf-8` 代表的是从用户 utf-8 的非流式输入 +- data:非流式输入的数据 + ## link 链接上级单元的输出。