Skip to content

Commit

Permalink
✨feature(1.0.1): 支持模型选择
Browse files Browse the repository at this point in the history
  • Loading branch information
vacuityv committed Feb 4, 2024
1 parent c57d773 commit aa2afb0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ function translate(query, completion) {

if (streamSupFlag && useStreamFlag === 'y') {
// newTrans(query, completion);
$log.info("vac-body" + initReqBody(query));
websocketTrans(query, completion);
} else {
oldTranslate(query, completion);
}
}

function oldTranslate(query, completion) {
$log.info("vac-body" + initReqBody(query));
$http.request({
method: "POST",
url: usaHttp,
Expand Down Expand Up @@ -116,7 +118,7 @@ function initWebsocket() {
vacUrl = usaWss;

if (websocket == null) {
$log.info(`initWebsocket`)
$log.info(`initWebsocket`+ vacUrl);
websocket = $websocket.new({
url: vacUrl,
allowSelfSignedSSLCertificates: true,
Expand Down Expand Up @@ -181,7 +183,7 @@ function sendSocketMsg(msg) {
initWebsocket();
}
if (websocket.readyState == 1) {
$log.info('readyState == 1')
$log.info('readyState == 1' + msg)
websocket.sendString(msg);
} else {
var stateTimerId = $timer.schedule({
Expand Down Expand Up @@ -228,7 +230,6 @@ function initReqBody(query) {
var password = $option.loginPassword;
var modelType = $option.modelType;
var content = query['text'];

return {
email: account,
password: password,
Expand Down

0 comments on commit aa2afb0

Please sign in to comment.