-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 1. base framework for chatGPT and bing chat 2. rename plugin name
- Loading branch information
Showing
18 changed files
with
334 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,71 @@ | ||
<template> | ||
<h2>safsadfsdfsdah2</h2> | ||
<div> | ||
聊天历史在这里哦1 | ||
<div> | ||
<div @click="clickHandle('bing')">问问bing chat</div> | ||
<div @click="clickHandle('chatGpt')">问问chatGPT</div> | ||
<div @click="clickHandle('genImageWithChatGPT')">chatGPT生成图</div> | ||
<div>百度一下</div> | ||
<div>Google</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Ref, onMounted, onUnmounted, ref, toRefs } from 'vue'; | ||
import { NNotificationProvider, NSpace, useNotification } from 'naive-ui'; | ||
import t from '../i18n'; | ||
import { chatWithBing, chatWithChatGPT, genImageWithChatGPT } from '../utils/ThirdPartyService'; | ||
import Title from './Title'; | ||
const props = defineProps<{}>(); | ||
const props = defineProps<{ | ||
keyword: string; | ||
}>(); | ||
const index = ref(0); | ||
const notification = useNotification(); | ||
const clickHandle = async (type: string) => { | ||
console.log(notification); | ||
switch (type) { | ||
case 'bing': | ||
conversation('chatGpt', 'jahajhjahas'); | ||
break; | ||
case 'chatGpt': | ||
conversation('chatGpt', await chatWithChatGPT()); | ||
break; | ||
case 'genImageWithChatGpt': | ||
console.log(await genImageWithChatGPT()); | ||
break; | ||
default: | ||
return; | ||
} | ||
}; | ||
const conversation = (owner: string, content: string) => { | ||
index.value++; | ||
notification.info({ | ||
// TODO,使用tsx | ||
// avatar: () => '', | ||
title: `${owner}: 这是第 ${index.value}个对话`, | ||
content, | ||
}); | ||
}; | ||
onMounted(async () => { | ||
console.log('ssss'); | ||
console.log('onMounted'); | ||
}); | ||
onUnmounted(() => { | ||
console.log('4444'); | ||
console.log('onUnmounted'); | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
.radialTimeText { | ||
font-size: 32px; | ||
font-weight: 600; | ||
#chatHistory { | ||
position: fixed; | ||
top: 50px; | ||
right: 20px; | ||
color: yellow; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<template> | ||
<div> | ||
<NNotificationProvider :max="3"> <ChatView :keyword="'xxxx'" /> </NNotificationProvider> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Ref, onMounted, onUnmounted, ref, toRefs } from 'vue'; | ||
import { NNotificationProvider, NSpace, useNotification } from 'naive-ui'; | ||
import t from '../i18n'; | ||
import ChatView from '../ui/ChatView.vue'; | ||
onMounted(async () => { | ||
console.log('onMounted'); | ||
}); | ||
onUnmounted(() => { | ||
console.log('onUnmounted'); | ||
}); | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
#chatHistory { | ||
position: fixed; | ||
top: 50px; | ||
right: 20px; | ||
color: yellow; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.