【代码优化】AI:将对话、聊天挪到 index 目录下,更模块化
parent
4acd379d50
commit
f3777f6334
|
@ -98,7 +98,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ChatConversationApi, ChatConversationVO } from '@/api/ai/chat/conversation'
|
||||
import { ref } from 'vue'
|
||||
import Role from '@/views/ai/chat/role/index.vue'
|
||||
import Role from './role/index.vue'
|
||||
import { Bottom, Top } from '@element-plus/icons-vue'
|
||||
import roleAvatarDefaultImg from '@/assets/ai/gpt.svg'
|
||||
|
|
@ -111,7 +111,7 @@ import MessageLoading from './MessageLoading.vue'
|
|||
import MessageNewChat from './MessageNewChat.vue'
|
||||
import { ChatMessageApi, ChatMessageVO } from '@/api/ai/chat/message'
|
||||
import { ChatConversationApi, ChatConversationVO } from '@/api/ai/chat/conversation'
|
||||
import ChatConversationUpdateForm from '@/views/ai/chat/components/ChatConversationUpdateForm.vue'
|
||||
import ChatConversationUpdateForm from './components/ChatConversationUpdateForm.vue'
|
||||
import { Download, Top } from '@element-plus/icons-vue'
|
||||
|
||||
const route = useRoute() // 路由
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import Header from '@/views/ai/chat/components/Header.vue'
|
||||
import Header from './../components/Header.vue'
|
||||
import RoleList from './RoleList.vue'
|
||||
import ChatRoleForm from '@/views/ai/model/chatRole/ChatRoleForm.vue'
|
||||
import RoleCategoryList from './RoleCategoryList.vue'
|
|
@ -47,8 +47,18 @@
|
|||
<el-text tag="b">CLIP</el-text>
|
||||
</div>
|
||||
<el-space wrap class="group-item-body">
|
||||
<el-select v-model="selectClipGuidancePreset" placeholder="Select" size="large" style="width: 350px">
|
||||
<el-option v-for="item in clipGuidancePresets" :key="item.key" :label="item.name" :value="item.key" />
|
||||
<el-select
|
||||
v-model="selectClipGuidancePreset"
|
||||
placeholder="Select"
|
||||
size="large"
|
||||
style="width: 350px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in clipGuidancePresets"
|
||||
:key="item.key"
|
||||
:label="item.name"
|
||||
:value="item.key"
|
||||
/>
|
||||
</el-select>
|
||||
</el-space>
|
||||
</div>
|
||||
|
@ -58,7 +68,12 @@
|
|||
</div>
|
||||
<el-space wrap class="group-item-body">
|
||||
<el-select v-model="selectStylePreset" placeholder="Select" size="large" style="width: 350px">
|
||||
<el-option v-for="item in stylePresets" :key="item.key" :label="item.name" :value="item.key" />
|
||||
<el-option
|
||||
v-for="item in stylePresets"
|
||||
:key="item.key"
|
||||
:label="item.name"
|
||||
:value="item.key"
|
||||
/>
|
||||
</el-select>
|
||||
</el-space>
|
||||
</div>
|
||||
|
@ -120,8 +135,8 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {ImageApi, ImageDrawReqVO, ImageVO} from '@/api/ai/image'
|
||||
import {hasChinese} from '../../utils/common-utils'
|
||||
import { ImageApi, ImageDrawReqVO, ImageVO } from '@/api/ai/image'
|
||||
import { hasChinese } from '@/views/ai/utils/utils'
|
||||
|
||||
// image 模型
|
||||
interface ImageModelVO {
|
||||
|
@ -190,7 +205,7 @@ const sampler = ref<ImageModelVO[]>([
|
|||
{
|
||||
key: 'K_LMS',
|
||||
name: 'K_LMS'
|
||||
},
|
||||
}
|
||||
])
|
||||
|
||||
// 风格
|
||||
|
@ -266,7 +281,7 @@ const stylePresets = ref<ImageModelVO[]>([
|
|||
{
|
||||
key: 'tile-texture',
|
||||
name: 'tile-texture'
|
||||
},
|
||||
}
|
||||
])
|
||||
|
||||
// 文本提示相匹配的图像(clip_guidance_preset) 简称 CLIP
|
||||
|
@ -301,7 +316,7 @@ const clipGuidancePresets = ref<ImageModelVO[]>([
|
|||
{
|
||||
key: 'SLOWEST',
|
||||
name: 'SLOWEST'
|
||||
},
|
||||
}
|
||||
])
|
||||
|
||||
const steps = ref<number>(20) // 迭代步数
|
||||
|
@ -352,7 +367,7 @@ const handleGenerateImage = async () => {
|
|||
scale: scale.value, // 引导系数
|
||||
sampler: selectSampler.value, // 采样算法
|
||||
clipGuidancePreset: selectClipGuidancePreset.value, // 文本提示相匹配的图像 CLIP
|
||||
stylePreset: selectStylePreset.value, // 风格
|
||||
stylePreset: selectStylePreset.value // 风格
|
||||
}
|
||||
} as ImageDrawReqVO
|
||||
await ImageApi.drawImage(form)
|
Loading…
Reference in New Issue