|
@@ -852,18 +852,39 @@ export default {
|
|
|
this.scrollBottom();
|
|
|
console.log(this.sendType)
|
|
|
if (_text.indexOf("视频") != -1 || this.sendType == 2) {
|
|
|
- return this.ajax.get(`https://www.googleapis.com/youtube/v3/search?key=AIzaSyBUvNQ5Wyua4PbStE2vp3t7MIY4htry-4M&part=snippet&q=${_text}&maxResults=10&type=video&order=relevance®ionCode=HK`).then(res=>{
|
|
|
+ //return this.ajax.get(`https://www.googleapis.com/youtube/v3/search?key=AIzaSyBUvNQ5Wyua4PbStE2vp3t7MIY4htry-4M&part=snippet&q=${_text}&maxResults=10&type=video&order=relevance®ionCode=HK`).then(res=>{
|
|
|
+ // console.log(res)
|
|
|
+ // let _dataList = res.data.items;
|
|
|
+ // let _resultText = ``;
|
|
|
+ // _dataList.forEach(i=>{
|
|
|
+ // _resultText+=`名称:${i.snippet.title}\n简介:${i.snippet.description}\n地址:[https://www.youtube.com/embed/${i.id.videoId}](https://www.youtube.com/embed/${i.id.videoId})\n\n`
|
|
|
+ // })
|
|
|
+ // this.chatList.find(i => i.uid == _uuid).aiContent =_resultText
|
|
|
+ // this.chatList.find(i => i.uid == _uuid).loading = false;
|
|
|
+ // this.chatLoading = false;
|
|
|
+ // this.scrollBottom();
|
|
|
+ // this.insertChat(_uuid);
|
|
|
+ // this.text = "";
|
|
|
+ //}).catch(e=>{
|
|
|
+ // this.$message.error('获取视频失败');
|
|
|
+ // this.chatLoading = false;
|
|
|
+ //})
|
|
|
+ return this.ajax.post(`https://gpt4.cocorobo.cn/get_network_search`,{
|
|
|
+ engine:"bilibili",
|
|
|
+ keyword:_text
|
|
|
+ }).then(res=>{
|
|
|
console.log(res)
|
|
|
- let _dataList = res.data.items;
|
|
|
+ let _dataList = res.data.FunctionResponse;
|
|
|
let _resultText = ``;
|
|
|
_dataList.forEach(i=>{
|
|
|
- _resultText+=`名称:${i.snippet.title}\n简介:${i.snippet.description}\n地址:[https://www.youtube.com/embed/${i.id.videoId}](https://www.youtube.com/embed/${i.id.videoId})\n\n`
|
|
|
+ i.title = i.title.replaceAll('<em class="keyword">','').replaceAll('</em>','')
|
|
|
+ _resultText+=`名称:${i.title}\n简介:${i.description}\n地址:[${i.arcurl}](${i.arcurl})\n\n`
|
|
|
})
|
|
|
this.chatList.find(i => i.uid == _uuid).aiContent =_resultText
|
|
|
this.chatList.find(i => i.uid == _uuid).loading = false;
|
|
|
- this.chatLoading = false;
|
|
|
+ this.chatLoading = false;
|
|
|
this.scrollBottom();
|
|
|
- this.insertChat(_uuid);
|
|
|
+ this.insertChat(_uuid);
|
|
|
this.text = "";
|
|
|
}).catch(e=>{
|
|
|
this.$message.error('获取视频失败');
|