g-ai-robot3 0.1.27 → 0.1.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/g-ai-robot3.common.js +333 -68
- package/dist/g-ai-robot3.css +1 -1
- package/dist/g-ai-robot3.umd.js +333 -68
- package/dist/g-ai-robot3.umd.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,9 +39,21 @@ import "g-ai-robot3/dist/g-ai-robot3.css"
|
|
|
39
39
|
| openInstruct | 是否开启指令控制 |Boolean | true/false | true |
|
|
40
40
|
| qaServer | 问答服务地址 |String | - | - |
|
|
41
41
|
| audioServer | 语音服务地址 |String | - | - |
|
|
42
|
+
| cozeInfo | 扣字大模型参数 |Object | - | - |
|
|
42
43
|
| wsServer | 语音监听地址 |String | - | - |
|
|
43
44
|
| instructWs | 指令监听地址 |String | - | - |
|
|
44
45
|
| eventFun | 触发事件 |Array | - | - |
|
|
46
|
+
| searchTextCallback | 扣子大模型事件流回调函数 |Function | - | - |
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# cozeInfo
|
|
51
|
+
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
52
|
+
|---------- |-------------------|------------|---------|---------|
|
|
53
|
+
| iss | | String | - | - |
|
|
54
|
+
| kid | | String | - | - |
|
|
55
|
+
| private_key | | String | - | - |
|
|
56
|
+
| bot_id | | String | - | - |
|
|
45
57
|
|
|
46
58
|
|
|
47
59
|
# eventFun
|
|
@@ -217,6 +217,44 @@ module.exports = function (it) {
|
|
|
217
217
|
};
|
|
218
218
|
|
|
219
219
|
|
|
220
|
+
/***/ }),
|
|
221
|
+
|
|
222
|
+
/***/ 6955:
|
|
223
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
224
|
+
|
|
225
|
+
"use strict";
|
|
226
|
+
|
|
227
|
+
var TO_STRING_TAG_SUPPORT = __webpack_require__(2140);
|
|
228
|
+
var isCallable = __webpack_require__(4901);
|
|
229
|
+
var classofRaw = __webpack_require__(2195);
|
|
230
|
+
var wellKnownSymbol = __webpack_require__(8227);
|
|
231
|
+
|
|
232
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
233
|
+
var $Object = Object;
|
|
234
|
+
|
|
235
|
+
// ES3 wrong here
|
|
236
|
+
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
|
237
|
+
|
|
238
|
+
// fallback for IE11 Script Access Denied error
|
|
239
|
+
var tryGet = function (it, key) {
|
|
240
|
+
try {
|
|
241
|
+
return it[key];
|
|
242
|
+
} catch (error) { /* empty */ }
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// getting tag from ES6+ `Object.prototype.toString`
|
|
246
|
+
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
|
247
|
+
var O, tag, result;
|
|
248
|
+
return it === undefined ? 'Undefined' : it === null ? 'Null'
|
|
249
|
+
// @@toStringTag case
|
|
250
|
+
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
|
251
|
+
// builtinTag case
|
|
252
|
+
: CORRECT_ARGUMENTS ? classofRaw(O)
|
|
253
|
+
// ES3 arguments fallback
|
|
254
|
+
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
|
|
220
258
|
/***/ }),
|
|
221
259
|
|
|
222
260
|
/***/ 7740:
|
|
@@ -278,6 +316,23 @@ module.exports = function (bitmap, value) {
|
|
|
278
316
|
};
|
|
279
317
|
|
|
280
318
|
|
|
319
|
+
/***/ }),
|
|
320
|
+
|
|
321
|
+
/***/ 2106:
|
|
322
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
323
|
+
|
|
324
|
+
"use strict";
|
|
325
|
+
|
|
326
|
+
var makeBuiltIn = __webpack_require__(283);
|
|
327
|
+
var defineProperty = __webpack_require__(4913);
|
|
328
|
+
|
|
329
|
+
module.exports = function (target, name, descriptor) {
|
|
330
|
+
if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
|
|
331
|
+
if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
|
|
332
|
+
return defineProperty.f(target, name, descriptor);
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
|
|
281
336
|
/***/ }),
|
|
282
337
|
|
|
283
338
|
/***/ 6840:
|
|
@@ -1545,6 +1600,40 @@ module.exports = function (argument) {
|
|
|
1545
1600
|
};
|
|
1546
1601
|
|
|
1547
1602
|
|
|
1603
|
+
/***/ }),
|
|
1604
|
+
|
|
1605
|
+
/***/ 2140:
|
|
1606
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1607
|
+
|
|
1608
|
+
"use strict";
|
|
1609
|
+
|
|
1610
|
+
var wellKnownSymbol = __webpack_require__(8227);
|
|
1611
|
+
|
|
1612
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
1613
|
+
var test = {};
|
|
1614
|
+
|
|
1615
|
+
test[TO_STRING_TAG] = 'z';
|
|
1616
|
+
|
|
1617
|
+
module.exports = String(test) === '[object z]';
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
/***/ }),
|
|
1621
|
+
|
|
1622
|
+
/***/ 655:
|
|
1623
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1624
|
+
|
|
1625
|
+
"use strict";
|
|
1626
|
+
|
|
1627
|
+
var classof = __webpack_require__(6955);
|
|
1628
|
+
|
|
1629
|
+
var $String = String;
|
|
1630
|
+
|
|
1631
|
+
module.exports = function (argument) {
|
|
1632
|
+
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1633
|
+
return $String(argument);
|
|
1634
|
+
};
|
|
1635
|
+
|
|
1636
|
+
|
|
1548
1637
|
/***/ }),
|
|
1549
1638
|
|
|
1550
1639
|
/***/ 6823:
|
|
@@ -1617,6 +1706,21 @@ module.exports = DESCRIPTORS && fails(function () {
|
|
|
1617
1706
|
});
|
|
1618
1707
|
|
|
1619
1708
|
|
|
1709
|
+
/***/ }),
|
|
1710
|
+
|
|
1711
|
+
/***/ 2812:
|
|
1712
|
+
/***/ (function(module) {
|
|
1713
|
+
|
|
1714
|
+
"use strict";
|
|
1715
|
+
|
|
1716
|
+
var $TypeError = TypeError;
|
|
1717
|
+
|
|
1718
|
+
module.exports = function (passed, required) {
|
|
1719
|
+
if (passed < required) throw new $TypeError('Not enough arguments');
|
|
1720
|
+
return passed;
|
|
1721
|
+
};
|
|
1722
|
+
|
|
1723
|
+
|
|
1620
1724
|
/***/ }),
|
|
1621
1725
|
|
|
1622
1726
|
/***/ 8622:
|
|
@@ -1709,6 +1813,128 @@ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
|
|
1709
1813
|
});
|
|
1710
1814
|
|
|
1711
1815
|
|
|
1816
|
+
/***/ }),
|
|
1817
|
+
|
|
1818
|
+
/***/ 4603:
|
|
1819
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
1820
|
+
|
|
1821
|
+
"use strict";
|
|
1822
|
+
|
|
1823
|
+
var defineBuiltIn = __webpack_require__(6840);
|
|
1824
|
+
var uncurryThis = __webpack_require__(9504);
|
|
1825
|
+
var toString = __webpack_require__(655);
|
|
1826
|
+
var validateArgumentsLength = __webpack_require__(2812);
|
|
1827
|
+
|
|
1828
|
+
var $URLSearchParams = URLSearchParams;
|
|
1829
|
+
var URLSearchParamsPrototype = $URLSearchParams.prototype;
|
|
1830
|
+
var append = uncurryThis(URLSearchParamsPrototype.append);
|
|
1831
|
+
var $delete = uncurryThis(URLSearchParamsPrototype['delete']);
|
|
1832
|
+
var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
|
1833
|
+
var push = uncurryThis([].push);
|
|
1834
|
+
var params = new $URLSearchParams('a=1&a=2&b=3');
|
|
1835
|
+
|
|
1836
|
+
params['delete']('a', 1);
|
|
1837
|
+
// `undefined` case is a Chromium 117 bug
|
|
1838
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=14222
|
|
1839
|
+
params['delete']('b', undefined);
|
|
1840
|
+
|
|
1841
|
+
if (params + '' !== 'a=2') {
|
|
1842
|
+
defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {
|
|
1843
|
+
var length = arguments.length;
|
|
1844
|
+
var $value = length < 2 ? undefined : arguments[1];
|
|
1845
|
+
if (length && $value === undefined) return $delete(this, name);
|
|
1846
|
+
var entries = [];
|
|
1847
|
+
forEach(this, function (v, k) { // also validates `this`
|
|
1848
|
+
push(entries, { key: k, value: v });
|
|
1849
|
+
});
|
|
1850
|
+
validateArgumentsLength(length, 1);
|
|
1851
|
+
var key = toString(name);
|
|
1852
|
+
var value = toString($value);
|
|
1853
|
+
var index = 0;
|
|
1854
|
+
var dindex = 0;
|
|
1855
|
+
var found = false;
|
|
1856
|
+
var entriesLength = entries.length;
|
|
1857
|
+
var entry;
|
|
1858
|
+
while (index < entriesLength) {
|
|
1859
|
+
entry = entries[index++];
|
|
1860
|
+
if (found || entry.key === key) {
|
|
1861
|
+
found = true;
|
|
1862
|
+
$delete(this, entry.key);
|
|
1863
|
+
} else dindex++;
|
|
1864
|
+
}
|
|
1865
|
+
while (dindex < entriesLength) {
|
|
1866
|
+
entry = entries[dindex++];
|
|
1867
|
+
if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
|
|
1868
|
+
}
|
|
1869
|
+
}, { enumerable: true, unsafe: true });
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
/***/ }),
|
|
1874
|
+
|
|
1875
|
+
/***/ 7566:
|
|
1876
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
1877
|
+
|
|
1878
|
+
"use strict";
|
|
1879
|
+
|
|
1880
|
+
var defineBuiltIn = __webpack_require__(6840);
|
|
1881
|
+
var uncurryThis = __webpack_require__(9504);
|
|
1882
|
+
var toString = __webpack_require__(655);
|
|
1883
|
+
var validateArgumentsLength = __webpack_require__(2812);
|
|
1884
|
+
|
|
1885
|
+
var $URLSearchParams = URLSearchParams;
|
|
1886
|
+
var URLSearchParamsPrototype = $URLSearchParams.prototype;
|
|
1887
|
+
var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
|
|
1888
|
+
var $has = uncurryThis(URLSearchParamsPrototype.has);
|
|
1889
|
+
var params = new $URLSearchParams('a=1');
|
|
1890
|
+
|
|
1891
|
+
// `undefined` case is a Chromium 117 bug
|
|
1892
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=14222
|
|
1893
|
+
if (params.has('a', 2) || !params.has('a', undefined)) {
|
|
1894
|
+
defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {
|
|
1895
|
+
var length = arguments.length;
|
|
1896
|
+
var $value = length < 2 ? undefined : arguments[1];
|
|
1897
|
+
if (length && $value === undefined) return $has(this, name);
|
|
1898
|
+
var values = getAll(this, name); // also validates `this`
|
|
1899
|
+
validateArgumentsLength(length, 1);
|
|
1900
|
+
var value = toString($value);
|
|
1901
|
+
var index = 0;
|
|
1902
|
+
while (index < values.length) {
|
|
1903
|
+
if (values[index++] === value) return true;
|
|
1904
|
+
} return false;
|
|
1905
|
+
}, { enumerable: true, unsafe: true });
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
/***/ }),
|
|
1910
|
+
|
|
1911
|
+
/***/ 8721:
|
|
1912
|
+
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
|
1913
|
+
|
|
1914
|
+
"use strict";
|
|
1915
|
+
|
|
1916
|
+
var DESCRIPTORS = __webpack_require__(3724);
|
|
1917
|
+
var uncurryThis = __webpack_require__(9504);
|
|
1918
|
+
var defineBuiltInAccessor = __webpack_require__(2106);
|
|
1919
|
+
|
|
1920
|
+
var URLSearchParamsPrototype = URLSearchParams.prototype;
|
|
1921
|
+
var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
|
1922
|
+
|
|
1923
|
+
// `URLSearchParams.prototype.size` getter
|
|
1924
|
+
// https://github.com/whatwg/url/pull/734
|
|
1925
|
+
if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
|
|
1926
|
+
defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
|
|
1927
|
+
get: function size() {
|
|
1928
|
+
var count = 0;
|
|
1929
|
+
forEach(this, function () { count++; });
|
|
1930
|
+
return count;
|
|
1931
|
+
},
|
|
1932
|
+
configurable: true,
|
|
1933
|
+
enumerable: true
|
|
1934
|
+
});
|
|
1935
|
+
}
|
|
1936
|
+
|
|
1937
|
+
|
|
1712
1938
|
/***/ })
|
|
1713
1939
|
|
|
1714
1940
|
/******/ });
|
|
@@ -1839,6 +2065,12 @@ if (typeof window !== 'undefined') {
|
|
|
1839
2065
|
var external_commonjs_vue_commonjs2_vue_root_Vue_namespaceObject = require("vue");
|
|
1840
2066
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
1841
2067
|
var es_array_push = __webpack_require__(4114);
|
|
2068
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.delete.js
|
|
2069
|
+
var web_url_search_params_delete = __webpack_require__(4603);
|
|
2070
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.has.js
|
|
2071
|
+
var web_url_search_params_has = __webpack_require__(7566);
|
|
2072
|
+
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.url-search-params.size.js
|
|
2073
|
+
var web_url_search_params_size = __webpack_require__(8721);
|
|
1842
2074
|
// EXTERNAL MODULE: ./node_modules/js-audio-recorder/index.js
|
|
1843
2075
|
var js_audio_recorder = __webpack_require__(7478);
|
|
1844
2076
|
var js_audio_recorder_default = /*#__PURE__*/__webpack_require__.n(js_audio_recorder);
|
|
@@ -5835,7 +6067,7 @@ axios.default = axios;
|
|
|
5835
6067
|
const audioConfig = {
|
|
5836
6068
|
// here: "https://wiki.keepsoft.net:39002/uploadAudio/here.mp3",
|
|
5837
6069
|
here: "https://saas.keepsoft.net:20003/uploadAudio/here.mp3",
|
|
5838
|
-
xiaogui: ['
|
|
6070
|
+
xiaogui: ['xiaoguixiaogui', ' xiaohuixiaohui', 'xiaoguaixiaoguai', 'xiaokuixiaokui']
|
|
5839
6071
|
};
|
|
5840
6072
|
;// CONCATENATED MODULE: ./node_modules/pinyin-pro/dist/index.mjs
|
|
5841
6073
|
const DoubleUnicodePrefixReg = /^[\uD800-\uDBFF]$/;
|
|
@@ -30982,7 +31214,10 @@ function segment(word, options) {
|
|
|
30982
31214
|
;// CONCATENATED MODULE: ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/src/main.vue?vue&type=script&setup=true&lang=js
|
|
30983
31215
|
|
|
30984
31216
|
|
|
30985
|
-
|
|
31217
|
+
|
|
31218
|
+
|
|
31219
|
+
|
|
31220
|
+
const _withScopeId = n => (_pushScopeId("data-v-207339b4"), n = n(), _popScopeId(), n);
|
|
30986
31221
|
const _hoisted_1 = ["src"];
|
|
30987
31222
|
const _hoisted_2 = {
|
|
30988
31223
|
key: 0,
|
|
@@ -31078,13 +31313,22 @@ const _hoisted_19 = ["src"];
|
|
|
31078
31313
|
},
|
|
31079
31314
|
qaServer: {
|
|
31080
31315
|
type: String,
|
|
31081
|
-
default: "
|
|
31316
|
+
default: "http://172.16.103.188:21215/chatGlm/searchTextNew"
|
|
31082
31317
|
},
|
|
31083
31318
|
audioServer: {
|
|
31084
31319
|
type: String,
|
|
31085
31320
|
// default: "https://172.16.103.188:8002/api21215/chatGlm/tansAudioToTextByWhisperNew",
|
|
31086
31321
|
default: "http://172.16.103.188:21215/chatGlm/tansAudioToTextByWhisperNew"
|
|
31087
31322
|
},
|
|
31323
|
+
cozeInfo: {
|
|
31324
|
+
type: Object,
|
|
31325
|
+
default: () => ({
|
|
31326
|
+
iss: "1162521163704",
|
|
31327
|
+
kid: "yUMdIm8R4DJskw-muWtFR7W3g9wHwn8UMZjL3m7_7RU",
|
|
31328
|
+
private_key: "private_key",
|
|
31329
|
+
bot_id: "7431129126334955530"
|
|
31330
|
+
})
|
|
31331
|
+
},
|
|
31088
31332
|
wsServer: {
|
|
31089
31333
|
type: String,
|
|
31090
31334
|
default: "wss://wiki.keepsoft.net:39002/ws"
|
|
@@ -31093,6 +31337,12 @@ const _hoisted_19 = ["src"];
|
|
|
31093
31337
|
type: String,
|
|
31094
31338
|
default: "wss://wiki.keepsoft.net:39002/commandWs"
|
|
31095
31339
|
},
|
|
31340
|
+
searchTextCallback: {
|
|
31341
|
+
type: Function,
|
|
31342
|
+
default: params => {
|
|
31343
|
+
console.log(params, "params");
|
|
31344
|
+
}
|
|
31345
|
+
},
|
|
31096
31346
|
eventFun: {
|
|
31097
31347
|
type: Array,
|
|
31098
31348
|
default: () => [{
|
|
@@ -31187,11 +31437,11 @@ const _hoisted_19 = ["src"];
|
|
|
31187
31437
|
}
|
|
31188
31438
|
if (bol) {
|
|
31189
31439
|
state.recorderCode = 1;
|
|
31190
|
-
recognition.stop();
|
|
31440
|
+
// recognition.stop();
|
|
31191
31441
|
iAmHere();
|
|
31192
31442
|
window.setTimeout(() => {
|
|
31193
31443
|
setRecording();
|
|
31194
|
-
},
|
|
31444
|
+
}, 2000);
|
|
31195
31445
|
}
|
|
31196
31446
|
};
|
|
31197
31447
|
const throttle = (func, wait) => {
|
|
@@ -31227,6 +31477,7 @@ const _hoisted_19 = ["src"];
|
|
|
31227
31477
|
console.log("Recognition ended.");
|
|
31228
31478
|
// 这里可以采取措施,比如重新启动语音识别
|
|
31229
31479
|
restartRecognition();
|
|
31480
|
+
// alert("监听到1分钟未说话,刷新页面后可使用!");
|
|
31230
31481
|
};
|
|
31231
31482
|
recognition.onerror = function (event) {
|
|
31232
31483
|
console.error("Error occurred in recognition: " + event.error);
|
|
@@ -31242,66 +31493,80 @@ const _hoisted_19 = ["src"];
|
|
|
31242
31493
|
|
|
31243
31494
|
// 唤醒后的录音
|
|
31244
31495
|
const setRecording = () => {
|
|
31245
|
-
state.recorder.stop();
|
|
31246
|
-
state.recorder.start()
|
|
31247
|
-
|
|
31248
|
-
|
|
31249
|
-
|
|
31250
|
-
|
|
31251
|
-
|
|
31252
|
-
|
|
31253
|
-
|
|
31254
|
-
|
|
31255
|
-
|
|
31256
|
-
|
|
31257
|
-
|
|
31258
|
-
|
|
31259
|
-
|
|
31260
|
-
|
|
31261
|
-
|
|
31262
|
-
|
|
31263
|
-
|
|
31264
|
-
|
|
31265
|
-
|
|
31266
|
-
|
|
31267
|
-
|
|
31268
|
-
|
|
31269
|
-
|
|
31270
|
-
|
|
31271
|
-
|
|
31272
|
-
|
|
31273
|
-
|
|
31274
|
-
|
|
31275
|
-
|
|
31276
|
-
|
|
31277
|
-
|
|
31278
|
-
|
|
31279
|
-
|
|
31280
|
-
|
|
31281
|
-
|
|
31282
|
-
|
|
31283
|
-
if (
|
|
31284
|
-
|
|
31285
|
-
|
|
31286
|
-
|
|
31287
|
-
|
|
31288
|
-
|
|
31289
|
-
|
|
31290
|
-
|
|
31496
|
+
// state.recorder.stop();
|
|
31497
|
+
state.recorder.start().then(() => {
|
|
31498
|
+
window.setTimeout(() => {
|
|
31499
|
+
let wavBlob = state.recorder.getWAVBlob();
|
|
31500
|
+
let newbolb = new Blob([wavBlob], {
|
|
31501
|
+
type: "audio/wav"
|
|
31502
|
+
});
|
|
31503
|
+
//获取当时时间戳作为文件名
|
|
31504
|
+
let fileOfBlob = new File([newbolb], new Date().getTime() + ".wav");
|
|
31505
|
+
|
|
31506
|
+
// 本地播放录音文件流
|
|
31507
|
+
let sound = new Audio();
|
|
31508
|
+
let src = URL.createObjectURL(fileOfBlob);
|
|
31509
|
+
sound.src = src;
|
|
31510
|
+
sound.play();
|
|
31511
|
+
state.recorder.stop();
|
|
31512
|
+
state.recorderCode = 0;
|
|
31513
|
+
let formData = new FormData();
|
|
31514
|
+
formData.append("modelName", "medium");
|
|
31515
|
+
formData.append("audio", fileOfBlob);
|
|
31516
|
+
uploadWavFile(formData).then(result => {
|
|
31517
|
+
let res = result.data;
|
|
31518
|
+
if (res.code == 200) {
|
|
31519
|
+
let {
|
|
31520
|
+
answer: audioToText
|
|
31521
|
+
} = res.detail.content;
|
|
31522
|
+
let text = audioToText;
|
|
31523
|
+
|
|
31524
|
+
// let text = "回到2023年7月22日时刻";
|
|
31525
|
+
|
|
31526
|
+
// 拿到的语音进行问答
|
|
31527
|
+
let option = {
|
|
31528
|
+
searchText: text,
|
|
31529
|
+
use_tts: "True",
|
|
31530
|
+
coze_info: props.cozeInfo || {}
|
|
31531
|
+
};
|
|
31532
|
+
searchText(option).then(q => {
|
|
31533
|
+
let data = q.data;
|
|
31534
|
+
if (data && data.code == 200) {
|
|
31535
|
+
// 检索场景
|
|
31536
|
+
// matching(text, data.detail[0]);
|
|
31537
|
+
|
|
31538
|
+
// 讲回答后的内容返回给业务系统
|
|
31539
|
+
if (props.searchTextCallback) {
|
|
31540
|
+
props.searchTextCallback(data.detail[0]);
|
|
31541
|
+
}
|
|
31542
|
+
let {
|
|
31543
|
+
ttsMaleAddress
|
|
31544
|
+
} = data.detail[0];
|
|
31545
|
+
// 播放回答内容和进行小G动作
|
|
31546
|
+
if (ttsMaleAddress) {
|
|
31547
|
+
playAudio(ttsMaleAddress, "sys");
|
|
31291
31548
|
}
|
|
31549
|
+
// if (state.findMatch && state.findMatch.fun) {
|
|
31550
|
+
// if (state.findMatch.trigger == "together") {
|
|
31551
|
+
// state.findMatch.fun({
|
|
31552
|
+
// ...data.detail[0],
|
|
31553
|
+
// });
|
|
31554
|
+
// }
|
|
31555
|
+
// }
|
|
31292
31556
|
}
|
|
31293
|
-
}
|
|
31294
|
-
|
|
31295
|
-
|
|
31296
|
-
|
|
31297
|
-
}
|
|
31298
|
-
}
|
|
31299
|
-
|
|
31300
|
-
|
|
31301
|
-
|
|
31302
|
-
|
|
31303
|
-
|
|
31304
|
-
|
|
31557
|
+
}).catch(err => {
|
|
31558
|
+
console.error("问答错误");
|
|
31559
|
+
console.error(err);
|
|
31560
|
+
});
|
|
31561
|
+
}
|
|
31562
|
+
}).catch(err => {
|
|
31563
|
+
console.error("语音识别错误");
|
|
31564
|
+
console.error(err);
|
|
31565
|
+
});
|
|
31566
|
+
|
|
31567
|
+
// recognition.start();
|
|
31568
|
+
}, 5 * 1000);
|
|
31569
|
+
});
|
|
31305
31570
|
};
|
|
31306
31571
|
const sendRecorder = () => {
|
|
31307
31572
|
let wavBlob = state.recorder.getWAVBlob();
|
|
@@ -31756,15 +32021,15 @@ const _hoisted_19 = ["src"];
|
|
|
31756
32021
|
});
|
|
31757
32022
|
;// CONCATENATED MODULE: ./src/package/src/main.vue?vue&type=script&setup=true&lang=js
|
|
31758
32023
|
|
|
31759
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/src/main.vue?vue&type=style&index=0&id=
|
|
32024
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/src/main.vue?vue&type=style&index=0&id=207339b4&lang=css
|
|
31760
32025
|
// extracted by mini-css-extract-plugin
|
|
31761
32026
|
|
|
31762
|
-
;// CONCATENATED MODULE: ./src/package/src/main.vue?vue&type=style&index=0&id=
|
|
32027
|
+
;// CONCATENATED MODULE: ./src/package/src/main.vue?vue&type=style&index=0&id=207339b4&lang=css
|
|
31763
32028
|
|
|
31764
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/src/main.vue?vue&type=style&index=1&id=
|
|
32029
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-32.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-32.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-32.use[2]!./node_modules/less-loader/dist/cjs.js??clonedRuleSet-32.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/package/src/main.vue?vue&type=style&index=1&id=207339b4&lang=less&scoped=true
|
|
31765
32030
|
// extracted by mini-css-extract-plugin
|
|
31766
32031
|
|
|
31767
|
-
;// CONCATENATED MODULE: ./src/package/src/main.vue?vue&type=style&index=1&id=
|
|
32032
|
+
;// CONCATENATED MODULE: ./src/package/src/main.vue?vue&type=style&index=1&id=207339b4&lang=less&scoped=true
|
|
31768
32033
|
|
|
31769
32034
|
// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
|
|
31770
32035
|
var exportHelper = __webpack_require__(6262);
|
|
@@ -31776,7 +32041,7 @@ var exportHelper = __webpack_require__(6262);
|
|
|
31776
32041
|
|
|
31777
32042
|
|
|
31778
32043
|
|
|
31779
|
-
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(mainvue_type_script_setup_true_lang_js, [['__scopeId',"data-v-
|
|
32044
|
+
const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(mainvue_type_script_setup_true_lang_js, [['__scopeId',"data-v-207339b4"]])
|
|
31780
32045
|
|
|
31781
32046
|
/* harmony default export */ var main = (__exports__);
|
|
31782
32047
|
;// CONCATENATED MODULE: ./src/package/index.js
|
package/dist/g-ai-robot3.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ellipsisText{display:inline-block;width:20px;height:24px;position:relative}.ellipsisText:after{position:absolute;left:0;top:4px;content:"···";animation:loading-animation 1s linear infinite}@keyframes loading-animation{0%{content:"·"}50%{content:"··"}to{content:"···"}}#g-ai-robat[data-v-
|
|
1
|
+
.ellipsisText{display:inline-block;width:20px;height:24px;position:relative}.ellipsisText:after{position:absolute;left:0;top:4px;content:"···";animation:loading-animation 1s linear infinite}@keyframes loading-animation{0%{content:"·"}50%{content:"··"}to{content:"···"}}#g-ai-robat[data-v-207339b4]{position:fixed}#g-ai-robat .robot[data-v-207339b4]{cursor:pointer}#g-ai-robat .robot.disabled[data-v-207339b4]{cursor:not-allowed}#g-ai-robat .robot img[data-v-207339b4]{height:100px;width:100px}#g-ai-robat .talk_main[data-v-207339b4]{position:absolute;width:400px;height:600px;background:#f5f6f7}#g-ai-robat .talk_main.top[data-v-207339b4]{left:50%;bottom:100px;transform:translateX(-50%)}#g-ai-robat .talk_main.bottom[data-v-207339b4]{left:50%;top:100px;transform:translateX(-50%)}#g-ai-robat .talk_main.right[data-v-207339b4]{left:100px;bottom:50%;transform:translateY(50%)}#g-ai-robat .talk_main.left[data-v-207339b4]{right:100px;bottom:50%;transform:translateY(50%)}#g-ai-robat .talk_main.top-end[data-v-207339b4]{left:100px;bottom:100px}#g-ai-robat .talk_main.top-start[data-v-207339b4]{right:100px;bottom:100px}#g-ai-robat .talk_main.bottom-start[data-v-207339b4]{right:100px;top:100px}#g-ai-robat .talk_main.bottom-end[data-v-207339b4]{left:100px;top:100px}#g-ai-robat .talk_main header[data-v-207339b4]{height:44px;background:linear-gradient(90deg,#ebf1ff,#e5faf8,#f2ebfe);display:flex;padding:0 16px;align-items:center;justify-content:space-between;cursor:move}#g-ai-robat .talk_main header span[data-v-207339b4]{font-size:16px;font-weight:700}#g-ai-robat .talk_main header span.close[data-v-207339b4]{color:#999}#g-ai-robat .talk_main header i[data-v-207339b4]{cursor:pointer}#g-ai-robat .talk_main header i.disabled[data-v-207339b4]{cursor:not-allowed}#g-ai-robat .talk_main .qa_body[data-v-207339b4]{list-style:none;padding:16px;box-sizing:border-box;margin:0;height:calc(100% - 116px);overflow-y:auto}#g-ai-robat .talk_main .qa_body[data-v-207339b4]::-webkit-scrollbar{width:8px;background-color:#f9f9f9}#g-ai-robat .talk_main .qa_body[data-v-207339b4]::-webkit-scrollbar-track{background:#e1e1e1;border-radius:10px}#g-ai-robat .talk_main .qa_body[data-v-207339b4]::-webkit-scrollbar-thumb{background-color:#c1c1c1;border-radius:10px}#g-ai-robat .talk_main .qa_body li[data-v-207339b4]{display:flex;margin-bottom:24px;justify-content:flex-end}#g-ai-robat .talk_main .qa_body li .is_icon[data-v-207339b4]{width:30px;height:30px;border-radius:50%;color:#fff;display:flex}#g-ai-robat .talk_main .qa_body li .is_icon i[data-v-207339b4]{margin:auto}#g-ai-robat .talk_main .qa_body li.is_ai[data-v-207339b4]{justify-content:flex-start}#g-ai-robat .talk_main .qa_body li.is_ai .text_main[data-v-207339b4]{box-shadow:0 4px 20px 0 #0476ed29;border:1px solid;border-image-source:linear-gradient(180deg,#fff,hsla(0,0%,100%,.5) 104.31%);background:linear-gradient(92.03deg,rgba(119,241,255,.222) -2.18%,rgba(237,250,255,.6) 48.06%,rgba(91,168,255,.174) 107.05%)}#g-ai-robat .talk_main .qa_body li.is_ai .text_main>.value[data-v-207339b4]{white-space:pre-wrap}#g-ai-robat .talk_main .qa_body li .text_main[data-v-207339b4]{padding:10px;max-width:calc(100% - 100px);border:1px solid;margin:0 8px;border-image-source:linear-gradient(90deg,#fff,hsla(0,0%,100%,.5));box-shadow:0 4px 20px 0 #0476ed29;background:linear-gradient(90.81deg,rgba(244,252,255,.6) 1.75%,hsla(0,0%,100%,.6) 32.33%,rgba(238,246,255,.6) 102.86%);border-radius:6px}#g-ai-robat .talk_main .qa_body li .text_main>.value[data-v-207339b4]{display:flex;align-items:center;overflow-wrap:break-word;word-wrap:break-word;font-size:14px;font-weight:400}#g-ai-robat .talk_main .qa_body li .text_main .btn i[data-v-207339b4]{font-size:14px;font-weight:400;color:#037aff;margin-right:10px;cursor:pointer;text-decoration:underline}#g-ai-robat .talk_main .qa_body li .text_main .btn i.open[data-v-207339b4]{filter:hue-rotate(180deg);animation:opacityCss 2s linear infinite}#g-ai-robat .talk_main .qa_input[data-v-207339b4]{padding:10px 16px;display:flex;align-items:center;justify-content:space-between;position:absolute;bottom:0;left:0;right:0;box-sizing:border-box}#g-ai-robat .talk_main .qa_input textarea[data-v-207339b4]{width:100%;height:68px;resize:none;background-color:#fff;border:1px solid #dcdfe6;color:#606266;padding:6px}#g-ai-robat .talk_main .qa_input textarea[data-v-207339b4]:focus{outline:none;border-color:#409eff}#g-ai-robat .talk_main .qa_input .is_icon[data-v-207339b4]{width:30px}#g-ai-robat .talk_main .qa_input .is_icon p[data-v-207339b4]{display:flex;align-items:center;justify-content:flex-end;margin:6px 0}#g-ai-robat .talk_main .qa_input .is_icon p[data-v-207339b4]:first-of-type{position:relative}#g-ai-robat .talk_main .qa_input .is_icon p:first-of-type #playChart[data-v-207339b4]{bottom:30px;position:absolute;visibility:hidden}#g-ai-robat .talk_main .qa_input .is_icon p:first-of-type #playChart.show[data-v-207339b4]{visibility:visible}#g-ai-robat .talk_main .qa_input .is_icon p:first-of-type #playChart.hiddle[data-v-207339b4]{visibility:hidden}#g-ai-robat .talk_main .qa_input .is_icon p i[data-v-207339b4]{animation:rotateCss-207339b4 2s linear infinite;font-size:20px;color:#606266}#g-ai-robat .talk_main .qa_input .is_icon p img[data-v-207339b4]{width:20px;height:20px;cursor:pointer}#g-ai-robat .talk_main .qa_input .is_icon p img.close[data-v-207339b4]{filter:hue-rotate(180deg);animation:opacityCss 2s linear infinite}#g-ai-robat .talk_main .qa_input .is_icon p.send img.disabled[data-v-207339b4]{cursor:not-allowed}#g-ai-robat .talk_main .qa_input .is_icon p i[data-v-207339b4]{cursor:pointer}@keyframes rotateCss-207339b4{0%{transform:rotate(0deg)}25%{transform:rotate(90deg)}50%{transform:rotate(180deg)}70%{transform:rotate(270deg)}to{transform:rotate(1turn)}}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/c/font_4633255_xm549qw7rxj.woff2?t=1721900327001) format("woff2"),url(//at.alicdn.com/t/c/font_4633255_xm549qw7rxj.woff?t=1721900327001) format("woff"),url(//at.alicdn.com/t/c/font_4633255_xm549qw7rxj.ttf?t=1721900327001) format("truetype")}.iconfont[data-v-207339b4]{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-guanbi[data-v-207339b4]:before{content:"\e609"}.icon-nvsheng[data-v-207339b4]:before{content:"\e603"}.icon-nansheng[data-v-207339b4]:before{content:"\e604"}.icon-fuzhi[data-v-207339b4]:before{content:"\e626"}.icon-zhongxinhuida[data-v-207339b4]:before{content:"\e63b"}
|