Skip to content

Commit

Permalink
Add gpt 4 all model (#131)
Browse files Browse the repository at this point in the history
Co-authored-by: AceDataCloud <[email protected]>
  • Loading branch information
Germey and AceDataCloud authored Aug 25, 2024
1 parent 146f82d commit efa156d
Show file tree
Hide file tree
Showing 44 changed files with 1,321 additions and 1,092 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "add gpt all experience",
"packageName": "@acedatacloud/nexior",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 3 additions & 5 deletions src/components/chat/InputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,15 @@

<script lang="ts">
import { defineComponent } from 'vue';
// import { ElInput, ElMessage, ElTooltip, ElUpload } from 'element-plus';
import { ElMessage, ElTooltip, ElUpload } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { IChatModel } from '@/models';
import { getBaseUrlPlatform } from '@/utils';
import { CHAT_MODEL_GPT_4_VISION } from '@/constants';
import { CHAT_MODEL_GPT_4_ALL, CHAT_MODEL_GPT_4_VISION } from '@/constants';
export default defineComponent({
name: 'InputBox',
components: {
// ElInput,
ElTooltip,
FontAwesomeIcon,
ElUpload
Expand Down Expand Up @@ -112,7 +110,7 @@ export default defineComponent({
return this.fileList.map((file: UploadFile) => file?.response?.file_url);
},
canUpload() {
return [CHAT_MODEL_GPT_4_VISION.name].includes(this.model.name);
return [CHAT_MODEL_GPT_4_VISION.name, CHAT_MODEL_GPT_4_ALL.name].includes(this.model.name);
},
model(): IChatModel {
return this.$store.state.chat.model;
Expand Down Expand Up @@ -201,7 +199,7 @@ textarea.input:focus {
.el-upload-list {
position: absolute;
width: 400px;
bottom: 45px;
bottom: 55px;
}
.el-textarea.is-disabled .el-textarea__inner {
Expand Down
25 changes: 24 additions & 1 deletion src/components/chat/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="content">
<div class="edit-left">
<el-tooltip
v-if="message.role === 'user' && !isEditing"
v-if="message.role === 'user' && !isEditing && !Array.isArray(message.content)"
effect="dark"
:content="$t('chat.button.edit')"
placement="bottom"
Expand All @@ -36,6 +36,14 @@
fit="cover"
class="image"
/>
<span v-if="item.type === 'file_url'" class="file">
<font-awesome-icon icon="fa-regular fa-file" class="icon icon-file" />
{{
typeof item?.file_url === 'string'
? item.file_url?.split('/')?.slice(-1)?.[0]
: item.file_url?.url?.split('/')?.slice(-1)?.[0]
}}
</span>
<markdown-renderer v-if="item.type === 'text'" :key="index" :content="item.text" />
</div>
</div>
Expand Down Expand Up @@ -330,6 +338,16 @@ export default defineComponent({
margin: 5px 0;
border-radius: 10px;
}
.file {
display: block;
margin: 5px 0;
border-radius: 10px;
padding: 5px 10px;
background-color: var(--el-bg-color);
color: var(--el-text-color-regular);
border: 1px solid var(--el-border-color);
font-size: 14px;
}
.edit-area {
width: 100%;
min-height: 100px;
Expand All @@ -342,6 +360,11 @@ export default defineComponent({
justify-content: flex-end;
gap: 10px;
}
.icon-edit {
font-size: 14px;
cursor: pointer;
color: var(--el-text-color-regular);
}
}
.operations {
Expand Down
11 changes: 9 additions & 2 deletions src/components/chat/ModelSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import {
CHAT_MODEL_GPT_3_5_BROWSING,
CHAT_MODEL_GPT_4,
CHAT_MODEL_GPT_4_BROWSING,
CHAT_MODEL_GPT_4_VISION
CHAT_MODEL_GPT_4_VISION,
CHAT_MODEL_GPT_4_ALL
} from '@/constants';
export default defineComponent({
Expand Down Expand Up @@ -79,6 +80,11 @@ export default defineComponent({
icon: 'fa-solid fa-wand-magic-sparkles',
color: '#ce65e6',
model: CHAT_MODEL_GPT_4_VISION
},
{
icon: 'fa-solid fa-wand-magic-sparkles',
color: '#ce65e6',
model: CHAT_MODEL_GPT_4_ALL
}
]
};
Expand All @@ -91,7 +97,8 @@ export default defineComponent({
CHAT_MODEL_GPT_3_5_BROWSING,
CHAT_MODEL_GPT_4,
CHAT_MODEL_GPT_4_BROWSING,
CHAT_MODEL_GPT_4_VISION
CHAT_MODEL_GPT_4_VISION,
CHAT_MODEL_GPT_4_ALL
].find((model) => model.name === modelName);
return model;
}
Expand Down
7 changes: 7 additions & 0 deletions src/constants/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const CHAT_MODEL_NAME_GPT_3_5_BROWSING = 'gpt-3.5-browsing';
export const CHAT_MODEL_NAME_GPT_4 = 'gpt-4';
export const CHAT_MODEL_NAME_GPT_4_BROWSING = 'gpt-4-browsing';
export const CHAT_MODEL_NAME_GPT_4_VISION = 'gpt-4-vision';
export const CHAT_MODEL_NAME_GPT_4_ALL = 'gpt-4-all';

export const CHAT_SERVICE_ID = 'b1fbcc32-e218-4253-9dc3-4fe600a1bfb9';

Expand Down Expand Up @@ -42,3 +43,9 @@ export const CHAT_MODEL_GPT_4_VISION: IChatModel = {
getDisplayName: () => i18n.global.t('chat.model.4Vision'),
getDescription: () => i18n.global.t('chat.model.4VisionDescription')
};

export const CHAT_MODEL_GPT_4_ALL: IChatModel = {
name: CHAT_MODEL_NAME_GPT_4_ALL,
getDisplayName: () => i18n.global.t('chat.model.4All'),
getDescription: () => i18n.global.t('chat.model.4AllDescription')
};
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading

0 comments on commit efa156d

Please sign in to comment.