|
@@ -1,142 +1,144 @@
|
|
|
<template>
|
|
|
- <h2
|
|
|
- style="
|
|
|
- text-align: center;
|
|
|
- margin: 18px 0;
|
|
|
- font-size: 25px;
|
|
|
- font-family: 'Source Sans Pro', 'ui-sans-serif', 'system-ui', sans-serif;
|
|
|
- "
|
|
|
- >
|
|
|
- ChatGLM
|
|
|
- </h2>
|
|
|
- <div class="chatbg tool">
|
|
|
- <div
|
|
|
+ <div>
|
|
|
+ <h2
|
|
|
style="
|
|
|
- float: left;
|
|
|
- font-size: 12px;
|
|
|
- padding: 4px 8px;
|
|
|
- border-right: 1px solid #e5e7eb;
|
|
|
- border-bottom: 1px solid #e5e7eb;
|
|
|
- border-bottom-right-radius: 7px;
|
|
|
+ text-align: center;
|
|
|
+ margin: 18px 0;
|
|
|
+ font-size: 25px;
|
|
|
+ font-family: 'Source Sans Pro', 'ui-sans-serif', 'system-ui', sans-serif;
|
|
|
"
|
|
|
>
|
|
|
- <el-icon><ChatDotRound /></el-icon>
|
|
|
- Chatbot
|
|
|
- </div>
|
|
|
- <div style="clear: both"></div>
|
|
|
- <div class="chatGptChat" ref="chatEle">
|
|
|
- <div v-for="(item, index) in chat" :key="index">
|
|
|
- <div v-if="item.type === 'robot'" class="chat">
|
|
|
- <div class="cahtText">
|
|
|
- <textShow :text="item.text" />
|
|
|
+ ChatGLM
|
|
|
+ </h2>
|
|
|
+ <div class="chatbg tool">
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ float: left;
|
|
|
+ font-size: 12px;
|
|
|
+ padding: 4px 8px;
|
|
|
+ border-right: 1px solid #e5e7eb;
|
|
|
+ border-bottom: 1px solid #e5e7eb;
|
|
|
+ border-bottom-right-radius: 7px;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-icon><ChatDotRound /></el-icon>
|
|
|
+ Chatbot
|
|
|
+ </div>
|
|
|
+ <div style="clear: both"></div>
|
|
|
+ <div class="chatGptChat" ref="chatEle">
|
|
|
+ <div v-for="(item, index) in chat" :key="index">
|
|
|
+ <div v-if="item.type === 'robot'" class="chat">
|
|
|
+ <div class="cahtText">
|
|
|
+ <textShow :text="item.text" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <div v-if="item.type === 'user'" class="chat chatRight">
|
|
|
+ <div class="cahtText" v-text="item.text"></div>
|
|
|
+ </div>
|
|
|
+ <div style="clear: both"></div>
|
|
|
</div>
|
|
|
- <div v-if="item.type === 'user'" class="chat chatRight">
|
|
|
- <div class="cahtText" v-text="item.text"></div>
|
|
|
- </div>
|
|
|
- <div style="clear: both"></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="tool">
|
|
|
- <el-row :gutter="15">
|
|
|
- <el-col :span="16">
|
|
|
- <el-input
|
|
|
- v-model="inputText"
|
|
|
- :rows="10"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入您的问题"
|
|
|
- />
|
|
|
- <el-button
|
|
|
- style="
|
|
|
- width: 100%;
|
|
|
- color: #ea580c;
|
|
|
- font-weight: 600;
|
|
|
- font-size: 16px;
|
|
|
- margin-top: 1em;
|
|
|
- "
|
|
|
- :loading="load"
|
|
|
- color="#fdba74"
|
|
|
- size="large"
|
|
|
- @click="saveText"
|
|
|
- >
|
|
|
- 提交
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-button
|
|
|
- style="width: 100%; margin-bottom: 1em"
|
|
|
- color="#f3f4f6"
|
|
|
- size="large"
|
|
|
- @click="(chat = []), (chatlist = [])"
|
|
|
- >
|
|
|
- 清除历史记录
|
|
|
- </el-button>
|
|
|
- <div class="tools">
|
|
|
- <div class="toolsItem">
|
|
|
- 最大长度
|
|
|
- <el-input-number
|
|
|
- style="float: right"
|
|
|
- v-model="num"
|
|
|
- :min="0"
|
|
|
- :max="4096"
|
|
|
- @change="change"
|
|
|
- controls-position="right"
|
|
|
- size="small"
|
|
|
- />
|
|
|
- <input
|
|
|
- :value="0"
|
|
|
- type="range"
|
|
|
- id="num"
|
|
|
- style="width: 100%"
|
|
|
- @input="input"
|
|
|
- />
|
|
|
+ <div class="tool">
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-input
|
|
|
+ v-model="inputText"
|
|
|
+ :rows="10"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入您的问题"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ style="
|
|
|
+ width: 100%;
|
|
|
+ color: #ea580c;
|
|
|
+ font-weight: 600;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-top: 1em;
|
|
|
+ "
|
|
|
+ :loading="load"
|
|
|
+ color="#fdba74"
|
|
|
+ size="large"
|
|
|
+ @click="saveText"
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-button
|
|
|
+ style="width: 100%; margin-bottom: 1em"
|
|
|
+ color="#f3f4f6"
|
|
|
+ size="large"
|
|
|
+ @click="(chat = []), (chatlist = [])"
|
|
|
+ >
|
|
|
+ 清除历史记录
|
|
|
+ </el-button>
|
|
|
+ <div class="tools">
|
|
|
+ <div class="toolsItem">
|
|
|
+ 最大长度
|
|
|
+ <el-input-number
|
|
|
+ style="float: right"
|
|
|
+ v-model="num"
|
|
|
+ :min="0"
|
|
|
+ :max="4096"
|
|
|
+ @change="change"
|
|
|
+ controls-position="right"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ <input
|
|
|
+ :value="0"
|
|
|
+ type="range"
|
|
|
+ id="num"
|
|
|
+ style="width: 100%"
|
|
|
+ @input="input"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <div class="toolsItem">
|
|
|
+ Top P
|
|
|
+ <el-input-number
|
|
|
+ style="float: right"
|
|
|
+ v-model="num1"
|
|
|
+ :min="0"
|
|
|
+ :max="1"
|
|
|
+ :step="0.01"
|
|
|
+ @change="change1"
|
|
|
+ controls-position="right"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ <input
|
|
|
+ :value="0"
|
|
|
+ type="range"
|
|
|
+ id="num1"
|
|
|
+ style="width: 100%"
|
|
|
+ @input="input1"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="line"></div>
|
|
|
+ <div class="toolsItem">
|
|
|
+ 感情度
|
|
|
+ <el-input-number
|
|
|
+ style="float: right"
|
|
|
+ v-model="num2"
|
|
|
+ :min="0"
|
|
|
+ :max="1"
|
|
|
+ :step="0.01"
|
|
|
+ @change="change2"
|
|
|
+ controls-position="right"
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ <input
|
|
|
+ :value="0"
|
|
|
+ type="range"
|
|
|
+ id="num2"
|
|
|
+ style="width: 100%"
|
|
|
+ @input="input2"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="line"></div>
|
|
|
- <div class="toolsItem">
|
|
|
- Top P
|
|
|
- <el-input-number
|
|
|
- style="float: right"
|
|
|
- v-model="num1"
|
|
|
- :min="0"
|
|
|
- :max="1"
|
|
|
- :step="0.01"
|
|
|
- @change="change1"
|
|
|
- controls-position="right"
|
|
|
- size="small"
|
|
|
- />
|
|
|
- <input
|
|
|
- :value="0"
|
|
|
- type="range"
|
|
|
- id="num1"
|
|
|
- style="width: 100%"
|
|
|
- @input="input1"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="line"></div>
|
|
|
- <div class="toolsItem">
|
|
|
- 感情度
|
|
|
- <el-input-number
|
|
|
- style="float: right"
|
|
|
- v-model="num2"
|
|
|
- :min="0"
|
|
|
- :max="1"
|
|
|
- :step="0.01"
|
|
|
- @change="change2"
|
|
|
- controls-position="right"
|
|
|
- size="small"
|
|
|
- />
|
|
|
- <input
|
|
|
- :value="0"
|
|
|
- type="range"
|
|
|
- id="num2"
|
|
|
- style="width: 100%"
|
|
|
- @input="input2"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|