Skip to content

Commit

Permalink
v2.18.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Dooy committed Jun 24, 2024
1 parent 2ee3775 commit 41b79df
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 11 deletions.
8 changes: 8 additions & 0 deletions changlog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# 功能升级日志

# 计划

# 2.18.8
- 🐞 修复:无法通过?settings={"key":"{key}","url":"{server}"}设置Suno和Luma #412
- 😄 升级:suno请求带 `/suno` 前缀
- 🐞 修复:请求新增逆向模型 `gpt-4o-all` #400
- 😄 新增: `claude-3-5-sonnet-20240620` 模型
- 🐞 修复:Bug: 手机版Safari下地址栏遮挡界面 #371

# 2.18.7
- 😄 新增:支持luma视频

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chatgpt-web-midjourney-proxy",
"version": "2.18.7",
"version": "2.18.8",
"private": false,
"description": "ChatGPT Web Midjourney Proxy",
"author": "Dooy <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "ChatGPT-MJ",
"version": "2.18.7"
"version": "2.18.8"
},
"tauri": {
"allowlist": {
Expand Down
4 changes: 2 additions & 2 deletions src/api/mjapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,15 @@ export const getLastVersion= async ()=>{
export const canVisionModel= (model:string)=>{
mlog('canVisionModel ',model );
//['gpt-4-all','gpt-4-v'].indexOf(model)==-1 && model.indexOf('gpt-4-gizmo')==-1
if( ['gpt-4-all','gpt-4-v','gpt-4v','gpt-3.5-net'].indexOf(model)>-1 ) return true;
if( ['gpt-4-all','gpt-4-v','gpt-4v','gpt-3.5-net','gpt-4o-all'].indexOf(model)>-1 ) return true;
if(model.indexOf('gpt-4-gizmo')>-1 || model.indexOf('claude-3-opus')>-1 )return true;

return false;
}
export const isCanBase64Model=(model:string)=>{
//gpt-4o
//customVisionModel
let visionArr=['gemini-pro-vision','gpt-4o','gpt-4o-2024-05-13','gemini-pro-1.5','gpt-4-turbo','gpt-4-turbo-2024-04-09','gpt-4-vision-preview', defaultVisionModel() ]
let visionArr=['gemini-pro-vision','gpt-4o','gpt-4o-2024-05-13','gemini-pro-1.5','gpt-4-turbo','gpt-4-turbo-2024-04-09','gpt-4-vision-preview','luma-video', defaultVisionModel() ]
if( homeStore.myData.session.customVisionModel ){
homeStore.myData.session.customVisionModel.split(/[ ,]+/ig).map( (v:string)=>{
visionArr.push( v.toLocaleLowerCase() )
Expand Down
16 changes: 14 additions & 2 deletions src/api/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { isNumber, isObject } from "@/utils/is";
import { t } from "@/locales";
import { ChatMessage } from "gpt-tokenizer/esm/GptEncoding";
import { chatSetting } from "./chat";
import { MessageApiInjection } from "naive-ui/es/message/src/MessageProvider";
//import {encode, encodeChat} from "gpt-tokenizer"
//import {encode, encodeChat} from "gpt-tokenizer/cjs/encoding/cl100k_base.js";
//import { get_encoding } from '@dqbd/tiktoken'
Expand All @@ -27,6 +28,7 @@ export const KnowledgeCutOffDate: Record<string, string> = {
"claude-3-opus-20240229": "2023-08",
"claude-3-sonnet-20240229": "2023-08",
"claude-3-haiku-20240307": "2023-08",
"claude-3-5-sonnet-20240620": "2024-04",
"gemini-pro": "2023-12",
"gemini-pro-vision": "2023-12",
"gemini-pro-1.5": "2024-04"
Expand Down Expand Up @@ -443,7 +445,7 @@ export const gptUsage=async ()=>{

}

export const openaiSetting= ( q:any )=>{
export const openaiSetting= ( q:any,ms:MessageApiInjection )=>{
//mlog()
mlog('setting', q )
if(q.settings){
Expand All @@ -453,9 +455,19 @@ export const openaiSetting= ( q:any )=>{
const url = obj.url ?? undefined;
const key = obj.key ?? undefined;
//let setQ= { }
gptServerStore.setMyData( {OPENAI_API_BASE_URL:url, MJ_SERVER:url, OPENAI_API_KEY:key,MJ_API_SECRET:key } )
gptServerStore.setMyData( {
OPENAI_API_BASE_URL:url,
MJ_SERVER:url,
SUNO_SERVER:url,
LUMA_SERVER:url,
OPENAI_API_KEY:key,
MJ_API_SECRET:key,
SUNO_KEY:key,
LUMA_KEY:key
} )
blurClean();
gptServerStore.setMyData( gptServerStore.myData );
ms.success("设置服务端成功!")

} catch (error) {

Expand Down
4 changes: 3 additions & 1 deletion src/api/suno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { sunoStore,SunoMedia } from "./sunoStore";
const getUrl=(url:string)=>{
if(url.indexOf('http')==0) return url;
if(gptServerStore.myData.SUNO_SERVER){
return `${ gptServerStore.myData.SUNO_SERVER}${url}`;
if( gptServerStore.myData.SUNO_SERVER.indexOf('suno')>0 ) return `${ gptServerStore.myData.SUNO_SERVER}${url}`;

return `${ gptServerStore.myData.SUNO_SERVER}/suno${url}`;
}
return `/sunoapi${url}`;
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/chat/layout/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const authStore = useAuthStore()
const rt = useRoute();
const ms = useMessage();
openaiSetting( rt.query)
openaiSetting( rt.query, ms )
if(rt.name =='GPTs'){
let model= `gpt-4-gizmo-${rt.params.gid.toString()}` ;
gptConfigStore.setMyData({model:model});
ms.success(`GPTs ${t('mj.modleSuccess')}`);
}else if(rt.name=='Setting'){
openaiSetting( rt.query);
openaiSetting( rt.query,ms );
if(isObject( rt.query )) ms.success( t('mj.setingSuccess') );
}else if(rt.name=='Model'){
let model= `${rt.params.gid.toString()}` ;
Expand Down
2 changes: 1 addition & 1 deletion src/views/mj/aiGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ initLoad();
</script>

<template>
<n-drawer v-model:show="st.showImg" :placement="isMobile?'bottom':'right'" :class="isMobile?['!h-[90vh]']: ['!w-[80vw]']" style="--n-body-padding:0">
<n-drawer v-model:show="st.showImg" :placement="isMobile?'bottom':'right'" :class="isMobile?['!h-[80vh]']: ['!w-[80vw]']" style="--n-body-padding:0">
<n-drawer-content :title="$t('mjchat.myGallery')" closable>
<gallery @close="st.showImg=false" v-if="st.showImg"/>
</n-drawer-content>
Expand Down
2 changes: 1 addition & 1 deletion src/views/mj/aiModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config = ref({
model:[ 'gpt-4-turbo-2024-04-09','gpt-4o-2024-05-13','gpt-4o','gpt-4-turbo','gpt-4-0125-preview','gpt-3.5-turbo',`gpt-4-1106-preview`,`gpt-3.5-turbo-16k`,'gpt-4','gpt-4-0613','gpt-4-32k-0613' ,'gpt-4-32k','gpt-4-32k-0314',`gpt-3.5-turbo-16k-0613`
,`gpt-4-vision-preview`,`gpt-3.5-turbo-1106` ,'gpt-3.5-turbo-0125'
,'gpt-3.5-turbo-0301','gpt-3.5-turbo-0613','gpt-4-all','gpt-3.5-net','gemini-pro',"gemini-pro-vision",'gemini-pro-1.5'
,'claude-3-sonnet-20240229','claude-3-opus-20240229','claude-3-haiku-20240307','suno-v3'
,'claude-3-sonnet-20240229','claude-3-opus-20240229','claude-3-haiku-20240307','claude-3-5-sonnet-20240620','suno-v3'
]
,maxToken:4096
});
Expand Down

0 comments on commit 41b79df

Please sign in to comment.