mirror of
https://github.com/Yanyutin753/ChatGPT-Next-Web-LangChain-Gpt-4-All.git
synced 2025-10-13 14:35:00 +00:00
feat send base64 or url
This commit is contained in:
@@ -57,6 +57,7 @@ export interface RequestBody {
|
||||
apiKey?: string;
|
||||
maxIterations: number;
|
||||
returnIntermediateSteps: boolean;
|
||||
updateTypes: boolean;
|
||||
useTools: (undefined | string)[];
|
||||
}
|
||||
|
||||
|
@@ -28,6 +28,7 @@ export interface LLMConfig {
|
||||
stream?: boolean;
|
||||
presence_penalty?: number;
|
||||
frequency_penalty?: number;
|
||||
updateTypes?: boolean;
|
||||
}
|
||||
|
||||
export interface LLMAgentConfig {
|
||||
|
@@ -104,7 +104,7 @@ export class ChatGPTApi implements LLMApi {
|
||||
});
|
||||
if (v.image_url) {
|
||||
let image_url_data = "";
|
||||
if (process.env.NEXT_PUBLIC_ENABLE_BASE64) {
|
||||
if (options.config.updateTypes) {
|
||||
var base64Data = await getImageBase64Data(v.image_url);
|
||||
let mimeType: string | null;
|
||||
try {
|
||||
@@ -347,6 +347,7 @@ export class ChatGPTApi implements LLMApi {
|
||||
baseUrl: baseUrl,
|
||||
maxIterations: options.agentConfig.maxIterations,
|
||||
returnIntermediateSteps: options.agentConfig.returnIntermediateSteps,
|
||||
updateTypes: modelConfig.updateTypes,
|
||||
useTools: options.agentConfig.useTools,
|
||||
};
|
||||
|
||||
|
@@ -359,6 +359,10 @@ const cn = {
|
||||
Title: "频率惩罚度 (frequency_penalty)",
|
||||
SubTitle: "值越大,越有可能降低重复字词",
|
||||
},
|
||||
UpdateType: {
|
||||
Title: "上传类型",
|
||||
SubTitle: "是否上传Base64格式消息",
|
||||
},
|
||||
Plugin: {
|
||||
Enable: {
|
||||
Title: "启用插件",
|
||||
|
@@ -365,6 +365,10 @@ const en: LocaleType = {
|
||||
SubTitle:
|
||||
"A larger value decreasing the likelihood to repeat the same line",
|
||||
},
|
||||
UpdateType: {
|
||||
Title: "Upload type",
|
||||
SubTitle: "Upload Base64 format message",
|
||||
},
|
||||
Plugin: {
|
||||
Enable: {
|
||||
Title: "Enable Plugin",
|
||||
|
@@ -56,6 +56,7 @@ export const DEFAULT_CONFIG = {
|
||||
historyMessageCount: 4,
|
||||
compressMessageLengthThreshold: 1000,
|
||||
enableInjectSystemPrompts: true,
|
||||
updateTypes: false,
|
||||
template: DEFAULT_INPUT_TEMPLATE,
|
||||
},
|
||||
|
||||
@@ -169,7 +170,14 @@ export const useAppConfig = createPersistStore(
|
||||
if (version < 3.8) {
|
||||
state.lastUpdate = Date.now();
|
||||
}
|
||||
|
||||
|
||||
if(process.env.NEXT_PUBLIC_ENABLE_BASE64){
|
||||
state.modelConfig.updateTypes = true;
|
||||
}
|
||||
else{
|
||||
state.modelConfig.updateTypes = false;
|
||||
}
|
||||
|
||||
return state as any;
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user