Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 修改 prompt #3602

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="chat-item" :class="{'user-role': isUserRole}">
<div :class="{'user-role': isUserRole}" class="chat-item">
<div class="avatar">
<el-avatar :src="isUserRole ? userUrl : chatUrl" class="header-avatar" />
</div>
Expand All @@ -21,9 +21,9 @@
<div class="action">
<el-tooltip
v-if="isSystemError && isLoading"
:content="$tc('common.Reconnect')"
effect="dark"
placement="top"
:content="$tc('common.Reconnect')"
>
<svg-icon icon-class="refresh" @click="onRefresh" />
</el-tooltip>
Expand All @@ -37,7 +37,6 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>

</div>
</div>
</div>
Expand Down
14 changes: 13 additions & 1 deletion src/components/Apps/ChatAi/components/ChitChat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="chat-content">
<div id="scrollRef" class="chat-list">
<div v-if="showIntroduction" class="introduction">
<div v-for="(item, index) in introduction" :key="index" class="introduction-item">
<div v-for="(item, index) in introduction" :key="index" class="introduction-item" @click="sendIIntroduction(item)">
<div class="head">
<i v-if="item.icon" :class="item.icon" />
<span class="title">{{ item.title }}</span>
Expand Down Expand Up @@ -179,6 +179,10 @@ export default {
removeLoadingMessageInChat()
setLoading(false)
})
},
sendIIntroduction(item) {
this.showIntroduction = false
this.onSendHandle(item.content)
}
}
}
Expand All @@ -190,13 +194,21 @@ export default {
flex-direction: column;
overflow: hidden;
height: 100%;

.introduction {
padding: 16px 14px 0;

.introduction-item {
padding: 12px 14px;
border-radius: 8px;
margin-top: 16px;
background-color: var(--menu-hover);
cursor: pointer;

&:hover {
box-shadow: 0 0 2px 2px #00000014;
}

&:first-child {
margin-top: 0;
}
Expand Down
18 changes: 9 additions & 9 deletions src/i18n/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,12 +742,10 @@
"Chat": "Chat",
"CollapseSidebar": "Collapse the sidebar",
"introduction": {
"ConceptTitle": "🤔 Explain a complex concept",
"ConceptContent": "Tell me something about the Big Bang so that I can explain it to my 5-year-old child",
"IdeaTitle": "🧠 Brainstorming unprecedented ideas",
"IdeaContent": "Please provide 10 gift ideas for my friend's birthday",
"ArticleTitle": "💭 Get a catchy title immediately",
"ArticleContent": "Generate five catchy titles for my article on ChatGPT use cases"
"ConceptTitle": "🤔 Python interpreter",
"ConceptContent": "I want you to act like a Python interpreter. I will give you Python code, and you will execute it. Do not provide any explanations. Do not respond with anything except the output of the code. ",
"IdeaTitle": "🌱 Linux Terminal",
"IdeaContent": "I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. When I need to tell you something in English, I will do so by putting text inside curly brackets {like this}. ."
},
"imExport": {
"ExportAll": "Export all",
Expand Down Expand Up @@ -938,7 +936,8 @@
"VirtualApps": "Virtual apps",
"ImageName": "Image name",
"ID": "ID",
"Ports": "Ports"
"Ports": "Ports",
"EnterMessage": "Please enter a question, press Enter to send"
},
"dashboard": {
"ActiveAsset": "Asset active",
Expand Down Expand Up @@ -2099,7 +2098,8 @@
"passwordExpired": "Password expired",
"passwordWillExpiredPrefixMsg": "The password will expire in ",
"passwordWillExpiredSuffixMsg": " days.Please change your password as soon as possible.",
"dateLastLogin": "Date last login"
"dateLastLogin": "Date last login",
"AddAllMembersWarningMsg": "Are you sure you want to add all members"
},
"notifications": {
"MessageType": "Message Type",
Expand Down Expand Up @@ -2394,4 +2394,4 @@
"BindResource": "Bind resource",
"SelectResource": "Select resource"
}
}
}
23 changes: 17 additions & 6 deletions src/i18n/langs/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,10 @@
"Chat": "チャット",
"CollapseSidebar": "サイドバーを閉じる",
"introduction": {

"ConceptTitle": "🤔 Python インタプリタ",
"IdeaContent": "私はあなたに Linux ターミナルの役割を果たしてもらいたいです。私はコマンドを入力し、ターミナルが表示すべき内容を返してもらいます。あなたにはユニークなコードブロック内でのみターミナルの出力に応答してほしいです。説明は書かないでください。私が何かを英語で伝える必要がある場合、中括弧で囲んでテキストを入れます {コメントテキスト}。",
"IdeaTitle": "🌱 Linux ターミナル",
"ConceptContent": "私はあなたに Python インタプリタのように行動してほしいです。私はPythonコードを提供し、それを実行してほしいです。説明は何も提供しないでください。コードの出力以外での応答は不要です。"
},
"imExport": {
"ExportAll": "すべてをエクスポート",
Expand Down Expand Up @@ -932,7 +935,8 @@
"VirtualApps": "仮想アプリ",
"ImageName": "イメージ名",
"ID": "ID",
"Ports": "ポート"
"Ports": "ポート",
"EnterMessage": "質問を入力してください、Enter キーを押して送信"
},
"dashboard": {
"TotalJobLog": "ジョブ実行総数",
Expand Down Expand Up @@ -1493,7 +1497,9 @@
"DatabaseUpdate": "アセット更新 - データベース",
"CloudUpdate": "アセット更新 - クラウドプラットフォーム",
"More": "さらに..",
"BulkTransfer": "bulk transfer"
"BulkTransfer": "bulk transfer",
"AppProviderDetail": "アプリ提供者の詳細",
"VirtualAppDetail": "仮想アプリの詳細"
},
"rbac": {
"Permissions": "権限",
Expand All @@ -1520,7 +1526,11 @@
"DatabasePort": "データベース プロトコル ポート",
"BasePort": "リスニング ポート",
"Endpoint": "エンドポイント",
"ConnectMethod": "接続方式"
"ConnectMethod": "接続方式",
"Containers": "コンテナ",
"VirtualApp": "仮想アプリ",
"AppProvider": "アプリ提供者",
"VirtualAppDetail": "仮想アプリの詳細"
},
"sessions": {
"DownloadFTPFileTip": "現在の動作がファイルに記録されていないか、ファイルサイズが閾値(デフォルトでは100M)を超えているか、対応するストレージに保存されていません。",
Expand Down Expand Up @@ -2077,7 +2087,8 @@
"SetPublicKey": "SSH公開鍵の設定",
"passwordExpired": "パスワードが期限切れです",
"passwordWillExpiredPrefixMsg": "パスワードはまもなく",
"passwordWillExpiredSuffixMsg": "期限が切れた後、できるだけ早くパスワードを変更してください。"
"passwordWillExpiredSuffixMsg": "期限が切れた後、できるだけ早くパスワードを変更してください。",
"AddAllMembersWarningMsg": "すべてのメンバーを追加してもよろしいですか"
},
"notifications": {
"MessageType": "メッセージタイプ",
Expand Down Expand Up @@ -2374,4 +2385,4 @@
"BindResource": "リソースを関連付ける",
"SelectResource": "リソースを選択"
}
}
}
8 changes: 4 additions & 4 deletions src/i18n/langs/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,10 @@
"EnterMessage": "请输入问题, Enter 发送",
"CollapseSidebar": "收起侧边栏",
"introduction": {
"ConceptTitle": "\uD83E\uDD14 查询命令",
"ConceptContent": "如何使用 mysql 命令连接数据库?",
"IdeaTitle": "\uD83C\uDF31 部署项目",
"IdeaContent": "如何在 CentOS 上部署 Docker?"
"ConceptTitle": "\uD83E\uDD14 Python 解释器 ",
"ConceptContent": "我想让你像一个 Python 解释器一样行事。我将给你 Python 代码,你将执行它。不要提供任何解释。除了代码的输出,不要用任何东西来回应。",
"IdeaTitle": "\uD83C\uDF31 Linux 终端",
"IdeaContent": "我想让你充当一个 Linux 终端。我将输入命令,你将回答终端应该显示的内容。我希望你只在一个独特的代码块内回复终端输出,而不是其他。不要写解释。当我需要用英语告诉你一些事情时,我会把文字放在大括号里{备注文本}。"
},
"imExport": {
"ExportAll": "导出所有",
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,6 @@ input[type=file] {
font-weight: 400;
}

.el-drawer__container.el-drawer__open, .drawer-panel {
.el-drawer.rtl, .drawer-panel {
border-radius: 10px 0 0 10px;
}