Skip to content

Commit

Permalink
fix: Modify propmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleurxxx committed Sep 3, 2024
1 parent a770cb9 commit fd8be59
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions packages/plugins/robot/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
:key="item.label"
:class="{ 'selected-model': currentModel === item.value }"
@click="changeModel(item)"
>{{ item.label }}</tiny-dropdown-item
>
>{{ item.label }}
</tiny-dropdown-item>
</tiny-dropdown-menu>
</template>
</tiny-dropdown>
Expand Down Expand Up @@ -189,18 +189,8 @@ export default {
useHistory().addHistory()
}
// const codeRules = `
// 从现在开始,请扮演一名前端专家。如果需要生成前端代码,代码中的所有组件必须使用 Vue 3 框架和 TinyVue 组件库进行编写。例如,如果你想使用按钮组件,应该使用 TinyVue 组件库中的 \`tiny-button\`。
// 以下是 TinyVue 组件库的文档,请通读并遵循其中的指导来生成代码:[TinyVue 组件库文档](https://opentiny.design/tiny-vue/zh-CN/os-theme/overview)
// 生成代码时遵从以下几条要求:
// ###
// 1. 回复中只能有一个代码块
// 2. 所有生成的代码都是基于 Vue 3 框架
// 3. 所有组件都来自 TinyVue 组件库,避免使用原生组件或其他第三方库
// 4. 参考并遵循 TinyVue 文档中的组件使用方式
// ###
// `
const codeRules = `根据以下JSON schema模板,生成一个前端页面的代码。页面应该包含一个状态管理对象、一个根组件、内联CSS样式、子组件以及相应的属性和方法。请确保代码结构清晰、逻辑合理,并且符合现代前端开发的最佳实践。
const codeRules = `请生成一个JSON格式的schema代码,确保它完全符合以下提供的模板。请严格按照模板的结构和属性来构建代码,不要添加任何额外的属性或元素,也不要省略任何必要的部分。以下是您需要遵循的模板:
{
"state": {
"dataDisk": [1, 2, 3]
Expand Down Expand Up @@ -280,7 +270,6 @@ export default {
// 引入区块不存放在localstorage的原因:因为区块是可以变化的,用户可能在同一个会话中,对区块进行了删除和创建。那么存放的数据就不是即时数据了。
const getSendSeesionProcess = () => {
const sendProcess = { ...sessionProcess }
console.log(sendProcess.messages[0])
const firstMessage = sendProcess.messages[0]
firstMessage.content
sendProcess.messages = [
Expand Down Expand Up @@ -467,6 +456,7 @@ export default {
message: '切换AI大模型将导致当前会话被清空,重新开启新会话,是否继续?',
exec() {
selectedModel.value = model
currentModel = model
endContent()
}
})
Expand Down Expand Up @@ -531,26 +521,32 @@ export default {
.chat-title-icons {
font-size: 16px;
height: 16px;
svg {
float: right;
margin: 0 4px;
cursor: pointer;
&:hover {
opacity: 0.8;
}
}
}
.chat-title {
font-weight: bold;
font-size: 14px;
margin-bottom: 20px;
color: var(--ti-lowcode-chat-model-title);
}
.chat-window {
max-height: 400px;
overflow: scroll;
.chat-avatar-wrap {
width: 46px;
.chat-avatar {
width: 28px;
height: 28px;
Expand All @@ -559,10 +555,12 @@ export default {
border: 1px solid var(--ti-lowcode-chat-model-avatar-border);
border-radius: 50px;
}
.chat-avatar-ai {
border: none;
}
}
.chat-content {
max-width: 568px;
border-radius: 8px;
Expand All @@ -577,6 +575,7 @@ export default {
color: var(--ti-lowcode-chat-model-user-text);
}
}
.chat-message-row {
margin-bottom: 20px;
}
Expand All @@ -599,6 +598,7 @@ export default {
font-size: 12px;
margin-top: 10px;
color: var(--ti-lowcode-chat-model-text);
span {
display: inline-block;
line-height: 32px;
Expand All @@ -607,32 +607,40 @@ export default {
border: 1px solid var(--ti-lowcode-chat-model-text-border);
border-radius: 20px;
cursor: pointer;
&:hover {
border-color: var(--ti-lowcode-chat-model-text);
}
}
}
.chat-submit {
margin-top: 14px;
font-size: 14px;
.tiny-input {
width: calc(100% - 236px);
.tiny-input__inner {
height: 40px;
background-color: var(--ti-lowcode-chat-model-input-bg);
border: none;
}
svg {
font-size: 16px;
color: var(--ti-lowcode-chat-model-input-icon);
}
.microphone {
font-size: 18px;
}
.microphone-svg {
color: var(--ti-lowcode-base-blue-6);
}
}
.tiny-button {
background-color: var(--ti-lowcode-chat-model-button-bg) !important;
border: 1px solid var(--ti-lowcode-chat-model-button-border) !important;
Expand All @@ -642,11 +650,13 @@ export default {
border-radius: 12px !important;
float: right;
margin-right: 5px;
&:hover {
opacity: 0.8;
}
}
}
.hidden-text {
white-space: nowrap;
text-overflow: ellipsis;
Expand All @@ -656,18 +666,23 @@ export default {
.chat-loading .tiny-loading__spinner svg {
fill: var(--ti-lowcode-chat-loading-svg-color);
}
.chat-loading .tiny-loading__spinner .tiny-loading__text {
color: var(--ti-lowcode-chat-loading-text-color);
}
.chat-model-popover {
background-color: var(--ti-lowcode-chat-model-popover-bg);
.tiny-dropdown-item {
color: var(--ti-lowcode-chat-model-popover-color);
&:hover {
color: var(--ti-lowcode-chat-model-popover-active-color);
background-color: var(--ti-lowcode-chat-model-popover-active-bg);
}
}
.selected-model {
color: var(--ti-lowcode-chat-model-popover-active-color);
background-color: var(--ti-lowcode-chat-model-popover-active-bg);
Expand Down

0 comments on commit fd8be59

Please sign in to comment.