import web.rest.aiChat;
var ai = web.rest.aiChat(
url = "https://index-translate.bilibili.com/v1";
model = "Index-Translate-35B-A3B"
)
import winex.tooltip;
// 1. 流式
ai.messages('讲个笑话',//字符串参数自动转换为 web.rest.aiChat.messages 对象
function(deltaText,reasoning){
winex.tooltip.popupDelta(deltaText,-1,-1);
}
)
winex.tooltip.wait();// UI 线程不需要这句
// 2. 非流式,字符串参数自动转换为 web.rest.aiChat.messages 对象
// var text,err,errCode = ai.getText("直接翻译为英文(不要解释):你好");
// print(text);
Markdown 格式