Skip to content

Commit

Permalink
Release V1.3.9
Browse files Browse the repository at this point in the history
## Release V1.3.9
> Update date: 2024-01-12

### Update
- Update OpenAI Models
- Update Avatar style
- Restrict GPT-3 to use function calling

### Fix
- Fixed use GPT-3 model return "Maximum tokens exceeded" error
![1705067152307](https://github.com/Caojiahao-Coder/gpt_next/assets/68038353/1b1695c9-2220-4183-a138-44566d185d7a)
  • Loading branch information
Caojiahao-Coder committed Jan 12, 2024
2 parents 255a6d1 + 83bef7a commit 2db9361
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 39 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "gpt_next",
"version": "1.3.8",
"version": "1.3.9",
"private": true,
"scripts": {
"dev": "vite",
"dev": "vite --host --port 3000",
"preview": "vite preview",
"build": "vite build",
"type-check": "vue-tsc --noEmit",
Expand Down Expand Up @@ -34,6 +34,7 @@
"@antfu/eslint-config": "^0.39.8",
"@iconify-json/carbon": "^1.1.22",
"@iconify-json/devicon-plain": "^1.1.25",
"@iconify-json/simple-icons": "^1.1.82",
"@iconify-json/svg-spinners": "^1.1.2",
"@intlify/unplugin-vue-i18n": "^0.11.0",
"@mapbox/rehype-prism": "^0.8.0",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions src/assets/models-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ const gpt_models: {
value: 'gpt-4-vision-preview',
name: 'gpt-4-vision(preview)',
},
{
value: 'gpt-4-32k',
name: 'gpt-4-32k (Plus)',
},
{
value: 'gpt-4-32k-0613',
name: 'gpt-4-32k-0613 (Plus)',
},
{
value: 'gpt-3.5-turbo',
name: 'gpt-3.5-turbo',
Expand All @@ -38,18 +30,6 @@ const gpt_models: {
value: 'gpt-3.5-turbo-instruct',
name: 'gpt-3.5-turbo-instruct',
},
{
value: 'gpt-3.5-turbo-0613',
name: 'gpt-3.5-turbo-0613',
},
{
value: 'gpt-3.5-turbo-16k-0613',
name: 'gpt-3.5-turbo-16k-0613',
},
{
value: 'gpt-3.5-turbo-0301',
name: 'gpt-3.5-turbo-0301',
},
]

export default gpt_models
13 changes: 13 additions & 0 deletions src/components/AssistantsSetting.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div class="border-base" b="0 b-1 solid">
<div class="text-18px font-700 h-18px" p="t-16px l-16px r-16px">
<div class="flex flex-row gap-2">
<div class="i-carbon-bot h-18px w-18px m-3px" />
<div class="h-24px flex-1 line-height-24px">
Assistants
</div>
</div>
</div>
<div class="p-16px" />
</div>
</template>
13 changes: 11 additions & 2 deletions src/components/ChatSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ watch(role, (newValue) => {
<template>
<div class="border-base" b="0 b-1 solid">
<div class="text-18px font-700 h-18px" p="t-16px l-16px r-16px">
{{ t('chat_setting') }}
<div class="flex flex-row gap-2">
<div class="i-carbon-chat h-18px w-18px m-3px" />
<div class="h-24px flex-1 line-height-24px">
{{ t('chat_setting') }}
</div>
</div>
</div>

<div class="p-16px">
<div class="text-3 color-gray" style="font-family: Light;">
{{ t('language') }}
Expand Down Expand Up @@ -62,7 +68,10 @@ watch(role, (newValue) => {
{{ t("manage_prompts") }}
</button>

<div id="newPanel" class="b-rd color-white text-3 absolute right--3 top--6px rotate-20 font-light px-1 py-1px shadow">
<div
id="newPanel"
class="b-rd color-white text-3 absolute right--3 top--6px rotate-20 font-light px-1 py-1px shadow"
>
New
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/components/FunctionCallingSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ function onCloseView() {
{{ t('function_calling_setting') }}
</div>

<div class="text-14px h-18px color-gray" p="t-16px l-16px r-16px">
{{ t('the_feature_only_for_gpt4') }}
</div>

<div class="flex flex-col gap-4 p-4">
<button
class="bg-body color-base outline-none border-base hover-bg-base w-full transition-all px-4 py-2 b-1 b-solid border-base b-rd"
Expand Down
18 changes: 7 additions & 11 deletions src/components/MessageRecordItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async function getChatAnswer() {
try {
loadingMessageAnswer.value = true
if (!messageInfo.value.vision_file)
if (!messageInfo.value.vision_file && globalSettingInfo.chat_model.startsWith('gpt-4'))
checkingFunctionCalling.value = true
// 第一次执行任务,携带tools进入
Expand All @@ -168,8 +168,7 @@ async function getChatAnswer() {
temperature: 0.7,
messages: messagesBody,
stream: true,
max_tokens: 4096,
tools: !messageInfo.value.vision_file
tools: (!messageInfo.value.vision_file && globalSettingInfo.chat_model.startsWith('gpt-4'))
? toolsList
: undefined,
},
Expand Down Expand Up @@ -469,9 +468,7 @@ function onSpeechGPTMessageContent() {
class="record-item user-item bg-base border-base flex flex-row gap-16px relative" b="0 b-1 solid"
@mouseenter="onMouseEnter" @mouseleave="onMouseLeave"
>
<div class="avatar w-8 h-8 b-rd-1 bg-body shadow-2xl">
<div class="w-6 h-6 m-1 b-rd-1" i-carbon-user />
</div>
<div class="avatar w-4 h-4 m-2 b-rd-90 b-rd-1 bg-gray shadow-xl" />
<Markdown :content="messageInfo.user_content" />

<EditMessageRecordTools
Expand All @@ -481,9 +478,7 @@ function onSpeechGPTMessageContent() {
/>
</div>
<div class="record-item gpt-item bg-base border-base relative flex flex-row gap-4" b="0 b-1 solid">
<div class="avatar w-8 h-8 b-rd-1 bg-body shadow-2xl">
<div class="w-6 h-6 m-1 b-rd-1" i-carbon-bot />
</div>
<div class="avatar w-4 h-4 m-2 bg-body shadow-xl b-rd-90" />
<div class="flex-1 overflow-hidden flex flex-col gap-2">
<CheckingFunctionCalling v-if="checkingFunctionCalling" />
<MarkFunctionCallingMessage
Expand Down Expand Up @@ -584,11 +579,12 @@ function onSpeechGPTMessageContent() {
padding: 16px;
}
.gpt-item>.avatar>div {
.gpt-item>.avatar {
background: linear-gradient(24deg, #2a2dce 0%, rgba(247, 0, 208, 0.890484) 100%);
}
.gpt-item {
.gpt-item,
.avatar {
background-image: url('data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%204096%204096%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cfilter%20id%3D%22x37ws8lk43i60c%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%221%22%20numOctaves%3D%222.8%22%20stitchTiles%3D%22stitch%22%20%2F%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url(%23x37ws8lk43i60c)%22%20opacity%3D%220.1%22%20%2F%3E%3C%2Fsvg%3E');
}
</style>
15 changes: 11 additions & 4 deletions src/components/OpenAISetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@ const open = ref<boolean>(false)
const { t } = useI18n()
const globalStore = useGlobalStore()
const apiKey_modal = ref<string>()
const gptModel_modal = ref<string>('gpt-3.5-turbo-0301')
const gptModel_modal = ref<string>()
globalStore.getGlobalSetting().then((res) => {
if (res) {
apiKey_modal.value = res.api_key
gptModel_modal.value = res.chat_model ?? 'gpt-3.5-turbo'
}
})
const apiKey = ref<string | undefined>()
const gptModel = ref<string | undefined>()
const copyApiKeySuccess = ref<boolean>(false)
const copyApiKeyFailed = ref<boolean>(false)
const globalStore = useGlobalStore()
onMounted(() => {
loadOpenAISetting()
})
Expand Down Expand Up @@ -86,7 +93,7 @@ function copyOpenAiKey() {
<template>
<div class="border-base" b="0 b-1 solid">
<div class="text-18px font-700 h-18px" p="t-16px l-16px r-16px">
<div class="flex flex-row">
<div class="flex flex-row gap-2">
<div class="h-24px flex-1 line-height-24px">
Open AI
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/SettingSlideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function toggleExpandSettingSideBar() {
<div class="flex-1 overflow-y-scroll setting-bar-menu-list">
<ChatSetting />
<OpenAISetting />
<!-- <AssistantsSetting /> -->
<ToolsSetting />
<FunctionCallingSetting />
<MessageSpeechSetting />
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ export default {
test_this_prompt: 'Test this prompt',
test_result: 'Test result',
loading_test_result: 'Loading test result...',
the_feature_only_for_gpt4: 'The feature only for GPT-4',
}
2 changes: 2 additions & 0 deletions src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,6 @@ export default {
test_this_prompt: '测试这个对话场景',
test_result: '测试结果',
loading_test_result: '正在加载测试结果...',
the_feature_only_for_gpt4: '该功能仅适用于GPT-4模型',

}

1 comment on commit 2db9361

@vercel
Copy link

@vercel vercel bot commented on 2db9361 Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.